I'm attempting to run PHP as an Apache2 module using the worker MPM. I 
understand this is not recommended but because of the nature of the application 
and traffic on the servers, prefork and CGI have not preformed well for me.

I'm running this in production right now and most of the site is running very 
smoothly with the exception of functions such as file_exists.

An strace makes it clear why. For every file, it does a loop like this

lstat("/root", {st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0
lstat("/root/images-medium", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
lstat("/root/images-medium/harbor-view-blues-ryan-merrill.jpg", 
{st_mode=S_IFREG|0644, st_size=0, ...}) = 0
access("/root/images-medium/harbor-view-blues-ryan-merrill.jpg", F_OK) = 0

This output is from a test VM I created to duplicate the issue in a sandbox. I 
created a tiny test script that reads a list of files and does a file_exists on 
each.

Subsequent runs of this script does not get any faster. It never caches the 
results.

If I remove enable-maintainer-zts from configure, it does not do this. It runs 
much more efficiently but of course does not work with Apache's worker MPM any 
longer.

I've tried going back to prefork but the server's load spikes well over 200 in 
seconds and crashes. I've narrowed it down to pages using imagick but nothing I 
do seems to work. Things work OK when I browse the site but going live or 
hitting it with ab or siege will take down the box.

FastCGI has given me even worse performance.

The best performance I get is from the worker MPM and mod_php.

I am running PHP 5.2.17 on CentOS 5.6 64bit.

I tested with 5.3.6 and it actually works even with enable-maintainer-zts but 
it breaks the current code base. I'm going to push on dev to get our code 
updated to work with 5.3.x but I was hoping there was a quick fix somewhere.

Regards,

Seth





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to