|
- Readme First! - Read and follow the rules, otherwise your posts will be closed |
|
|
|
|
|
There are currently, 371 guest(s) and 0 member(s) that are online.
You are Anonymous user. You can register for free by clicking here |
|
|
|
|
|
Boost your PHP Page Generation Times with Zend |
|
A friend of mine recently installed Zend Optimizer 2.1.0 as we have here at Nuke Cops. Both sites are high traffic (50,000+ page hits daily) and pound the web server. Zend Optimizer 2.1.0 increases page generation times at least 50%. To provide a baseline example, lets set the base at 250 pages viewed at any given past 5 minutes. [This is from a Nuke Cops perspective, mind you, Computer Cops was also seeing roughly the same during test times since both share the same server.]
Prior to having ZO installed our PHP generation times were anywhere from 2 to 4 seconds consistent. Once ZO was installed and set to default configuration out of the box, generation times dropped down to roughly 1.1 seconds. Default config had an optimization configuration set to "15". Server load times actually decreased as well from a 1.x-2.x down to a 0.5-1.x.
Do you support Zend Optimizer on your server? Run a phpinfo(); script and look for the "Zend Optimizer" block. There are five optimization passes, and a loader. By default the first three are enabled, as the next two are disabled, and finally the loader is enabled:
Optimization Pass 1 enabled
Optimization Pass 2 enabled
Optimization Pass 3 enabled
Optimization Pass 9 disabled
Optimization Pass 10 disabled
Zend Loader enabled
The loader is only used for encoded PHP files. If you do not use encoded files, disabling this one will boost performance slightly.
So how to increase it even more? Enable optimization passes 9 and 10. Its not very well documented, however change the setting in your php.ini from "15" to "1023" for optimization passes. With this new setting, Nuke Cops noticed an increased page generation time at 0.5-0.7 seconds on average. Another boost in performance. However doing this increases serverload on average from 3.x-5.x. This is not always consistent, but be aware.
ZO is a free application from http://www.zend.com. Ensure you already have the base Zend Engine installed:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.2.0, Copyright (c) 1998-2002 Zend Technologies
The installation documentation points this out.
Admin Note: Mileage does vary, but over the long haul, its a positive increase.
|
|
Posted on Sunday, September 14 @ 21:50:35 CEST by Zhen-Xjell |
|
|
|
|
| |
|
Average Score: 4 Votes: 5

