Results 1 to 13 of 13
  1. #1

    Show "server is busy" page at high CPU load average

    Hello.
    I want to show a "server is busy, try again later" page when my web server CPU load average is high. How can I do that? I'm on CentOS 6.4 with Apache/WHM/Cpanel.

  2. #2
    What software/script are you using on your websites? Some software has this built in. For example MyBB has an option called "maximum server load" which does what you're looking for.

  3. #3
    I have WordPress. I am looking for a linux/apache/whm/cpanel method to do this.

  4. #4
    You should be able to optimize both apache and mysql to get better server load average. What type of hardware are you running on? Have you looked through the cPanel doc's? That is usually your best ticket on where to find out the "tips and tricks"

  5. #5
    The webserver is optimized. My webserver has spikes that break it. I just want to show a "server busy" page that can keep CPU usage under normal parameters.

  6. #6
    Join Date
    Aug 2003
    Location
    East Coast
    Posts
    2,082
    What process is using all of your cpu?

  7. #7
    PHP and mySQL

  8. #8
    Join Date
    Nov 2013
    Posts
    83
    Are you wanting to just customize a 500 series error message that Apache naturally shows or do you want a mechanism to automatically trigger the splashscreen?

  9. #9

    11

    Well, when these spikes happen the website is unresponsive and the server breaks, I get high CPU usage, server remains without memory and it requires manual intervention. I just want to show a page when the cpu load is higher than x (or a similar mechanism).

  10. #10
    Join Date
    Nov 2013
    Posts
    83
    PHP has a function that may work. They recommend the below code (from their site). You would need to tweak the output to display the HTML you would like to display:

    <?php
    $load = sys_getloadavg();
    if ($load[0] > 80) {
    header('HTTP/1.1 503 Too busy, try again later');
    die('Server too busy. Please try again later.');
    }
    ?>

  11. #11
    bestssdhost thank you very much!
    Is there a more "global" solution? It's a pain in the *** to implement this code in every client's website.

  12. #12
    Is there an option for apache to limit the maximum of http requests/second that will accept?

  13. #13
    Join Date
    May 2013
    Location
    India
    Posts
    747
    Quote Originally Posted by cosminn777 View Post
    bestssdhost thank you very much!
    Is there a more "global" solution? It's a pain in the *** to implement this code in every client's website.
    Rather than using such custom solution, I suggest to use solutions like CloudLinux or 1H HIVE manage server resources. Ofcourse using them needs to add a few more $ ; but that will be a worth for shared hosting.

    Code:
    Is there an option for apache to limit the maximum of http requests/second that will accept?
    Apache doesn't provide such an option; but you can set maximum number of connections it can handle. Also you can place some restrictions via mod_qos.

Similar Threads

  1. Replies: 39
    Last Post: 02-22-2008, 03:22 AM
  2. High server load and "resource outage" error
    By McClickson in forum Hosting Security and Technology
    Replies: 2
    Last Post: 01-09-2006, 10:48 PM
  3. What is your average "Server Load"?
    By 0218 in forum Dedicated Server
    Replies: 20
    Last Post: 04-30-2004, 06:36 AM
  4. Load Average Tool "sar" - where did it go in RHEL?
    By HD-Sam in forum Hosting Security and Technology
    Replies: 1
    Last Post: 04-04-2004, 04:06 PM
  5. "load average we are working on" << picture included
    By Mdot in forum Dedicated Server
    Replies: 11
    Last Post: 12-11-2002, 04:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •