Chain of thoughts (to be continued....):
First I would test if the problem is triggered by or significantly worsened by concurrency. With your -n 1000 -c 100
test you had a ratio of 22/4500. What about -n 1000 -c 10
or -n 1000 -c 1
?
Then I would try the same again + keeping track of memory consumption, disc i/o and cpu usage. Is any of this clearly the limiting factor?
Then I'd test simple php scripts:
- an empty script
- <?php echo 'x';
- no script at all, but the contents of test.html copied over to test.php
- only serving a small memcached item. As simple a script as possible, construct the memchached object and get an item, no test, no expiration, no add, only
echo $mc->get(string $key)
How do those compare to test.html?
edit:
Let's take Web Server Performance Comparison: LiteSpeed 2.0 VS as a comparison point. The benchmark was performed "for" another "rivaling" webserver product but for the moment let's assume they weren't (too) biased ;-)
They had a
- CPU: Single Intel Xeon 2.4GHz/533FSB/512KB L2 Cache
- memory: 256MB ECC PC2700
- Hard Drive: 36GB 10K RPM SCSI drive Seagate ST336607LW
- NIC: on board Intel PRO/1000 Gigabit Adapter
The lighthttpd served 15475/s files of 100 bytes, 1593/s helloworld.php and 399/s phpinfo.php scripts (both fastcgi). That's a ration of ~ 1:10 (hello world) or 1:40 (phpinfo). "Your" ratio is 22:4500 ~ 1:200. And even stranger it doesn't change when the script changes. Your "real" script or an empty php script, no matter always 1:22. That raises the "strangeness factor" quite a bit (even though the tests are not identical).
First of all I would double-check if php was compiled with fastcgi-support, see http://www.fastcgi.com/docs/faq.html#PHP.
Then I'd test "my" lighthttpd with a simple c/c++ fastcgi program as mentioned in the test, a real simple "hello world". There's an example at http://www.fastcgi.com/devkit/doc/fastcgi-prog-guide/ch2c.htm#4263. If this scales "well", i.e. significantly better than your php-fastcgi, I'd try it with a "barely running" php version, i.e. compiled with --disable-all
and only those modules (re)actived and built-in that are necessary to start php and let it print "hello world". Also use the default php.ini. Does this change anything?