Results 1 to 12 of 12

Thread: eAccelerator Question

  1. #1
    Moderator
    Join Date
    Jul 2007
    Posts
    10,086

    Question eAccelerator Question

    I was recommended to use eAccelerator to increase the performance of my PHP scripts.

    I would like to ask the hosting gurus if it's good and if it's worth it.

    Some examples of PHP scripts that I use are TGP script, links trade script, OpenX and Piwik. Thank you.

  2. #2
    Judgemental Cunt
    Join Date
    Jul 2003
    Hood
    Pierced
    Posts
    10,665
    Pimp $
    406
    It shouldn't be the PHP that is slow. It's more likely the MySQL database queries. If you repair and optimize your databases regularly, install some sort of a caching engine, you should be able to run hundreds of domains making multiple MySQL queries concurrently. Making the need for eAccelerator a moot point. eAccelerator is a band-aid solution at best for deeper seeded issues.

    I run literally hundreds of PHP / MySQL scripts on a single server without any accelerators. I don't have any speed issues. Just make sure you have enough RAM. If your server is choking for RAM, no accelerator of any kind is going to fix that.

  3. #3
    Moderator
    Join Date
    Jul 2007
    Posts
    10,086
    I do not have any problems with PHP or MySQL. I was recommended eAccelerator to fine tune the server actually.

    From your input, I guess that it is better to replace eAccelerator with APC, a PHP cache engine.

  4. #4
    give tail! Dario's Avatar
    Join Date
    Jun 2003
    Hood
    El Mundo
    Posts
    16,365
    Pimp $
    101,026
    Think of it this way..

    eAccelerator caches the compiled versions of your PHP scripts, not the output. Basically, if you have large PHP scripts with many includes etc, and these scripts do not use any caching for the output they generate -- then eAccelerator will decrease the time needed to compile and process these scripts on every request. That is a great thing!

    However, if you are using lets say Wordpress, where there is all kinds of caching done on the actual content. Then you would get much better results from focusing on content caching. Especially with a script like WordPress where minimal files are loaded before the cache is being consulted.

    For traffic tracking you should benefit though since there is no output that can be cached in these scripts, it's just processing of data. Caching the compiled versions on the scripts here can potentially save a lot of resources.
    “Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!’” — Hunter S. Thompson

  5. #5
    Moderator
    Join Date
    Jul 2007
    Posts
    10,086
    Quote Originally Posted by Dario View Post
    Think of it this way..

    eAccelerator caches the compiled versions of your PHP scripts, not the output. Basically, if you have large PHP scripts with many includes etc, and these scripts do not use any caching for the output they generate -- then eAccelerator will decrease the time needed to compile and process these scripts on every request. That is a great thing!

    However, if you are using lets say Wordpress, where there is all kinds of caching done on the actual content. Then you would get much better results from focusing on content caching. Especially with a script like WordPress where minimal files are loaded before the cache is being consulted.

    For traffic tracking you should benefit though since there is no output that can be cached in these scripts, it's just processing of data. Caching the compiled versions on the scripts here can potentially save a lot of resources.
    When you mention traffic tracking, do you mean an analytics software or a traffic trade script? In addition, when you mention includes, do includes in templates count?

    Correct me if I'm wrong, from what I gather of your post, eAccelerator looks like the way to go since I also have a comment and rating script besides OpenX and Piwik. As for TGPX, it simply builds static pages but my pages have multiple PHP includes. Whereas APC is better for a heavily dynamic site like a Wordpress site with plug-ins.

  6. #6
    give tail! Dario's Avatar
    Join Date
    Jun 2003
    Hood
    El Mundo
    Posts
    16,365
    Pimp $
    101,026
    Quote Originally Posted by A.J. Angel View Post
    When you mention traffic tracking, do you mean an analytics software or a traffic trade script? In addition, when you mention includes, do includes in templates count?

    Correct me if I'm wrong, from what I gather of your post, eAccelerator looks like the way to go since I also have a comment and rating script besides OpenX and Piwik. As for TGPX, it simply builds static pages but my pages have multiple PHP includes. Whereas APC is better for a heavily dynamic site like a Wordpress site with plug-ins.
    I mean both, any script that does not serve to output content but simply to process data. And yes, template includes (if they are PHP files) would also be faster since the PHP files would not have to be parsed. However, the actual templates would not necessarily be cached, they still have to load from MySQL or wherever you are storing them.

    Basically, eAccelerator is not really a tool to serve content faster. Anything that has to load from MySQL or disk will still remain the same, which is usually the bottleneck when serving content. In the few cases I have used eAccelerator it has been for very high traffic scripts that were putting a lot of load on the CPU.

    And well Wordpress, that's a whole different thread
    “Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!’” — Hunter S. Thompson

  7. #7
    give tail! Dario's Avatar
    Join Date
    Jun 2003
    Hood
    El Mundo
    Posts
    16,365
    Pimp $
    101,026
    A bit more food for thought...

    Say you have thousands of pages and they are all PHP, with traffic spread allover them, then eAccelerator (or APC) is not so good. That is because you would either have to give it a ton of resources to keep cached versions of all scripts, or live with the overhead of constantly optimizing and caching scripts that have rotated out of the index.

    But if its just a few PHP files getting all the requests, then they will always be in the cache and you will enjoy awesome performance increases with minimal overhead.

    Makes sense?
    “Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!’” — Hunter S. Thompson

  8. #8
    Moderator
    Join Date
    Jul 2007
    Posts
    10,086
    WOW! I appreciate the clarifications. Your replies are certainly helpful. Thank you Dario.

  9. #9
    Posting is fun!
    Join Date
    Feb 2012
    Posts
    43
    Pimp $
    82
    A quick answer about "eAccelerator - yes or no": YES, BUT...

    I benchmarked a server running plain installation of WordPress with no additional plugins (i.e. no additional caching plugins) and tested how long it would take to fetch the home page 10000 times some years ago. Hardware now is faster, but PHP didn't change much in that time, so I think results will still be valid, just on a higher level.

    My Result:

    10000 loads of WordPress without opcode cache took 100% of time (about 15 minutes)
    10000 loads of WordPress WITH eAccelerator took 52% of time (about 8 minutes)
    10000 loads of WordPress with APC took about 53% minutes (about 8 minutes)

    (APC is another opcode cache)

    I did some other tests with scripts that do not access database (see explanations above) and results went from opcode cache servers being a little bit faster to about 8 times as fast as without cache.


    Now to the BUT:

    So far there is no version of eAccelerator that is compatible with PHP 5.4

    The other option is APC which was a bit slower in my tests, but it is officially supported by the PHP community. The last time I tested it - however - it crashed my servers every few hours. It might be better today, but be sure to have an eye on your servers after installation.
    Last edited by DiGiT; 04-16-2012 at 03:21 AM.

  10. #10
    give tail! Dario's Avatar
    Join Date
    Jun 2003
    Hood
    El Mundo
    Posts
    16,365
    Pimp $
    101,026
    Quote Originally Posted by DiGiT View Post
    A quick answer about "eAccelerator - yes or no": YES, BUT...

    I benchmarked a server running plain installation of WordPress with no additional plugins (i.e. no additional caching plugins) and tested how long it would take to fetch the home page 10000 times some years ago. Hardware now is faster, but PHP didn't change much in that time, so I think results will still be valid, just on a higher level.

    My Result:

    10000 loads of WordPress without opcode cache took 100% of time (about 15 minutes)
    10000 loads of WordPress WITH eAccelerator took 52% of time (about 8 minutes)
    10000 loads of WordPress with APC took about 53% minutes (about 8 minutes)

    (APC is another opcode cache)

    I did some other tests with scripts that do not access database (see explanations above) and results went from opcode cache servers being a little bit faster to about 8 times as fast as without cache.


    Now to the BUT:

    So far there is no version of eAccelerator that is compatible with PHP 5.4

    The other option is APC which was a bit slower in my tests, but it is officially supported by the PHP community. The last time I tested it - however - it crashed my servers every few hours. It might be better today, but be sure to have an eye on your servers after installation.
    Very informative!

    Here is a different bench marking from 2008 using eAccelerator, APC and XCache:
    http://2bits.com/articles/benchmarki...-compared.html

    Consistent with your testing eAccelerator is slightly faster.

    I've also read about people having issues with APC, as well as some suggested solutions, do not remember links now. Worth taking note of though is that aside from the PHP core developers supporting this engine, it is also the cache of choice for Facebook, and their team has been donating a lot of code to it.

    Bright looking future in other words!
    “Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!’” — Hunter S. Thompson

  11. #11
    Moderator
    Join Date
    Jul 2007
    Posts
    10,086
    Very informative posts above. ^_^

    Anyway, I have eAccelerator installed at the moment since I am still on PHP 5.3 but if I upgraded to 5.4, I shall probably go with APC if I have load problems. I did read the issues you mentioned regarding APC on other forums and that made me go with eAccelerator at this time. I do hope that those issues would be resolved in the future since eAccelerator is not supported anymore.

  12. #12
    free porn for the people the Shemp's Avatar
    Join Date
    Jul 2003
    Hood
    Outlaw Ranch
    Posts
    15,362
    Pimp $
    19,356
    good post, guys
    i actually learned something

Bookmarks

Bookmarks

Posting Permissions

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