Re: [squid-users] helpers die all at the same time without any reason

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 02 Jan 2013 13:09:35 +1300

On 2/01/2013 3:47 a.m., JokeTube.TV wrote:
> Hello,
>
> I am using helpers to customize Squid's functionality. I noticed that
> helpers die after some time (all at the same time). Is that normal? Is
> there any limit how much requests one helper could serve and after
> must be killed?

For PHP helpers yes unfortunately it is. The PHP documented time limits
(plural) do not al work correctly in all version of PHP.

I tried resolving this with many PHP4 and 5 versions, but in the end the
only thing that worked was modifying Squid to the below behaviour of
ignoring the helper deaths and auto-restarting them all every single
hour. It looks like you are running a version of Squid where that change
is already present.

> 2013/01/01 16:19:22| WARNING: basicauthenticator #1 (FD 12) exited
> 2013/01/01 16:19:22| WARNING: basicauthenticator #3 (FD 32) exited
> 2013/01/01 16:19:23| WARNING: basicauthenticator #2 (FD 16) exited
> 2013/01/01 16:19:23| Too few basicauthenticator processes are running
> 2013/01/01 16:19:23| Starting new helpers
>
> This kind of logs seems suspicious to me. The helper program is a
> simple PHP script which has set_time_limit(0) at the beginning and
> while loop to process requests:
>
> while ($line = fgets(STDIN)) {
> // connect to DB if connection does not exist or were closed
> list($userName, $password) = explode(' ', trim($line), 2);
> // check user & pass and reply OK, ERR or BH
> }
>
> Can anyone suggest what debug_options's section I should use to log
> helper killing reason? Any suggestion or tip will be appreciated.

There is the above PHP script run-time limit, a PHP stdin/out use
timeouts, and PHP engine run-time limits to fight here. All of these
exit/abort the helper without any reason being logged anywhere on the
system (thank you Zend). The first two of them are configurable from
within the script with sometimes-working function calls, the engine
limit is a php.ini setting only that cannot be unlimited.

Amos
Received on Wed Jan 02 2013 - 00:09:47 MST

This archive was generated by hypermail 2.2.0 : Wed Jan 02 2013 - 12:00:03 MST