|
|
|
|
|
|
|
| | The comments are owned by the poster. We aren't responsible for their content. |
| | | | |
| No Comments Allowed for Anonymous, please register | | | | |
Re: Boost your PHP Page Generation Times with Zend (Score: 1) by Peejay on Sunday, September 14 @ 22:03:23 CEST (User Info | Send a Message) http://www.peejay.info | I used to use that program but found that it just was not working well enough. There is a much better, although more difficult to install program called Turck MMCache. The link for it is:
http://www.turcksoft.com/en/e_mmc.htm |
Re: Boost your PHP Page Generation Times with Zend (Score: 1) by Zhen-Xjell on Sunday, September 14 @ 22:08:53 CEST (User Info | Send a Message) http://castlecops.com | Hi I checked the stats at the link you gave, and it doesn't seem to be much of a difference between MMCache and the Zend Suite. Please note, that this isn't the Zend Suite that is installed, its just the Engine and Optimizer. The Suite is another ballgame. Also, did you have the default ZO settings like the "15" and loader enabled? Changing as per the article increased it significantly.
I agree however, that with the default settings, ZO doesn't appear to make much of an increase from where I sat. But the changes per my recommendation certainly saw a significant increase.
Are there figures based on ZO and MMCache? I'll do a search & thanks for the FYI alternative.
Clearly one won't work for everyone. |
]
Re: Boost your PHP Page Generation Times with Zend (Score: 1) by Zhen-Xjell on Sunday, September 14 @ 22:14:23 CEST (User Info | Send a Message) http://castlecops.com | I have noticed that Zend and MMCache can be installed together:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies with Turck MMCache v2.3.20, Copyright (c) 2002-2003 TurckSoft, St. Petersburg, by Dmitry Stogov with Zend Extension Manager v1.0.0, Copyright (c) 2003, by Zend Technologies with Zend Optimizer v2.1.0, Copyright (c) 1998-2003, by Zend Technologies
There also appears to be a third solution:
http://meta.wikipedia.org/wiki/PHP_caching_and_optimization [meta.wikipedia.org]
APC [apc.communityconnect.com]
Zend [www.zend.com]
PHPA [www.php-accelerator.co.uk]
MMCache [www.turcksoft.com]
"Claims to be a bit faster than PHPA, a bit slower than Zend Accelerator, and is GPL."
|
]
Re: Boost your PHP Page Generation Times with Zend (Score: 1) by Peejay on Monday, September 15 @ 00:36:29 CEST (User Info | Send a Message) http://www.peejay.info | | One thing that I do like about MMcache as well is that it provides you with a lot more configuration options than you can find with Zend Optimizer. It also gives you the ability to have a password protected screen which shows you which pages are cached, how long they have been, etc. |
]
Re: Boost your PHP Page Generation Times with Zend (Score: 1) by Zhen-Xjell on Monday, September 15 @ 09:47:30 CEST (User Info | Send a Message) http://castlecops.com | | So what are your settings for MMcache? How long do you keep pages cached? My concern is how well the cache will fair if content changes all the time. |
]
Re: Boost your PHP Page Generation Times with Zend (Score: 1) by Peejay on Monday, September 15 @ 11:07:34 CEST (User Info | Send a Message) http://www.peejay.info | Well, my settings are pretty simple really as my site does not get a lot of traffic or change that often. You can set pages to be cached as often as you like, and even exclude certain files or directories. My settings for it (held in php.ini), simple ones are:
zend_extension="/usr/lib/php4/mmcache.so"
mmcache.shm_size="23"
mmcache.cache_dir="/tmp/mmcache"
mmcache.enable="1"
mmcache.optimizer="1"
mmcache.check_mtime="1"
mmcache.debug="0"
mmcache.filter=""
mmcache.shm_max="0"
mmcache.shm_ttl="0"
mmcache.shm_prune_period="0"
mmcache.compress="1"
I imagine these are the 2 options that would need to be tweaked:
mmcache.shm_ttl
When MMCache fails to get shared memory for new script it removes all scripts which were not accessed at last "shm_ttl" seconds from shared memory. Default value is "0" that means - don't remove any files from shared memory.
mmcache.shm_prune_period
When MMCache fails to get shared memory for new script it tryes to remove old script if the previous try was made more
then "shm_prune_period" seconds ago. Default value is "0" that means - don't try to remove any files from shared memory. |
]
Re: Boost your PHP Page Generation Times with Zend (Score: 1) by Zhen-Xjell on Monday, September 15 @ 11:20:17 CEST (User Info | Send a Message) http://castlecops.com | | Obviously if you ran into any serious issues using this caching you wouldn't be running it, but are there any issues you experienced along the way? |
]
Re: Boost your PHP Page Generation Times with Zend (Score: 1) by Peejay on Monday, September 15 @ 15:41:56 CEST (User Info | Send a Message) http://www.peejay.info | The only issue that I had was with phpmyadmin, but that has only been twice so far. In that case I had to restart httpd and things came back. What I am going to just do to avoid the issue is to exclude my phpmyadmin dir from caching.
Also I find that MMcache has rapid development, they are constnatly making it better. |
]
| | | | |
Software dependencies for TurckMM Cache (Score: 1) by Peejay on Monday, September 15 @ 21:47:00 CEST (User Info | Send a Message) http://www.peejay.info | There are a number of bit of software that you need to have installed in order to get TurckMM cache to work, the main one being this software here:
http://www.ossp.org/pkg/lib/mm/ |
Re: Software dependencies for TurckMM Cache (Score: 1) by Zhen-Xjell on Monday, September 15 @ 22:27:58 CEST (User Info | Send a Message) http://castlecops.com | | As an aside the staff at my hosting company has a consensus: Zend Optimizer. |
]
| | | | |
Optimizers alone are a bad idea (Score: 1) by mlemos on Tuesday, June 21 @ 21:05:26 CEST (User Info | Send a Message) | If you just use an optimizer extension that is a very bad idea because it makes every PHP script take longer to compile.
It gets worse when you use more optimization passes because these make compilation stage take even more time and much more memory. Using just the optimizer is pure poison to your servers.
You need to use also a cache extension to make PHP reuse a previously compiled script stored in the shared memory.
The only cache extensions that reuse PHP compiled scripts optimized with Zend optimizer are the Zend cache extensions that are not free. So, it is not hard to understand why Zend gives the optimizer for free.
There is also the problem that some optimizers still have bugs that make your scripts run erroneously due to wrong assumptions in the optimization phase.
Personally I do not use any optimizer because they are not worth the headaches that they introduce, often for a doubtful benefit.
However, I strongly encourage you to use a cache extension. I use Turck MMCache [turck-mmcache.sourceforge.net] despite the original developer is working now for Zend and is not doing any work in MMCache.
MMCache development seems to be continued by the eAccelerator [eaccelerator.net] team.
I suppose other caching extensions maybe ok, although I have not tried them. |
| | | | | |