Hello Albert,

I do not think the thread number has much to do to that performance decrease
you described, actually. Instead, I believe it's more likely related to the
number to PHP child processes and/or system resources exhaustion.

I'd personally increase the PHP_FCGI_CHILDREN as a first step (do not
hesitate to set a much higher number). Then, I'd focus on being sure that
neither your system's ephemeral ports poll nor your file descriptor poll
is exhausted during the benchmark, etc. That's a very usual problem that
causes the sort of issue you described.

Cheers!


On Thu, May 5, 2011 at 11:07 AM, ALBERT HIDALGO BAREA <[email protected]> wrote:

>  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.
>
>
>
> Scenario 1:
>
> 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.
>
>
>
> Scenario 2:
>
> 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.
>
>
>
> Regards,
>
>
>
> *De:* Alvaro Lopez Ortega [mailto:[email protected]]
> *Enviado el:* jueves, 05 de mayo de 2011 10:06
> *Para:* ALBERT HIDALGO BAREA
> *CC:* [email protected]
> *Asunto:* Re: [Cherokee] Cherokee PHP FastCGI isue
>
>
>
> Hello Albert,
>
> On Thu, May 5, 2011 at 9:16 AM, ALBERT HIDALGO BAREA <[email protected]>
> 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<http://www.cherokee-project.com/doc/other_os_tuning.html>may 
> come useful; check it out.
>
>
> --
> Greetings, alo
> http://www.octality.com/
>
> ------------------------------
> Este mensaje se dirige exclusivamente a su destinatario. Puede consultar
> nuestra política de envío y recepción de correo electrónico en el enlace
> situado más abajo.
> This message is intended exclusively for its addressee. We only send and
> receive email on the basis of the terms set out at.
> http://www.tid.es/ES/PAGINAS/disclaimer.aspx
>



-- 
Greetings, alo
http://www.octality.com/
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to