Apache and easy build options for better php performance

ASTRAPI

Well-Known Member
Jul 8, 2008
321
0
66
Hello

I want to ask what do you recommend me to check on easy apache build to get the best php performance possible?

The server is dedicated and very powerfull and it has only one account in it.

I am using cpanel and Centos.

Is it better to use DSO or Fcgi ?

At the moment i have check for build the:

Asis
Cache
Disk cache
Env
Expires
Mod fcgid
File cache
File protect
Headers
Mpm prefork
proxy
version
Bcmath
CGI
Curl
Ftp
GD
Iconv
Imap
Magic Quotes
Mbregex
Mysql
Mysql of the system
POSIX
Path Info Check
Pear
Sockets
TTF
Zip
Zlib


So what do you think i must add or remove to get the maximum performance for php from Apache and php?

Some users recommend me to use mod_php and some fast cgi and i don't know what are those and which is better and how to get them run using the easy apache build :(

Please help me.

Thank you
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
41
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Since you are only asking about performance and not security, then DSO would be the preferred choice in that model. I would not recommend DSO for security reasons as has already been stated. If you select FCGI to have better performance over suPHP but better security than DSO, you would want to be aware that you'll have to tweak settings for FCGI to get it to perform more optimally, since the default configuration is only a baseline, generalize setup.
 

ASTRAPI

Well-Known Member
Jul 8, 2008
321
0
66
Any tips on which file i must edit and tweak?

What do you recommend me to start adjusting on my server:

2x Intel Xeon Quad 5405
24gb ram -->8gb free


Thank you
 

Massoud

Active Member
Feb 20, 2011
36
0
56
Since you are only asking about performance and not security, then DSO would be the preferred choice in that model. I would not recommend DSO for security reasons as has already been stated. If you select FCGI to have better performance over suPHP but better security than DSO, you would want to be aware that you'll have to tweak settings for FCGI to get it to perform more optimally, since the default configuration is only a baseline, generalize setup.
I always heard that when I want to choice FCGI I should tune the setting but there is not certain guide to do this, Could you please anyone help me to tune my WS wit FCGI Handler for getting best performance, I get Error 500 on traffic peak and I need to know where and how can I tune my FCGI Setting. Thank you
 

lastguru

Member
Jul 29, 2010
13
0
51
cPanel Access Level
Root Administrator
There is indeed a huge lack of leads on how to do this with FCGI. Everybody is saying "tune the settings", but nobody gives a set of links which explain the config.

As for Error 500, you probably do not have enough processes. Here is my config, which may not be optimal, but still is a good starting point:

Code:
<IfModule mod_fcgid.c>
MaxRequestsPerProcess 500
MaxProcessCount 64
DefaultMaxClassProcessCount 16
DefaultMinClassProcessCount 0
IPCConnectTimeout 90
IPCCommTimeout 90
IdleTimeout 300
IdleScanInterval 30
BusyTimeout 90
BusyScanInterval 30
ErrorScanInterval 3
ZombieScanInterval 3
ProcessLifeTime 3600
</IfModule>
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
41
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
There is indeed a huge lack of leads on how to do this with FCGI. Everybody is saying "tune the settings", but nobody gives a set of links which explain the config.
Unfortunately, I cannot provide recommendations for tuning the settings at this time. I only indicated we at cPanel include baseline general settings (in /usr/local/apache/conf/php.conf file for information on where they are included).

Now, the reason I cannot provide recommendations is that I do not have an overly active machine running FCGI. While I do have a machine running FCGI, given that it isn't active, any recommendations I provide wouldn't be overly valid compared to others here who likewise run FCGI and have active servers. Additionally, I would be very wary of taking advice from anyone on what settings to use unless that machine has some decent activity, since the main point of using FCGI is that it is for a machine that cannot perform optimally under suPHP due to load issues from high PHP site activity and for a machine that requires more security than DSO.
 

boonjackmedia

Active Member
Apr 28, 2010
35
1
56
Cincinnati, OH USA
I don't believe Easy Apache supports the latest version 2.36 for mod_fcgid, the settings lastguru posted are for version 2.35 will work fine.

The new version has updated naming conventions for the settings. I believe a lot of the issues with spawning and rebooting have been addressed too.
mod_fcgid - FastCGI interface module for Apache 2 - The Apache HTTP Server Project

Any idea when Easy Apache will use mod_fcgid 2.36?
 

ASTRAPI

Well-Known Member
Jul 8, 2008
321
0
66
Ok so for my centos 64bit with cpanel i must edit this:

/usr/local/apache/conf/php.conf

?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
41
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
If you want to revise the FCGI settings, the file that handles those settings would be /usr/local/apache/conf/php.conf file correct. If you run WHM > EasyApache (Apache Update) and revise the handler at any time at the end of the build, you are going to have to also run /scripts/posteasyapache to re-create your settings in that file since it will be overwritten whenever the PHP handler is changed in any way.