Results 1 to 14 of 14

Thread: PHP opcode Cache that work with suPHP?

  1. #1
    Join Date
    Sep 2008
    Posts
    203

    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,
    ________
    Vaporizer wiki
    Last edited by nmb; 04-20-2011 at 10:27 AM.

  2. #2
    Join Date
    Oct 2004
    Posts
    119
    Hi,

    Did you ever find any alternatives?
    DNSCluster.co.uk .:. your one stop, multiple node, geographically dispersed, failover DNS Cluster provider!

  3. #3
    Join Date
    Jul 2006
    Posts
    52
    would like to know also .
    Using CentOS 6.2 64bits with DirectAdmin 1.41.0 Apache 2.4.2 - Php 5.3.15 cli - MySQL 5.5.25a- ProFTPd 1.3.4b - FreeType 2.4.10-
    dovecot 2.1.8 - curl 7.27.0 - Exim 4.80- pcre-8.20 - phpMyAdmin-3.5.2-all-languages - csf v5.48 - Xcache 1.3.3 - SpamAssassin 3.3.2 - ClamAV 0.97.4

  4. #4
    Join Date
    Feb 2006
    Posts
    298
    you must install fcgi which currently is not supported by directadmin.

  5. #5
    Join Date
    Jul 2006
    Posts
    52
    that mean directadmin will stop working?
    Using CentOS 6.2 64bits with DirectAdmin 1.41.0 Apache 2.4.2 - Php 5.3.15 cli - MySQL 5.5.25a- ProFTPd 1.3.4b - FreeType 2.4.10-
    dovecot 2.1.8 - curl 7.27.0 - Exim 4.80- pcre-8.20 - phpMyAdmin-3.5.2-all-languages - csf v5.48 - Xcache 1.3.3 - SpamAssassin 3.3.2 - ClamAV 0.97.4

  6. #6
    Join Date
    Feb 2006
    Posts
    298
    that means that you have to install it manual.

  7. #7
    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?

  8. #8
    Join Date
    Feb 2006
    Posts
    298

  9. #9
    Join Date
    Oct 2007
    Location
    Switzerland
    Posts
    861
    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.
    Last edited by tillo; 12-30-2009 at 02:57 AM.
    Martino Dell'Ambrogio <tillo@tillo.ch> http://www.tillo.ch/ Security Auditor

  10. #10
    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?

  11. #11
    Join Date
    Oct 2007
    Location
    Switzerland
    Posts
    861
    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

  12. #12
    Join Date
    Dec 2009
    Posts
    42
    Thanks tillo Ill try to follow your tutorial and see what happends

  13. #13
    Join Date
    Jan 2010
    Location
    EU / PL
    Posts
    123
    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 06:04 PM.

  14. #14
    Join Date
    Jun 2003
    Location
    California
    Posts
    26,122
    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
    +1 951 643-5345
    Third-Party DirectAdmin administration and support
    Dedicated Servers, Dedicated Reseller Accounts
    NoBaloney Internet Services div. Qnito Incorporated
    848 North Rainbow Blvd., Suite #3789
    Las Vegas, NV 89107-1103

Similar Threads

  1. <? doesn't work since suPHP
    By BlueCola in forum CustomBuild
    Replies: 2
    Last Post: 01-20-2012, 02:39 PM
  2. Opcode Cache
    By aED in forum System-Level Technical Discussion
    Replies: 2
    Last Post: 01-03-2010, 01:38 PM
  3. Changed to SuPHP and now no plugins work
    By Nexxterra.com in forum General Technical Discussion & Troubleshooting
    Replies: 3
    Last Post: 11-18-2009, 02:19 PM
  4. suphp does'nt work
    By ben29 in forum General Technical Discussion & Troubleshooting
    Replies: 7
    Last Post: 11-28-2008, 03:34 PM
  5. SuPhp doesn't work
    By WHI in forum CustomBuild
    Replies: 3
    Last Post: 11-11-2008, 02:40 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •