Web Hosting Talk







View Full Version : Zend Optimizer vs eAccelerator


That Guy
04-02-2007, 03:24 AM
I can't decide which optimizer to use...which is better in your opinion? When I do php -v, it says PHP 5.2.1 (cli) and eAccelerator's website says it doesn't work with cli. I'm not sure why it installed PHP as cli, but I used Apache update.

eddy2099
04-02-2007, 04:09 AM
Well, why not install both Zend and eAccelerator ? Depending on the script and let the script decide what to use.

http://www.datastronghold.com/security-articles/web-hosting-articles/installing-eaccelerator-for-php.html

eAccelerator is compatible with Zend Optimizer's loader. Zend Optimizer must be installed after eAccelerator in php.ini. If you don't use scripts encoded with Zend Encoder then we do not recommend you install Zend Optimizer with eAccelerator.

That Guy
04-02-2007, 04:30 AM
Hm, interesting. On a side note, I just found an article that said eAccelerator is faster than eAccelerator + Zend Optimizer. I'm not sure how accurate it is, but they showed a few tests they did.

eddy2099
04-02-2007, 04:42 AM
In my case, eAccelerator was disabled as it did not work in my SuExec and PHPSuExec environment. I did not do any benchmarking, for me as long as it works, it is okay.

That Guy
04-02-2007, 04:43 AM
Hm....I have SuExec and PHPSuExec enabled...does this mean I have no choice but to go with Zend Optimizer?

eddy2099
04-02-2007, 05:14 AM
Well, mine seems to auto disable eAccelerator.

Apoc
04-02-2007, 07:03 AM
Hm....I have SuExec and PHPSuExec enabled...does this mean I have no choice but to go with Zend Optimizer?

Just get yourself a test environment and try all the options - if you're running a production environment you will certainly not want to just try things randomly.

In my opinion eAccelerator is by far the best PHP acceleration tool available today. Not only does it speed up PHP scripts a lot, but it can also reduce your server load a lot.

sspt
04-02-2007, 10:16 AM
You must take a look at xcache too
http://trac.lighttpd.net/xcache/

I'm currently using it with very good results :)

layer0
04-02-2007, 10:20 AM
Zend Optimizer, despite it's name as well as common misconception, does not do the same thing as eAccelerator.

Zend Optimizer does not maintain a cache of PHP scripts, whereas eAccelerator does.

Zend Optimizer does not do much if anything to "optimize" scripts, whereas eAccelerator does.

It is smart to run them both at the same time. In addition, if eAccelerator is loaded as a PHP exntension (and not zend_extension), it's possible to run Zend Optimizer, Ioncube, and eAccelerator all at once.

eddy2099
04-02-2007, 10:51 AM
I tried Xcache will a bad result. Yes, there is caching but it was using my harddisk space like a hungry buffalo. It used up some 16gb in a 24 hours time frame. Maybe my settings was wrong.

How do you run eAccelerator as a PHP Extension ? My issue seems to be that I have both PHPSuExec and SuExec which I need and that seems to stop eAccelerator from being active.

That Guy
04-02-2007, 02:18 PM
How can you tell if eAccelerator is disabled?

brashquido
04-02-2007, 02:26 PM
Use the phpinfo function to see you php environment details, including eaccelerator. Create a new file with a .php extension (phpinfo.php for instance) in your web root and place this code in it;

<?php
phpinfo();
?>


Goto yoursite.com/phpinfo.php and you'll get all the details on your php environment.

layer0
04-02-2007, 02:32 PM
I tried Xcache will a bad result. Yes, there is caching but it was using my harddisk space like a hungry buffalo. It used up some 16gb in a 24 hours time frame. Maybe my settings was wrong.

How do you run eAccelerator as a PHP Extension ? My issue seems to be that I have both PHPSuExec and SuExec which I need and that seems to stop eAccelerator from being active.

Yes, unfortunately, you really cannot run the 'default' eAccelerator with phpsuexec.

That Guy
04-02-2007, 02:35 PM
Would you disable PHPSuExec to run eAccelerator? Also, can you have SuExec enabled and PHPSuExec disabled and run it?

layer0
04-02-2007, 02:51 PM
Would you disable PHPSuExec to run eAccelerator? Also, can you have SuExec enabled and PHPSuExec disabled and run it?

