Eaccelerator, suEXEC, Zend and white screens of death and faulty crons

Tagged:  •    •  

This was a bit of a tough one...it had to do with the installation of eaccelerator (EA) 9.51 with the Zend optimisation engine. The install went well, but things started going awry after a few days. Apache was crashing. We were getting segmentation faults and Drupal 4.7 installs were producing the dreaded white screen of death.

Here's the error with EA 0.9.5 installed as a Zend extension....

[Thu Jun 7 12:03:07 2007] [notice] child pid 28650 exit signal Segmentation fault (11)
[Thu Jun 7 12:16:15 2007] [notice] caught SIGTERM, shutting down
[Thu Jun 7 12:18:22 2007] [notice] Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.7a PHP/4.4.4 mod_perl/1.29 FrontPage/5.0.2.2510 configured -- resuming normal operations
[Thu Jun 7 12:18:22 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Jun 7 12:18:22 2007] [notice] Accept mutex: sysvsem (Default: sysvsem)

I found out that EA v0.95 did not play well with the Zend engine. Upgraded to EA v0.9.5.1 and just the suEXEC error showed up. Google revealed several reports of suEXEC conflicting with EA and Zend together.

Commented out the Zend extension settings from php.ini

;zend_extension="/usr/local/lib/php/extensions/eaccelerator.so"

and set it as a php extensions

;extension="/usr/local/lib/php/extensions/eaccelerator.so"

This worked. Drupal was flying. Both 4.7x and 5.1 installs. Alas, the fun did not stop there. Crons stopped working! We rely heavily on crons to reguarly index search and publish content on schedule as well as automate newsletter sendouts for clients...among other things. After staying up until 3 in the morning for well over 2 weeks, I decided that it might be beneficial (in the long run) to figure out a better solution! However I must admit the time between 3am and 6am is really special. All the minds are resting and there is certain profound quality to the stillness at that time...

So what's the solution?

Well EA 9.5.1 is installed as a ZEND extension, but with the ZEND optimiser commented out. Another quirk I discovered on several forum posts, was that the settings for EA and ZEND should be pasted above the

;Windows Extensions

Here's my current setting...

zend_extension="/usr/local/lib/php/extensions/eaccelerator.so"
eaccelerator.shm_size="20"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="0"
eaccelerator.compress_level="9"

[Zend]
;zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.2.8
;zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.2.8
;zend_optimizer.version=3.2.8
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

Notice that the ZEND optimizer is commented out. You will also notice that EA compression is switched off, after I read several posts from what appears to be knowledgable gentlemen about how it made their lives better. Well I'm happy to say that cron is running perfectly and the sites are flying at optimal speeds on both our VPS accounts.

Many thanks to EA and their development team.

Here are some useful links...

http://eaccelerator.net/browser/eaccelerator/trunk/README
http://eaccelerator.net/wiki
http://www.webhostingtalk.com/showthread.php?t=464876&page=2
http://www.mojahmedia.net/drupal-cron-run-failed-c... - Stuck Drupal Cron