Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 480969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:56:49+00:00 2026-05-13T00:56:49+00:00

UPDATE: thanks to all the answer given, but they are all about the system

  • 0

UPDATE: thanks to all the answer given, but they are all about the system load, and not the apache.

My goal is to understand, inside my php scripts (the templating ones), when apache have an high load and is prefearrable to fork some traffic on lighttpd, that is here just to the long-polling and to light the apache’s load.

Hi guys, after this question i’ve started to use lighttpd for a long-polling service on my server, in order to not to nuke apache and the database forn this kind of requests.

Then, i started to use lighttpd also to static content (images, css, js, and so on).

So, actually, i have example.com served by apache, and polling.example.com served by lighttpd, both using memcache to reduce the database hits.

In apache, i’ve set the proxy module to proxy out all the requests to example.com/polling/* at polling.example.com/*

Now, im wondering if there is a way to retrieve the apache server load in php, in order to redirect even other ajax requests on lighttpd if apache have an high load.

I mean, something like:

<?php
$apache_server_load = /*hot to retrieve this value?*/;
if($apache_server_load >= $my_defined_max_load){
    $ajax_domain = '/polling';
}else{
    $ajax_domain = '';
}
?>
<script>
    [...]
    $.ajax({
        url: '<?php echo $ajax_domain; ?>/mypage.php',
        [...]
    });
    [...]
</script>

edit im running on Debian

p.s: i’ll also like to hear if this solution can be a nice approach, but would be another question.. feel free to comment if you like.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T00:56:49+00:00Added an answer on May 13, 2026 at 12:56 am

    Take a look at mod_status. Once you’ve got it set up, you’ll want to request and parse

    http://example.com/server-status?auto

    You’d probably want to cache the result for at least a few seconds, rather than re-do the same request for every single request that comes in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update: Thanks guys, I didn't realize it was very close to zero but not
UPDATE: Solved. Thanks BusyMark! EDIT: This is revised based on the answer below from
UPDATE: Thanks to everyone for the responses. I didn't realize document.write() was deprecated. Add
Update: Thanks for the suggestions guys. After further research, I’ve reformulated the question here:
Update Thanks to Marc's help the AlphaPagedList class is now available on CodePlex if
Update: I add a while to get the remain data, problem solved. thanks you
Update: Oh good grief, it was all a red herring following a bad merge.
UPDATE : sorry for the confusion. table was not my actual tablename, I have
UPDATE : Thank you all who tried to help. I appreciate your time. As
Recently scalaz caught my eye. It looks very interesting, but I have not found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.