Portal Home > Knowledgebase > Articles Database > Hoe to boost performance under suPHP?


Hoe to boost performance under suPHP?




Posted by ServerZoo, 03-29-2011, 09:34 AM
as known that eaccelerator is not working with suPHP, any other method to boost suPHP environment? heard about fastcgi, is it easy to work with cpanel? prefer not to try litehttpd or nnigx that need a lot of manual work...

Posted by UNIXy, 03-29-2011, 09:38 AM
Memcached might help depending on how it's used at the script level. You could also run Varnish (http://www.varnish-cache.org) as it caches the whole page and is more effective than opcode caching. Regards Joe / UNIXY

Posted by YUPAPA, 03-29-2011, 10:34 AM
performance is much much more better

Posted by brianoz, 03-30-2011, 04:56 AM
There are several ways to run suphp equivalents that don't have the performance downside of suphp; check out fastcgi (which you mentioned) and I think also MPM worker. Considerably faster if your machine is under stress. Also, some people are using nginx as a frontend accelerator, that may also help.

Posted by tumbano, 03-30-2011, 07:49 AM
I'd also suggest Varnish. We use the cPanel version offered by Unixy on some servers and it does its job efficiently

Posted by Acozilla, 03-30-2011, 05:18 PM
To boost your PHP performance, the best results come from editing your code to be more efficient. Configuration changes can only do so much. I'm not too familiar with suPHP, but you may want to look into xcache and see if it works with it. Also, if your server has multiple CPUs, xcache has a option to spread the caching/load across them, which works great. Also, like UNIXy said, memcache is just awesome. I use it to tack my users' downloads and it performance lightning fast. This way I avoid having to use my disks to store temporary data. Finally, you do not have to switch to lighttpd or nginx to boost your PHP performance. My studies have shown that apache will indeed load dynamic content faster than nginx and lighttpd. This is because there is no delay like there is with nginx/lighttpd when it proxies (forwards) the dynamic request to the application server and then another (small) delay to report back the results. Be sure to disable all unnecessary mods in Apache, and host your static content on nginx/lighttpd servers (or another port). Be sure to enable gzip/deflate as that will help too. Other than that, you'll most likely need to optimize your code to be more efficient as I've always seen the greatest boost in performance through clever coding tricks, ESPECIALLY for queries.

Posted by Patrick, 03-30-2011, 08:39 PM
If you have the memory available, switch to FastCGI. It pretty much acts like suPHP minus the horrible bloat and terrible performance. Security wise, they are both pretty much on par... unless you're short on memory, I can't see any reason for someone to use suPHP at this point.

Posted by speckl, 03-30-2011, 09:06 PM
I agree. If short on memory you can also set fastcgi to remain active for a few seconds (10 - 15) after the last request for that php user before it exits. This helps with ram drastically and it provides the speed benefits that fastcgi offers over the suphp open/close method.

Posted by Lightwave, 03-30-2011, 09:17 PM
The better solution of course is to get rid of suPHP. Completely unnecessary. Better ways to skin the cat. FastCGI is one way... tho I personally wouldn't bother unless your application needs to scale past one application server.

Posted by ClaudiuPopescu, 03-31-2011, 08:07 AM
By installing http://nginxcp.com/ Your work is virtually 0 For LiteSpeed the same thing applies, the configurations are generated automatically, you only need to tweak the config a bit (not needed, works just fine by default).

Posted by ServerZoo, 04-27-2011, 05:32 AM
I am now looking at FASCGI too, but where to configure this?

Posted by ServerZoo, 04-27-2011, 05:33 AM
does FASTCGI need all 777 to be 755? does .htaccess will work ? or clients need to put php.ini under EVERY folders? or just put one php.ini under public_html ? does FASTCGI work with eaccelerator?

Posted by ServerZoo, 04-27-2011, 07:43 PM
anyone ? please

Posted by Patrick, 04-28-2011, 11:27 AM
FastCGI should be working under 755. It's a bad idea to use 777 anyway from a security standpoint since anyone on the server could in theory modify those files as they are world writable. Yes, .htaccess files will work, however php.ini will have to be put under /cgi-bin/ if you're using cPanel. 1. Put the php.ini under the /cgi-bin/ directory. 2. Create a file called php.fcgi under the /cgi-bin/ directory and add the following: #!/bin/sh export PHP_FCGI_CHILDREN=1 export PHP_FCGI_MAX_REQUESTS=10 exec /usr/local/cpanel/cgi-sys/php5 3) chmod 755 php.fcgi 4) Edit /public_html/.htaccess and add the following: AddHandler php5-fastcgi .php Action php5-fastcgi /cgi-bin/php.fcgi Yes. Make sure you add eAccelerator after Zend and that you comment out the Optimizer extensions. For example your php.ini should look something like: [Zend] ;zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.0 ;zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.0 zend_optimizer.version=3.3.0 zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so zend_extension="/usr/local/lib/php/20090626/eaccelerator.so" eaccelerator.shm_size="32" eaccelerator.cache_dir="/tmp/eaccelerator" eaccelerator.enable="1" eaccelerator.optimizer="1" eaccelerator.check_mtime="1" eaccelerator.debug="0" eaccelerator.filter="" eaccelerator.shm_max="0" eaccelerator.shm_ttl="0" eaccelerator.shm_prune_period="0" eaccelerator.shm_only="0" eaccelerator.compress="1"



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Trying VPS (Views: 702)
YardVPS down yet again (Views: 753)


Language: