DirectAdmin Forums

Go Back   DirectAdmin Forums > Technical Discussion > MySQL / PHP

Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2008, 11:03 AM
nmb nmb is offline
Verified User
 
Join Date: Sep 2008
Posts: 31
PHP opcode Cache that work with suPHP?

Hi,


I have a question if there is any PHP opcode cache that really work with suPHP? I've used suPHP before and found that my server was always overloaded. (load average is more than 20 most of the time.)

Then, I decided to try PHP CLI, it worked a bit better. (load is about 14 - 18) Then, right after I've installed xCache. My load went below 2 which is normal for a Quad CPU.

I, then, switched back to PHP CGI but now with xCache installed. That didn't help at all. My load went back to more than 20 again. So, I had to switch back to PHP CLI again.

Today, I found that xCache doesn't work with suPHP. I also saw an article somewhere said eAccelerator doesn't work with suPHP either. Another article about APC + suPHP said that it cache some of PHP code but very less.

Any idea?


Thanks,
Reply With Quote
  #2  
Old 11-13-2008, 02:43 AM
suhailc suhailc is offline
Verified User
 
Join Date: Oct 2004
Posts: 116
Hi,

Did you ever find any alternatives?
__________________
DNSCluster.co.uk .:. your one stop, multiple node, geographically dispersed, failover DNS Cluster provider!
Reply With Quote
  #3  
Old 12-24-2009, 04:15 AM
venon's Avatar
venon venon is offline
Verified User
 
Join Date: Jul 2006
Posts: 40
would like to know also .
__________________
Using CentOS 5 with DirectAdmin 1.35.1
Apache 2.2.15 - Php 5.2.12 - MySQL 5.0.90- Named 9.3.6 -ProFTPd 1.3.3 dovecot 1.2.10 phpMyAdmin-3.3.1-all Openssl 1.0.0-beta5 Openssh 5.4p1 Suhosin 0.9.29
Reply With Quote
  #4  
Old 12-24-2009, 04:51 AM
massive's Avatar
massive massive is offline
Verified User
 
Join Date: Feb 2006
Posts: 240
you must install fcgi which currently is not supported by directadmin.
Reply With Quote
  #5  
Old 12-24-2009, 05:09 AM
venon's Avatar
venon venon is offline
Verified User
 
Join Date: Jul 2006
Posts: 40
that mean directadmin will stop working?
__________________
Using CentOS 5 with DirectAdmin 1.35.1
Apache 2.2.15 - Php 5.2.12 - MySQL 5.0.90- Named 9.3.6 -ProFTPd 1.3.3 dovecot 1.2.10 phpMyAdmin-3.3.1-all Openssl 1.0.0-beta5 Openssh 5.4p1 Suhosin 0.9.29
Reply With Quote
  #6  
Old 12-24-2009, 05:26 AM
massive's Avatar
massive massive is offline
Verified User
 
Join Date: Feb 2006
Posts: 240
that means that you have to install it manual.
Reply With Quote
  #7  
Old 12-29-2009, 07:03 AM
aED aED is offline
Verified User
 
Join Date: Dec 2009
Posts: 42
Quote:
Originally Posted by massive View Post
that means that you have to install it manual.
Do you have a tutorial on how to install them manually?
Reply With Quote
  #8  
Old 12-30-2009, 01:11 AM
massive's Avatar
massive massive is offline
Verified User
 
Join Date: Feb 2006
Posts: 240
tillo made one before some time :
http://www.directadmin.com/forum/sho...&postcount=450

but read this first :

http://directadmin.com/forum/showthr...ht=fcgi&page=1
Reply With Quote
  #9  
Old 12-30-2009, 01:54 AM
tillo's Avatar
tillo tillo is offline
Verified User
 
Join Date: Oct 2007
Location: Switzerland
Posts: 863
I would like to add that the reason any opcode cacher (APC, XCache, eAccelerator etc.) won't work with suPHP or direct CGI is because opcode caching works only on persistent PHP instances: the opcode (result of the interpretation of a PHP script) is cached in (shared, between threads and childs) memory and if PHP is killed and restarted for any page... well, there is no advantage at all, it is even worst.

