Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

High traffic optimizations

Discussion in 'Workarounds and Optimization' started by mvandemar, Nov 15, 2017.

  1. mvandemar

    mvandemar Well-Known Member

    Joined:
    Jun 17, 2006
    Messages:
    70
    Likes Received:
    1
    Trophy Points:
    158
    I am working on a client's site trying to get things optimized for the amount of traffic they have and thought it would be worth digging into the actual Apache settings. It's a 64bit server with 32 cores and 64GB of ram, and we were still experiencing outages. The thing is, when they were happening I was still able to log in via ssh and run htop, and the load averages were ~12, and it was using less than 14GB of the ram. I have seen servers with much fewer resources peak much higher on the cpu usage before actually crashing, and when that happened we couldn't even restart Apache without it hanging for 5+ minutes first. These are the current settings:

    StartServers 5
    MinSpareServers 10
    MaxSpareServers 20
    ServerLimit 500
    MaxRequestWorkers 200
    MaxConnectionsPerChild 10000
    KeepAlive On
    KeepAliveTimeout 5
    MaxKeepAliveRequests 100
    Timeout 300

    The two main sites on there are Wordpress sites, they get mabye 1 million visitors/month and they are involving a bunch of logged in users interacting with each other, so I know it requires a large amount of resources to run the sites. I first started looking at the settings because initially I thought KeepAlive was off but I was wrong.

    1) Do these settings look adequate for a server handling this level of traffic?

    2) Are there other settings I should be looking at?

    3) The Timeout is set to 300 (5 minutes), but when I was analyzing the traffic logs yesterday I noticed there appeared to be some requests taking over 12 minutes to complete, eg:

    Code:
    xx.xx.xx.xx - - [11/Nov/2017:15:26:55 +0000] "GET /... HTTP/1.1" 200
    xx.xx.xx.xx - - [11/Nov/2017:15:26:51 +0000] "GET /... HTTP/1.1" 200
    xx.xx.xx.xx - - [11/Nov/2017:15:13:47 +0000] "POST /wp-admin/admin-ajax.php?action=http_worker&nonce=fb2c735fbb HTTP/1.1" 404
    xx.xx.xx.xx - - [11/Nov/2017:15:26:56 +0000] "GET /... HTTP/1.1" 302
    xx.xx.xx.xx - - [11/Nov/2017:15:26:54 +0000] "GET /... HTTP/1.1" 200
    
    If the timeout is set to 300, shouldn't that request that was made at 15:13 have died by 15:18? Also, that file does actually exist and returns a 200 Ok in the other entries most of the time. Is this indicative of some other issue?

    Thanks.

    -Michael
     
  2. cPWilliamL

    cPWilliamL cP Technical Analyst II
    Staff Member

    Joined:
    May 15, 2017
    Messages:
    257
    Likes Received:
    29
    Trophy Points:
    103
    Location:
    America
    cPanel Access Level:
    Root Administrator
    Hi,

    It can be difficult to say which settings may be reasonable. While you have provided requests statistics, it's still entirely dependent on site code efficiency as well as general connection speeds from your clients.

    When you see outages, what is the error from the client side? Are you seeing any errors in the Apache error_log at the same time? You also didn't mention the Apache MPM or PHP handler you are using. I would recommend ensuring you're using a threaded MPM like worker, and a PHP handler like CGI or FPM or LSAPI.

    Regarding the timeout, where are you seeing the running time? The access logs don't provide that information.

    The 404 could be filtering from something like mod_security.

    Thanks,
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice