Thanks for the answer.
I run the FastCGi with:
source!1!env!PHP_FCGI_CHILDREN = 8
source!1!env!PHP_FCGI_MAX_REQUESTS = 5000
And the server itself:
server!fdlimit = 65535
server!iocache = 0
server!keepalive = 1
server!keepalive_max_requests = 2000
server!poll_method = epoll
Trying to solve this issue, I limited the threads that Cherokee uses. By default Cherokee calculates the number of threads (I don’t know the exact
number), but if I set the number of threads to 2 when there are 250 simultaneous clients the performance is around 3000 requests per second.
If I run TOP in Linux, I see that when running 100 simultaneous clients, Cherokee gets less than 100% of the CPU load and some php-cgi processes
are created (and of course consuming resources). Gets a performance around 5000 requests per second.
But if running more than 100 simultaneous clients, Cherokee gets 200% CPU load and php-cgi does not appear in the same frequency in TOP. Performance
decreases to less than 100 requests per second.
When limiting the number of threads to 2, the performance when running less than 100 simultaneous clients decreases a little bit, less than 5000
requests per second.
But when pushing 200 simultaneous clients, performance is around 3000-3500 requests per second. If I run TOP in Linux, I see the same behavior
than in the first part of the scenario 1. Cherokee consuming between 100% and 120% of CPU and php-cgi processes being created.
Maybe it is as simple as limiting the number of threads, in order to get fewer resources.
De: Alvaro Lopez Ortega [mailto:alvaro <at> octality.com]
Enviado el: jueves, 05 de mayo de 2011 10:06
Para: ALBERT HIDALGO BAREA
CC: cherokee <at> lists.octality.com
Asunto: Re: [Cherokee] Cherokee PHP FastCGI isue
On Thu, May 5, 2011 at 9:16 AM, ALBERT HIDALGO BAREA <abarea <at> tid.es> wrote:
From 1 to 100 simultaneous clients I get a performance around 5000 requests per second, with a Hello World PHP file.
But when increasing from 150 up to 1000 simultaneous clients, performance goes down to 100 requests per second.
My system is a Dual core machine, with Red Hat Enterprise Linux 5.5.
There is something to configure in order to avoid this issue? Maybe I have to limit the number of threads which Cherokee can handle.
There are two things to take into account here:
First, the number of child processes of php-cgi (or php-fpm). Odds are the bottleneck is not in Cherokee, actually. When php does not have worker processes to handle the requests things do get very slow.
Check your kernel limits. It's very usual to reach them when performing benchmarks. If the allocated resources of the kernel are exhausted (ports, file descriptors, etc) the results of the benchmark will not represent the real performance of the server in a
tuned system. This
document may come useful; check it out.