The PHP module for Apache creates a persistent instance, as does FastCGI.
Those are the only ways I known about, and since mod_php does not allow separated, setuid/setgid instances by user (unless using one of the many experimental modules for Apache that do that) I guess FastCGI is the only secured way to allow opcode caching on shared production systems.
__________________
Martino Dell'Ambrogio <tillo@tillo.ch> http://www.tillo.ch/ Security Auditor
Willing to reward my help? Visit my Amazon.com Wish List. Thanks!

Last edited by tillo; 12-30-2009 at 01:57 AM.
Reply With Quote
  #10  
Old 01-02-2010, 03:55 AM
aED aED is offline
Verified User
 
Join Date: Dec 2009
Posts: 42
Quote:
Originally Posted by tillo View Post
I would like to add that the reason any opcode cacher (APC, XCache, eAccelerator etc.) won't work with suPHP or direct CGI is because opcode caching works only on persistent PHP instances: the opcode (result of the interpretation of a PHP script) is cached in (shared, between threads and childs) memory and if PHP is killed and restarted for any page... well, there is no advantage at all, it is even worst.

The PHP module for Apache creates a persistent instance, as does FastCGI.
Those are the only ways I known about, and since mod_php does not allow separated, setuid/setgid instances by user (unless using one of the many experimental modules for Apache that do that) I guess FastCGI is the only secured way to allow opcode caching on shared production systems.
I saw one of your posts that you are getting 500 errors does that still happends to your website? And have you seen a significant improvement on the performance of your system after doing your setup?
Reply With Quote
  #11  
Old 01-02-2010, 09:36 AM
tillo's Avatar
tillo tillo is offline
Verified User
 
Join Date: Oct 2007
Location: Switzerland
Posts: 863
I am not having 500 errors since I have been using APC instead of XCache, but this may not apply to everyone: I have uncommon PHP software running.

The improvement I experienced is outstanding (server was stalling for minutes, with up to 200 CPU+IO load, because of certain PHP compilations and now it's almost idle), but again this may not apply to everyone: if you have many low traffic websites opcode caching is not the solution, unless you have massive amount of memory (to store ALL of the opcode) or, instead, you select caching only for the most visited websites.
__________________
Martino Dell'Ambrogio <tillo@tillo.ch> http://www.tillo.ch/ Security Auditor
Willing to reward my help? Visit my Amazon.com Wish List. Thanks!
Reply With Quote
  #12  
Old 01-02-2010, 06:45 PM
aED aED is offline
Verified User
 
Join Date: Dec 2009
Posts: 42
Thanks tillo Ill try to follow your tutorial and see what happends
Reply With Quote
  #13  
Old 01-31-2010, 03:16 PM
Magician Magician is offline
Registered User
 
Join Date: Jan 2010
Posts: 2
tillo, before all - thank yoou for your tutorial. Before I start make changes ona my vps i have a question: it is possible to switch fastcgi + apc mode for only one domain, and others work on standard mode cgi/suphp? Because i have about 30 webpages but only two of them needs speed-kick ;-).

On vps i have 384MB RAM / 768 swap and i worry about if all webpages uses fastcgi there will be not enough memory for all.

Is it possible and - if yes - how to do this?

Last edited by Magician; 01-31-2010 at 05:04 PM.
Reply With Quote
  #14  
Old 01-31-2010, 07:06 PM
jlasman's Avatar
jlasman jlasman is offline
NoBaloney
 
Join Date: Jun 2003
Location: Riverside, Calif., USA
Posts: 20,706
You can run two separate versions of PHP (for example, 4.x and 5.x) and run one as fastcgi, and one as httpd module. You can not run different or the same minor versions that way, though.

Hopefully someone else can tell you how; I don't remember the details and I don't have time to look it up.

Jeff
__________________

Jeff Lasman <directadmin@nobaloney.net> +1 951 643-5345
Third-Party DirectAdmin administration and support
Dedicated Servers, Dedicated Reseller Accounts
NoBaloney Internet Services
P.O. Box 52200
Riverside, Calif. 92517
Reply With Quote
Reply

Tags
apc, eaccelerator, php, suphp, xcache

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:44 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
DirectAdmin © 2007 JBMC Software