The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Is cPanel's Apache install extremely lightweight?

Discussion in 'EasyApache' started by pumpkintits, May 6, 2014.

  1. pumpkintits

    pumpkintits Registered

    Joined:
    May 6, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I'm looking to migrate a lot of our customers to cPanel if it's the right fit. I have a few questions first, I'll start with my first question.

    Wordpress is NOTORIOUS for taking 50MB+ per httpd process (look at "top" in linux), but on a system we have running cPanel it's only consuming 4-7MB per process. I'm a very experienced sysadmin with Wordpress and have never seen this achieved before. Is cPanel using an ultra lightweight / trimmed down version of Apache? How are the processes so small?

    Lastly, where do I tune apache in cPanel, I notice in the httpd.conf file it says my changes will be overwritten.

    Thanks for your help, this has been the most impressive thing I've seen! Here are comparisons to show you the resource utilization from a regular apache install (and tuned) with a default Wordpress site, versus the cPanel install.

    Typical httpd memory usage (65+ MB / process)
    /http://i.snag.gy/k0yGz.jpg

    cPanel httpd memory usage (around 6MB / process)
    /http://i.snag.gy/jfjFo.jpg
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    It likely depends on the configuration of that specific cPanel server. For instance, does it use a particular PHP handler, or are any Apache configuration changes made? By default, cPanel does not optimize Apache from the standard configuration values.

    The following documents should be helpful when making changes to the Apache configuration file:

    How httpd.conf Is Processed
    Custom Directives Outside of a VirtualHost Tag
    Changes Contained Within a VirtualHost Directive

    Thank you.
     
  3. pumpkintits

    pumpkintits Registered

    Joined:
    May 6, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi Michael,

    Does CPanel not use mod_php to process PHP? It looks like it might be using SuPHP, DSO or FastCGI instead?

    There is no configuration of apache (within httpd.conf or php.ini) that can reduce Apache's memory consumption 800%+. Through research it looks like a PHP Handler difference. "mod_php" is installed by apache by default, but it looks like Cpanel may use suPHP, DSO or FastCGI? I've read FastCGI is extremely lightweight on memory and is likely the contributing factor to this. I'm just trying to help others out. From what I've read this will reduce your apache memory consumption from almost 100MB/per process to under 10MB/process. I am going to test this today, if anyone has any input please feel free to chime in.
     
  4. Shavaun

    Shavaun Well-Known Member

    Joined:
    Aug 15, 2013
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    cPanel uses EasyApache to configure PHP and Apache, and suPHP is the default selection. You can use the Configure PHP and SuEXEC interface in WHM to change PHP handlers, but of course you must have the handler you desire installed already. You can easily install PHP handlers with EasyApache (in WHM, go to Software >> EasyApache (Apache Update)), which will also show you a good bit of information about how cPanel configures Apache.

    If you can't find the option you want inside EasyApache, then you can still install it manually, just make sure to follow the instructions in our documentation. You can find our docs on EasyApache here: https://documentation.cpanel.net/display/EA
     
  5. pumpkintits

    pumpkintits Registered

    Joined:
    May 6, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thanks Shavaun.

    Also, for the rest of you I manually installed SuPHP and a default Wordpress install. Apach is down to 7MB/process but upon page visits it launches a "php-cli" process that gets to around 30-40MB/ea, however they are almost immediately terminated. So the memory savings is not as much as I thought it would be, however it does perform a lot quicker (pageloads). It's hard to say which solution is better considering the difficulty of managing SuPHP.

    I'll look into your documentation Shavaun.
     
  6. cypheroz

    cypheroz Member

    Joined:
    Feb 27, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Adelaide
    cPanel Access Level:
    Root Administrator
    This helps I think...
    phphandlers2.png
     
  7. storminternet

    storminternet Well-Known Member

    Joined:
    Nov 2, 2011
    Messages:
    462
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page