This is a classic case of constantly learning something new about computers. In fact for those that know more, if you see any mistakes in what I have to say here…feel free to comment and correct me!
A few days ago I mentioned that we optimized the Virtual Private Server that Like that Idea runs on with Zend Optimizer. We didn’t see many improvements, but I think that I made the mistake in assuming what the optimizer did and didn’t do. From my online readings it appears that the Zend Optimizer works best for those applications encoded on a Zend platform (something we do not have). So I went looking elsewhere and found the open source application, eAccelerator.
eAccelerator is a free open-source PHP accelerator, optimizer, encoder and dynamic content cache. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.
I installed eAccelerator from the source on the Apache server. Although not as easy as installing the Zend Optimizer, any Web administrator or computer geek worth his or her grain of salt shouldn’t run into any problems installing eAccelerator. Wow, what a difference! Since the install, the server has been running very well and I think everyone should notice the improvements this time around. The VPS contains a variety of Wordpress, Drupal, and SMF sites…and they all are performing well. If I have a need in the future I’ll bring back the Zend Optimizer since eAccelerator is suppose to be compatible with Zend Optimizer.
Why are we seeing eAccelerator perform so much better than the Zend Optimizer? As the product’s name says, Zend Optimizer is an optimizer for your Web Server.? The eAccelerator package on the other hand is not only an optimizer, but also an accelerator, encoder, and caches the dynamic content (like the pages you see here at this site). So we’re not only seeing the CPU work less because of the code being optimized, but we are also seeing less hits to the database on the server because of the caching. In essence, the server is providing pages faster to our readers but having to work less in providing those pages.
Documentation and support for eAccelerator is rather weak, so I can see why those needing more dependable support may want to purchase the Zend products.? However, so far for this little ‘ol VPS from Dakota Hosting is keeping us happy. If we run into problems with eAccelerator or the VPS I’ll let everyone know. Otherwise, this is the last computer geek article for awhile and we return to normal programming. It’s been awhile since we’ve seen a book review or product recommendation for the family…one of the original purposes of this site.

3 comments so far
eAccellerator does a few things:
Primarily it is an opcode cache. PHP converts the PHP Code to opcodes for every single request. An opcode cache keeps that work around, instead of redoing it all the time. That is where the balance of its speed comes from. Zend optimizer does not provide an opcode cache.
Both eAccellerator and Zend Optimizer perform opcode optimization. Thats taking the opcodes generated and reorganizing them to be faster. Unfortunately, this takes time to do and if you don’t have an opcode cache, it can actually take more time to optimize the opcodes than to run them. Thus, in many cases, Zend Optimizer by itself is slower than straight PHP.
Zend Optimizer and eAccellerator can both load encrypted or DRM enabled PHP code. However, eAccellerator’s format is not nearly as widely used as Zend’s and the formats are not interchangeable. Personally, I turn this feature off when I compile eA. I understand its not up to date anyway. When a PHP program requires Zend Optimizer, its because it uses that encryption/DRM format.
eAccellerator also offers a shared memory cache which can be used to cache a bunch of stuff, including content. However, my understanding is that this can only be used if the program is specifically written to use that cache. I don’t think that there is any content caching that eAccelerator offers by default.
Jeff, thanks for the comments and explanation on my site to how eOptimizer and eAccelerator work! I visited your site and will have to remember it for future reference. By the way, congratulations on your magazine article in php|architect!
Hosting Vps…
Thanks for short yet informative article. It covers most of things I wanted to know on this topic…
Line and paragraph breaks automatic, e-mail address never displayed, approval may be required for first time posters, HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>