Welcome! Log In Create A New Profile

Advanced

Re: nginx and php (fast-cgi) hangs the connection

Reinis Rozitis
October 15, 2009 03:22PM
In my past experience usually its just because all the spawned php processes
are doing something (or are just some hanged state (you could use 'strace'
to see what the php childs are doing at the moment nginx stops to deliver
the php content)) and there is no free child to assign the incoming dynamic
request from nginx.

And while you may think that from php side the ini setting
'max_execution_time' would help it is not always the case (especially if you
are dealign with sockets or other (tcp) connections within the php code) -
sooner or later all the childs are being used and no new spawned.


The thing to do would be instead of spawn-cgi use php-fpm http://php-fpm.org

While it involves patching php (then again it is planned to implement as
core in future php releases (there is even a seperate branch in php.net
svn)) it gives you the possibility http://php-fpm.org/Configuration_File to
monitor ( request_slowlog_timeout ) and kill ( request_terminate_timeout )
the php processes which take too long to finish.

Has helped me a lot to find site bottlenecks and point those out to
development team.

rr



----- Original Message -----
From: "yacenty" <nginx-forum@nginx.us>
To: <nginx@sysoev.ru>
Sent: Thursday, October 15, 2009 8:45 PM
Subject: nginx and php (fast-cgi) hangs the connection


> Hello
> from about month (moving to the nginx 7.61) I had a very big problem.
> My server suddenly stops to serving dynamic content.
> Static files are handled in regullar way but asking for php files gives
> nothing in the web browser, and sometimes in the benchmarking site in ab
> we receive broken sockets.
> Some days ago I had moved to 7.62 and spawn-cgi 1.6.3 - then I thought
> everything is solved, but I realized that site hangs in the peak of the
> site.
> There is nothing in the nginx logs, nothing in php logs.
> What could I do?
> What could be wrong?
> Could You help me somehow?
>
> Best regards
> YacentY
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,14052,14052#msg-14052
>
>
>
>
Subject Author Posted

nginx and php (fast-cgi) hangs the connection

yacenty October 15, 2009 01:45PM

Re: nginx and php (fast-cgi) hangs the connection

Reinis Rozitis October 15, 2009 03:22PM

Re: nginx and php (fast-cgi) hangs the connection

yacenty October 15, 2009 05:57PM

Re: nginx and php (fast-cgi) hangs the connection

Reinis Rozitis October 15, 2009 11:40PM

Re: nginx and php (fast-cgi) hangs the connection

yacenty October 19, 2009 12:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 312
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