By SuExec I assume you mean for CGI. That won't affect eAccelerator.

PHPSuExec must be disabled to run eAccelerator [unless you seriously hack the source code and figure out a way....]

Apoc
04-02-2007, 04:17 PM
Would you disable PHPSuExec to run eAccelerator? Also, can you have SuExec enabled and PHPSuExec disabled and run it?

The question is: do you really need PHPSuExec? If not, you may as well turn it off.

That Guy
04-02-2007, 05:03 PM
I think I may end up doing that. If I do that though, how can I turn eAccelerator back on? Would I have to recompile it?

layer0
04-02-2007, 05:11 PM
I think I may end up doing that. If I do that though, how can I turn eAccelerator back on? Would I have to recompile it?
You shouldn't have to recompile it, it should automatically go back on, as that is how you have it configured. The reason it is off right now, is because suexec is forcing it to be.

vinsar
04-02-2007, 05:27 PM
Zend Optimizer, despite it's name as well as common misconception, does not do the same thing as eAccelerator.

Zend Optimizer does not maintain a cache of PHP scripts, whereas eAccelerator does.

Zend Optimizer does not do much if anything to "optimize" scripts, whereas eAccelerator does.

It is smart to run them both at the same time. In addition, if eAccelerator is loaded as a PHP exntension (and not zend_extension), it's possible to run Zend Optimizer, Ioncube, and eAccelerator all at once.

Sorry if I am intruding into the original posters post, but still, is there a proper guide that shows step by step instructions to run lates Zend Optimizer, Ioncube, and eAccelerator all at once with PHP 5.x.x on a standard cPanel server successfully.

That Guy
04-03-2007, 12:07 AM
Thanks. Once I disabled PHPSuExec in cPanel by rebuilding Apache, I had to install eAccelerator again...or at least reconfig the php.ini.

adrianus
04-03-2007, 12:41 AM
There is a comparison here (http://itst.net/654-php-on-fire-three-opcode-caches-compared) between Zend, APC, eAccelerator, and XCache. I am using eaccelerator on one VPS, and just install xcache on another. So far I have no problem with xcache and quite satisfied with it.

That Guy
04-03-2007, 12:44 AM
Thanks for the article! :)

phpa
04-06-2007, 06:05 PM
Zend Optimizer does not do much if anything to "optimize" scripts

That's not entirely accurate. Although it could do more, ZO does some reasonable optimisations and will generally speed up execution. However, and here's the rub, when you add in the time taken to optimise code, whether there is an overall net gain in performance is far from certain, and it's not uncommon to get a slow down when ZO is installed. Last time we looked, this wasn't helped from time being spent optimising code that might not even be executed because ZO didn't perform lazy optimisation.

As pointed out though, ZO is an optimiser whereas EA and others are caches that may or may not also optimise. When EA and ZO are installed, EA knocks out ZO so that code is not optimised by ZO, but will be by EA's own optimiser.

layer0
04-06-2007, 07:13 PM
That's not entirely accurate. Although it could do more, ZO does some reasonable optimisations and will generally speed up execution. However, and here's the rub, when you add in the time taken to optimise code, whether there is an overall net gain in performance is far from certain, and it's not uncommon to get a slow down when ZO is installed. Last time we looked, this wasn't helped from time being spent optimising code that might not even be executed because ZO didn't perform lazy optimisation.

As pointed out though, ZO is an optimiser whereas EA and others are caches that may or may not also optimise. When EA and ZO are installed, EA knocks out ZO so that code is not optimised by ZO, but will be by EA's own optimiser.

Yes, I should have worded that better.

I've actually done the benchmarks myself and the results were the same as yours. There was very little difference for most applications. Probably should have just said "Zend Optimizer doesn't do much if anything to speed up scripts". My bad ;)

layer0
04-06-2007, 07:15 PM
Sorry if I am intruding into the original posters post, but still, is there a proper guide that shows step by step instructions to run lates Zend Optimizer, Ioncube, and eAccelerator all at once with PHP 5.x.x on a standard cPanel server successfully.

I'll post the guide pretty soon at my leisure. It is not very complicated.

vinsar
04-08-2007, 10:08 AM
Thanks layer0