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!

Optimizing Apache configuration in WHM/Centos7

Discussion in 'Workarounds and Optimization' started by alexis75, Nov 7, 2017.

  1. alexis75

    alexis75 Member

    Joined:
    Sep 12, 2017
    Messages:
    14
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    We are running CloudLinux on VPS with 2 Gb RAM, trying to figure out how to optimize Apache properly using 'Configure Apache RLimits'. Currently it disabled and it says "Current setting is 0 MB. We recommend 394 MB". Is it just to follow recommended value, restart Apache and monitor how it will behave?
    I also seen in Apache log that some of the processes (mostly from Wordpress accounts) using as much as 515 Mb of Ram, but I guess suggested 394 is average..
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,659
    Likes Received:
    1,787
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Yes, that's generally a good approach.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. alexis75

    alexis75 Member

    Joined:
    Sep 12, 2017
    Messages:
    14
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    Ok, thanks for a quick reply! :) I'll try that right away.

    Also, as it related to Apache configuration we have these settings in 'General config',
    running VPS with 3 CPU / 2048 Mb RAM / 4 Gb swap with prefork Apache:

    ***************************
    ...
    Start Servers = 5
    Minimum Spare Servers = 5
    Maximum Spare Servers = 10
    Server Limit = 256
    Max Request Workers = 150
    Max Connections Per Child = 1000
    Keep-Alive Timeout = 5
    Max Keep-Alive Requests = 100
    Timeout = 300
    ...
    ***************************

    are those settings looks Ok for correct Apache behaviour?

    What would be recommended settings taking into account our VPS parameters?
    really appreciate any tips on this cause judging by Logs there are might be some problems with Apache, feels like those values are a bit too high for our VPS configuration.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,659
    Likes Received:
    1,787
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Those values are often dependent on the traffic and usage your server is receiving. I've moved this thread to our Optimization forum where you might receive additional user-feedback.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. alexis75

    alexis75 Member

    Joined:
    Sep 12, 2017
    Messages:
    14
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    Ok, thank you!

    correction:
    we just added +1Gb RAM to our VPS,
    now 'Configure Apache RLimits' says 478 Mb as recommended - > follow its advice.

    *VPS configuration now: 3 CPU / 3 Gb RAM / 4 Gb swap with prefork Apache

    Found this advice on web:
    "if an average one Apache process consumes 50Mb RAM and Server RAM is 3Gb, and you want to leave 512Mb for the rest processes, then:
    MaxClients = (3Gb – 512Mb)/50Mb = ~ 50

    I assume MaxClients is MaxRequestWorkers in Apache 2.4.29?
    shall we change 'default' MaxRequestWorkers=150 to 50 using formula above?
     
    #5 alexis75, Nov 7, 2017
    Last edited: Nov 8, 2017
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