Forum

PHP 'low' requests / sec

Martijn
6 February 2014, 11:27
I've compiled Hiawatha from the ports on FreeBSD 10.

Everything is up and running. PHP FPM is also running.
The same server now has Apache 2.4 with event mpm on it. When I request a simple php script with echo 'Hello World!' via ab -c10 -n100 -i http://..... the results is on average about 600 req/sec.
Running the same echo on Hiawatha gives me 90 req/sec.
When I compile Nginx and run the php script I get even more than 600 req/sec.

I have no idea why Hiawatha with php fpm on FreeBSD has such a 'low' result.

To double check I've compiled Hiawatha on Debian (other VPS) with php fpm and that gives me about the same result as Nginx.

For testing I've modified a couple of paramaters:
ConnectionsTotal = 500
ConnectionsPerIP = 50000
FastCGIserver {
FastCGIid = PHP5
ConnectTo = 127.0.0.1:9000
Extension = php
}
Hostname = 127.0.0.1
WebsiteRoot = /usr/local/www/hiawatha
StartFile = index.html
AccessLogfile = /var/log/hiawatha/access.log
ErrorLogfile = /var/log/hiawatha/error.log
#ErrorHandler = 404:/error.cgi

UseFastCGI = PHP5

Al the Ban options are disabled.

Hiawatha version: 9.3.1
Operating System: FreeBSD 10
Hugo Leisink
6 February 2014, 13:12
What are the results when you run ab with the '-k' (keep-alive) flag?
Martijn
6 February 2014, 13:51
Almost no difference.
Martijn
6 February 2014, 13:52
Could it be the about polling?

Can hiawatha use kqueue?
Martijn
6 February 2014, 13:59
Fetching a small css does about 2000 req/sec.

So it has to do with the fastcgi part.
Martijn
6 February 2014, 14:07
When I set php fpm to a socket and modify the Hiawatha conf.

I get 1400 req/sec on the php file.

But the strange thing is. Nginx and Apache are set to use 127.0.0.1 so also not on a socket. And those do get high req/sec on 127.0.0.1.
This topic has been closed.