Re: PHP-FPM documentation

117 views
Skip to first unread message

Renzo Racioppi

unread,
May 14, 2013, 5:57:38 AM5/14/13
to highloa...@googlegroups.com
In particular, I noticed that all process of certain pool write at their FD 3 when a request for that pool comes. ltrace clearly shows that only one process writes an HTML page, but strace instead shows a really confused output. I have also noticed that also PHP-FPM master process listens to the same port of the pool, I think it does this, on order to know when spawn dynamic process. 

What I have found about PHP-FPM process interaction on the web, presents a too high-level description, mostly oriented to web developers. FPM official page describes only module directives. I would like instead to know how things are really working. 

Regards.

Jérôme Loyet

unread,
May 14, 2013, 6:02:39 AM5/14/13
to highloa...@googlegroups.com
Hi,

master process listens to the same port as the pool because of the spawn dynamic process, you are right. Using epoll, it can know when a new connexion arrives and then decides wether or not to fork a new process.

Each pool process uses several FD. Once for communicating both way with the master process, once for logging (if I remember correctly), one for the socket on the server side and one for the socket for the client. The number attributated to FD is not supposed to be consistent and can vary as it's allocated by kernel.

++ Jerome


2013/5/14 Renzo Racioppi <hellf...@gmail.com>
In particular, I noticed that all process of certain pool write at their FD 3 when a request for that pool comes. ltrace clearly shows that only one process writes an HTML page, but strace instead shows a really confused output. I have also noticed that also PHP-FPM master process listens to the same port of the pool, I think it does this, on order to know when spawn dynamic process. 

What I have found about PHP-FPM process interaction on the web, presents a too high-level description, mostly oriented to web developers. FPM official page describes only module directives. I would like instead to know how things are really working. 

Regards.

--
 
---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Antony Dovgal

unread,
May 14, 2013, 6:06:39 AM5/14/13
to highloa...@googlegroups.com
On 2013-05-14 13:57, Renzo Racioppi wrote:
> In particular, I noticed that all process of certain pool write at their FD 3 when a request for that pool comes. ltrace clearly shows that only one process writes an HTML page, but strace instead shows a really confused output. I have also noticed that also PHP-FPM master process listens to the same port of the pool, I think it does this, on order to know when spawn dynamic process.
>
> What I have found about PHP-FPM process interaction on the web, presents a too high-level description, mostly oriented to web developers. FPM official page describes only module directives. I would like instead to know how things are really working.

I guess your only option is to get the sources and read them.
If you have any questions regarding some specific parts of the code, feel free to ask them here.

--
Wbr,
Antony Dovgal
---
http://pinba.org - realtime profiling for PHP
Reply all
Reply to author
Forward
0 new messages