Welcome! Log In Create A New Profile

Advanced

fpm_request_check_timeout?

Posted by Jason 
Jason
fpm_request_check_timeout?
July 01, 2009 09:51AM
==Hi==
We're an open source group trying to get our commercial face up and
running. One thing I've learned is when your developing and using
'cutting edge' software throw your plans out the window. Also, it's
good to have the source ready when your using it.

==The Error's Error's Err...==
Having said that, I've had to take myself off our core projects
because we have a security issue in dev for our own commercial facing
php site. Somewhat narrowed it down to a bug or two in the OSS
software we use for THAT however we need to do a full debug live.
This being the case we need to do a remote debug with xdebug.

HOWEVER, I'm running into fpm_request_check_timeout() (from the top
of my memory it could be different). From there it gets sig'd to
death.

We use NetBeans (trunk) and xdebug client comes back with "socket
error". Inspecting the logs (which we could make more detailed), we
see the fpm_request_check_timeout() (again i may have the spelling/
name wrong but it's something like that).

==Our Stack==
Varnish --> Nginx(N)(Fair): --> PHP(FPM+APC+Suhosin).
(In Dev, N=1)

Remote Debug of PHP via: NetBeans + xDebug

Forget what PHP version we're using. (far away from system atm)

==More Notes==
I've changed every timeout I could find, from nginx's timeout settings
in the confs, fastcgi timeouts, to varnish confs, etc...

I cannot narrow it down.

==Questions==
- Anyone have any clue what causes this FPM exception?
- How do I start logging more detailed info with FPM?
- FPM Source? If the source is out there we'd like to see it (i can't
find it!).

Thanks guys!

P.S. Once we're up I'll be sure to make a contribution.
Re: fpm_request_check_timeout?
July 01, 2009 12:21PM
On Wed, Jul 1, 2009 at 6:51 AM, Jason<jason.giedymin@gmail.com> wrote:

> - How do I start logging more detailed info with FPM?

Honestly, "catch_workers_output" set to "yes" might help. Then errors
may show up in your nginx error log or PHP error log. Also,
"log_level" set to debug would probably help a lot. log_level is a
global option, catch_workers_output is an option in each pool

> - FPM Source?  If the source is out there we'd like to see it (i can't
> find it!).

http://php-fpm.org/downloads/ - it's a single patchfile for each
release right now. I'm thinking of possibly restructuring.

I'm not ignoring the rest of your email. I just don't know the internals, sadly.
Jason
Re: fpm_request_check_timeout?
July 01, 2009 02:44PM
Hey Thanks!

Totally forgot about the .org. I was looking for a google code spot
for fpm.



On Jul 1, 12:21
Jason
Re: fpm_request_check_timeout?
July 01, 2009 03:38PM
For reference I will be posting my findings in this thread.

I will be using 5.2.9 unofficial patch.

Actual function refered to in my email is:
fpm_request.c:fpm_request_check_timed_out()[line: 105]
referenced by: fpm_process_ctl.c:fpm_pctl_check_request_timeout()
[line: 331]

On Jul 1, 12:21
Re: fpm_request_check_timeout?
July 01, 2009 03:59PM
Yeah, I'm working on determining if it's worth getting the project
source code hosted, etc...

Kind of depends on the future of the project and PHP/PECL/etc.

On Wed, Jul 1, 2009 at 11:44 AM, Jason<jason.giedymin@gmail.com> wrote:
>
> Hey Thanks!
>
> Totally forgot about the .org.  I was looking for a google code spot
> for fpm.
>
>
>
> On Jul 1, 12:21 pm, Michael Shadle <mike...@gmail.com> wrote:
>> On Wed, Jul 1, 2009 at 6:51 AM, Jason<jason.giedy...@gmail.com> wrote:
>> > - How do I start logging more detailed info with FPM?
>>
>> Honestly, "catch_workers_output" set to "yes" might help. Then errors
>> may show up in your nginx error log or PHP error log. Also,
>> "log_level" set to debug would probably help a lot. log_level is a
>> global option, catch_workers_output is an option in each pool
>>
>> > - FPM Source?  If the source is out there we'd like to see it (i can't
>> > find it!).
>>
>> http://php-fpm.org/downloads/- it's a single patchfile for each
>> release right now. I'm thinking of possibly restructuring.
>>
>> I'm not ignoring the rest of your email. I just don't know the internals, sadly.
Jason
Re: fpm_request_check_timeout?
July 01, 2009 04:11PM
SO...

I guess i missed out on some timeouts. We'll see tonight.

<code>
int terminate_timeout = wp->config->request_terminate_timeout;
int slowlog_timeout = wp->config->request_slowlog_timeout;
struct fpm_child_s *child;

if (terminate_timeout || slowlog_timeout) {
</code>

I thought that both of these config values were set to 0 by default
(off)?:
(from: sapi/cgi/fpm/conf/php-fpm.conf.in)
- <value name="request_terminate_timeout">0s</value>
- <value name="request_slowlog_timeout">0s</value>

(still sifting through code...)

On Jul 1, 3:38
Jason
Re: fpm_request_check_timeout?
July 01, 2009 04:27PM
Something is up. Docs say 5s, code says 0s.

From: http://php-fpm.org/Configuration_File
request_terminate_timeout - The timeout (in seconds) for serving a
single request after which the worker process will be terminated.
Should be used when 'max_execution_time' ini option does not stop
script execution for some reason. Default: "5s". Note: '0s' means
'off'

request_slowlog_timeout - The timeout (in seconds) for serving of
single request after which a php backtrace will be dumped to slow.log
file. Default: "5s". Note: '0s' means 'off'

Code says (my previous post)

Unless I'm reading wrong... :/

On Jul 1, 4:11
Jason
Re: fpm_request_check_timeout?
July 01, 2009 04:30PM
If the project lifeline is in jeopardy I would git than svn it.
Though you run the risk of distributed responsibility, read: no focus.

On Jul 1, 3:59
Re: fpm_request_check_timeout?
July 01, 2009 04:58PM
I was thinking github or launchpad.


On Wed, Jul 1, 2009 at 1:30 PM, Jason<jason.giedymin@gmail.com> wrote:
>
> If the project lifeline is in jeopardy I would git than svn it.
> Though you run the risk of distributed responsibility, read: no focus.
>
> On Jul 1, 3:59 pm, Michael Shadle <mike...@gmail.com> wrote:
>> Yeah, I'm working on determining if it's worth getting the project
>> source code hosted, etc...
>>
>> Kind of depends on the future of the project and PHP/PECL/etc.
>>
>>
>>
>> On Wed, Jul 1, 2009 at 11:44 AM, Jason<jason.giedy...@gmail.com> wrote:
>>
>> > Hey Thanks!
>>
>> > Totally forgot about the .org.  I was looking for a google code spot
>> > for fpm.
>>
>> > On Jul 1, 12:21 pm, Michael Shadle <mike...@gmail.com> wrote:
>> >> On Wed, Jul 1, 2009 at 6:51 AM, Jason<jason.giedy...@gmail.com> wrote:
>> >> > - How do I start logging more detailed info with FPM?
>>
>> >> Honestly, "catch_workers_output" set to "yes" might help. Then errors
>> >> may show up in your nginx error log or PHP error log. Also,
>> >> "log_level" set to debug would probably help a lot. log_level is a
>> >> global option, catch_workers_output is an option in each pool
>>
>> >> > - FPM Source?  If the source is out there we'd like to see it (i can't
>> >> > find it!).
>>
>> >>http://php-fpm.org/downloads/-it's a single patchfile for each
>> >> release right now. I'm thinking of possibly restructuring.
>>
>> >> I'm not ignoring the rest of your email. I just don't know the internals, sadly.
Re: fpm_request_check_timeout?
July 01, 2009 04:59PM
I pulled that from a default xml file that comes with php-fpm...

if the user is using a default config file it will be 5s, i believe,
but if they don't the internal default is 0s. i think in this case,
the default xml config should match all the internal configurations
(or vice versa, whichever makes more sense)



On Wed, Jul 1, 2009 at 1:27 PM, Jason<jason.giedymin@gmail.com> wrote:
>
> Something is up.  Docs say 5s, code says 0s.
>
> From: http://php-fpm.org/Configuration_File
> request_terminate_timeout - The timeout (in seconds) for serving a
> single request after which the worker process will be terminated.
> Should be used when 'max_execution_time' ini option does not stop
> script execution for some reason. Default: "5s". Note: '0s' means
> 'off'
>
> request_slowlog_timeout - The timeout (in seconds) for serving of
> single request after which a php backtrace will be dumped to slow.log
> file. Default: "5s". Note: '0s' means 'off'
>
> Code says (my previous post)
>
> Unless I'm reading wrong...  :/
>
> On Jul 1, 4:11 pm, Jason <jason.giedy...@gmail.com> wrote:
>> SO...
>>
>> I guess i missed out on some timeouts.  We'll see tonight.
>>
>> <code>
>> int terminate_timeout = wp->config->request_terminate_timeout;
>> int slowlog_timeout = wp->config->request_slowlog_timeout;
>> struct fpm_child_s *child;
>>
>> if (terminate_timeout || slowlog_timeout) {
>> </code>
>>
>> I thought that both of these config values were set to 0 by default
>> (off)?:
>>  (from: sapi/cgi/fpm/conf/php-fpm.conf.in)
>>   - <value name="request_terminate_timeout">0s</value>
>>   - <value name="request_slowlog_timeout">0s</value>
>>
>> (still sifting through code...)
>>
>> On Jul 1, 3:38 pm, Jason <jason.giedy...@gmail.com> wrote:
>>
>>
>>
>> > For reference I will be posting my findings in this thread.
>>
>> > I will be using 5.2.9 unofficial patch.
>>
>> > Actual function refered to in my email is:
>> > fpm_request.c:fpm_request_check_timed_out()[line: 105]
>> > referenced by: fpm_process_ctl.c:fpm_pctl_check_request_timeout()
>> > [line: 331]
>>
>> > On Jul 1, 12:21 pm, Michael Shadle <mike...@gmail.com> wrote:
>>
>> > > On Wed, Jul 1, 2009 at 6:51 AM, Jason<jason.giedy...@gmail.com> wrote:
>> > > > - How do I start logging more detailed info with FPM?
>>
>> > > Honestly, "catch_workers_output" set to "yes" might help. Then errors
>> > > may show up in your nginx error log or PHP error log. Also,
>> > > "log_level" set to debug would probably help a lot. log_level is a
>> > > global option, catch_workers_output is an option in each pool
>>
>> > > > - FPM Source?  If the source is out there we'd like to see it (i can't
>> > > > find it!).
>>
>> > >http://php-fpm.org/downloads/-it'sa single patchfile for each
>> > > release right now. I'm thinking of possibly restructuring.
>>
>> > > I'm not ignoring the rest of your email. I just don't know the internals, sadly.
Jason
Re: fpm_request_check_timeout?
July 02, 2009 12:57AM
By setting the value for the timeout to 0, it all worked out. Now I
can debug the Php app and fix that before getting back to work...

One more thing below,

Issue: fix/enhancement
Desc: change all internal defaults to reflect those set be the values
in the default XML. The sample XML has 'safer' values than the
internals. This change would both satisfy consistent documentation as
well as enhanced security. Additional config files if needed should
be supplied ala ASF (Apache) style such that these config files would
read:
Php-fpm.debug.conf
Php-fpm.production.conf
Php-fpm.default.conf
Php-fpm.conf (is a copy of default.conf)

Side note, knowing that one could essentially corrupt the XML file
forcing fpm to act on a less restrictive set of configs is little
scary.

On Jul 1, 4:59
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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