Is cPanel's Apache install extremely lightweight?

pumpkintits

Registered
May 6, 2014
3
0
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
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?
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.
 

pumpkintits

Registered
May 6, 2014
3
0
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.
 

Shavaun

Well-Known Member
Aug 15, 2013
106
0
91
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
 

pumpkintits

Registered
May 6, 2014
3
0
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.