Gelonida N
March 15, 2012 06:22AM
On 03/15/2012 09:39 AM, Piotr Karbowski wrote:
> On 03/15/2012 04:30 AM, justin wrote:

>>
>> Does nginx have any plugins to emulate this behavior? I.E. sort of
>> hooks? All I would need is a hook from nginx when a site is idle for X
>> number of second/minutes. For this first hook, we could write a simple
>> bash script which kills that PHP-FPM worker. Then another hook, when a
>> request comes in on a given site. Again, another bash script which first
>> checks if the PHP-FPM worker is up, if not, holds the requests, starts
>> the worker, and then forwards the request.
>>
>> I was thinking at first, I can use node.js and write a middleware proxy
>> that sits between nginx and the PHP-FPM workers, but then quickly
>> realized the node.js app would have to speak cgi, and I didn't want to
>> have to deal with that rubbish. :)
>
> php-fpm support 'ondemand' governor so it will spawn processes as-needed
> and kill them after specified period if not needed (keeping zero workers
> for pool). This is what you are looking for.

I'd be interested, whether there is something generic nginx specific,
which would allow to start / stop any fast-cgi / uwsgi service.

I think it could be rather intersting for a lot of rarely used services
where a startup penalty is not important.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Dynamically Start/Stop FastCGI PHP Processes

Anonymous User March 14, 2012 11:30PM

Re: Dynamically Start/Stop FastCGI PHP Processes

Edho Arief March 14, 2012 11:40PM

Re: Dynamically Start/Stop FastCGI PHP Processes

Anonymous User March 14, 2012 11:53PM

Re: Dynamically Start/Stop FastCGI PHP Processes

Edho Arief March 14, 2012 11:56PM

Re: Dynamically Start/Stop FastCGI PHP Processes

Anonymous User March 15, 2012 12:38AM

Re: Dynamically Start/Stop FastCGI PHP Processes

Piotr Karbowski March 15, 2012 04:42AM

Re: Dynamically Start/Stop FastCGI PHP Processes

Gelonida N March 15, 2012 06:22AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 247
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready