[squid-users] restart url_redirector processe when it dies

2009-03-13 Thread Dieter Bloms
Hi,

I use an url_rewrite_program, which seems to die after about 40
requests.
Squid starts 15 processes, which are enough, but after some time one
process after another die and at the end all processes where gone.

Is it possible to let squid restart an url_rewrite_program, when it dies ?


-- 
Kind regards

  Dieter

--
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
From field.


Re: [squid-users] restart url_redirector processe when it dies

2009-03-15 Thread Amos Jeffries

Dieter Bloms wrote:

Hi,

I use an url_rewrite_program, which seems to die after about 40
requests.
Squid starts 15 processes, which are enough, but after some time one
process after another die and at the end all processes where gone.

Is it possible to let squid restart an url_rewrite_program, when it dies ?




What version of Squid are you using that does not do this restart 
automatically?
Squid only dies when ALL helpers for a needed service are dying too fast 
to recover quickly.


Amos
--
Please be using
  Current Stable Squid 2.7.STABLE6 or 3.0.STABLE13
  Current Beta Squid 3.1.0.6


Re: [squid-users] restart url_redirector processe when it dies

2009-03-16 Thread Dieter Bloms
Hi Amos,

On Sun, Mar 15, Amos Jeffries wrote:

>> I use an url_rewrite_program, which seems to die after about 40
>> requests.
>> Squid starts 15 processes, which are enough, but after some time one
>> process after another die and at the end all processes where gone.
>>
>> Is it possible to let squid restart an url_rewrite_program, when it dies ?
>>
>>
>
> What version of Squid are you using that does not do this restart 
> automatically?
> Squid only dies when ALL helpers for a needed service are dying too fast to 
> recover quickly.

I use squid 2.7.STABLE6.
I've 15 processes running, when I kill 2 of them, I see only 13 of 15
processes running in the cache manager menu.

like:

--snip from cache manager menu --
Redirector Statistics:
program: /usr/local/bin/webcatredir
number running: 13 of 15
requests sent: 2482
replies received: 2481
queue length: 0
avg service time: 3.33 msec
--snip--
 
for me it looks like the 2 killed processes will not be started, or does
it take some time ?

--snip from squid -v 
Squid Cache: Version 2.7.STABLE6
configure options:  '--prefix=/usr' '--sysconfdir=/etc/squid'
'--bindir=/usr/sbin' '--sbindir=/usr/sbin' '--localstatedir=/var'
'--libexecdir=/usr/sbin' '--datadir=/usr/share/squid' '--disable-carp'
'--disable-htcp' '--disable-icap-client' '--disable-ident-lookups'
'--disable-wccp' '--disable-wccpv2' '--enable-async-io=128'
'--enable-auth=basic digest' '--enable-basic-auth-helpers=LDAP'
'--enable-digest-auth-helpers=ldap'
'--enable-default-err-language=German_Datev'
'--enable-err-languages=German' '--enable-snmp'
'--enable-storeio=aufs,ufs,diskd,null' '--enable-referer-log'
'--enable-useragent-log' '--enable-large-cache-files'
'--enable-removal-policies=lru,heap' '--mandir=/usr/share/man'
'--with-default-user=squid' '--with-filedescriptors=8192'
'--with-large-files' '--with-pthreads' '--with-aio'
--snip--


-- 
Gruß

  Dieter

--
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
From field.


Re: [squid-users] restart url_redirector processe when it dies

2009-03-16 Thread Amos Jeffries

Dieter Bloms wrote:

Hi Amos,

On Sun, Mar 15, Amos Jeffries wrote:


I use an url_rewrite_program, which seems to die after about 40
requests.
Squid starts 15 processes, which are enough, but after some time one
process after another die and at the end all processes where gone.

Is it possible to let squid restart an url_rewrite_program, when it dies ?


What version of Squid are you using that does not do this restart 
automatically?
Squid only dies when ALL helpers for a needed service are dying too fast to 
recover quickly.


I use squid 2.7.STABLE6.
I've 15 processes running, when I kill 2 of them, I see only 13 of 15
processes running in the cache manager menu.

like:

--snip from cache manager menu --
Redirector Statistics:
program: /usr/local/bin/webcatredir
number running: 13 of 15
requests sent: 2482
replies received: 2481
queue length: 0
avg service time: 3.33 msec
--snip--
 
for me it looks like the 2 killed processes will not be started, or does

it take some time ?


May take some time.
They are restarted if they are needed, up to the max limit of children. 
Or at some point if they are noticed by other means.


IIRC the too-fast-to-recover ratio is 1 death per request handled or 
less. (helper dies after its first request is fatal, or dies before 
responding to first request is more fatal).



Amos
--
Please be using
  Current Stable Squid 2.7.STABLE6 or 3.0.STABLE13
  Current Beta Squid 3.1.0.6


Re: [squid-users] restart url_redirector processe when it dies

2009-03-16 Thread Chris Woodfield
To elaborate, squid should restart new url_rewrite_program instances  
when the number of live children falls to <= 50% of the configured  
number. So once 8 processes out of 15 die, squid should launch a whole  
new set of 15. You'll then have 23 url_rewriter processes, but squid  
will launch 15 more when they die and only 7 are left. The circle of  
life continues...


In squid 2.7, if you don't want to wait for half your helpers to die  
before squid launches more, you can adjust the threshold in  
helper.c:helperServerFree() by changing the following line:


if (hlp->n_active <= hlp->n_to_start / 2)  {

And changing the right size of the evaluation from "/ 2" to, say, "* . 
75" or similar.


This can be used as a somewhat ghetto way of dealing with a rewriter  
that has a memory leak - put a dead-man's counter into the rewriter  
that causes the process to exit after X number of requests, and let  
squid launch new ones as needed. (Not that I've ever done anything  
like that myself, nosiree...)


-C

On Mar 15, 2009, at 5:14 AM, Amos Jeffries wrote:


Dieter Bloms wrote:

Hi,
I use an url_rewrite_program, which seems to die after about 40
requests.
Squid starts 15 processes, which are enough, but after some time one
process after another die and at the end all processes where gone.
Is it possible to let squid restart an url_rewrite_program, when it  
dies ?


What version of Squid are you using that does not do this restart  
automatically?
Squid only dies when ALL helpers for a needed service are dying too  
fast to recover quickly.


Amos
--
Please be using
 Current Stable Squid 2.7.STABLE6 or 3.0.STABLE13
 Current Beta Squid 3.1.0.6





Re: [squid-users] restart url_redirector processe when it dies

2009-03-16 Thread Amos Jeffries
> To elaborate, squid should restart new url_rewrite_program instances
> when the number of live children falls to <= 50% of the configured
> number. So once 8 processes out of 15 die, squid should launch a whole
> new set of 15. You'll then have 23 url_rewriter processes, but squid
> will launch 15 more when they die and only 7 are left. The circle of
> life continues...

PS: yes that is a known bug. Squid should only start the 8 dead ones back.
It's on the queue for fixing one day.

>
> In squid 2.7, if you don't want to wait for half your helpers to die
> before squid launches more, you can adjust the threshold in
> helper.c:helperServerFree() by changing the following line:
>
> if (hlp->n_active <= hlp->n_to_start / 2)  {
>
> And changing the right size of the evaluation from "/ 2" to, say, "* .
> 75" or similar.
>
> This can be used as a somewhat ghetto way of dealing with a rewriter
> that has a memory leak - put a dead-man's counter into the rewriter
> that causes the process to exit after X number of requests, and let
> squid launch new ones as needed. (Not that I've ever done anything
> like that myself, nosiree...)
>

Hmm, inspiration for a new idea and explanation of a bug in one post.
Thank you very much.

Amos

> -C
>
> On Mar 15, 2009, at 5:14 AM, Amos Jeffries wrote:
>
>> Dieter Bloms wrote:
>>> Hi,
>>> I use an url_rewrite_program, which seems to die after about 40
>>> requests.
>>> Squid starts 15 processes, which are enough, but after some time one
>>> process after another die and at the end all processes where gone.
>>> Is it possible to let squid restart an url_rewrite_program, when it
>>> dies ?
>>
>> What version of Squid are you using that does not do this restart
>> automatically?
>> Squid only dies when ALL helpers for a needed service are dying too
>> fast to recover quickly.
>>
>> Amos
>> --
>> Please be using
>>  Current Stable Squid 2.7.STABLE6 or 3.0.STABLE13
>>  Current Beta Squid 3.1.0.6
>>
>
>




Re: [squid-users] restart url_redirector processe when it dies

2009-03-16 Thread Chris Woodfield


On Mar 16, 2009, at 8:13 PM, Amos Jeffries wrote:


To elaborate, squid should restart new url_rewrite_program instances
when the number of live children falls to <= 50% of the configured
number. So once 8 processes out of 15 die, squid should launch a  
whole

new set of 15. You'll then have 23 url_rewriter processes, but squid
will launch 15 more when they die and only 7 are left. The circle of
life continues...


PS: yes that is a known bug. Squid should only start the 8 dead ones  
back.

It's on the queue for fixing one day.



In squid 2.7, if you don't want to wait for half your helpers to die
before squid launches more, you can adjust the threshold in
helper.c:helperServerFree() by changing the following line:

if (hlp->n_active <= hlp->n_to_start / 2)  {

And changing the right size of the evaluation from "/ 2" to, say,  
"* .

75" or similar.

This can be used as a somewhat ghetto way of dealing with a rewriter
that has a memory leak - put a dead-man's counter into the rewriter
that causes the process to exit after X number of requests, and let
squid launch new ones as needed. (Not that I've ever done anything
like that myself, nosiree...)



Hmm, inspiration for a new idea and explanation of a bug in one post.
Thank you very much.


Not a problem - I guess you can consider this a feature request to  
make that threshold tunable in squid.conf :)


-C



Amos


-C

On Mar 15, 2009, at 5:14 AM, Amos Jeffries wrote:


Dieter Bloms wrote:

Hi,
I use an url_rewrite_program, which seems to die after about 40
requests.
Squid starts 15 processes, which are enough, but after some time  
one

process after another die and at the end all processes where gone.
Is it possible to let squid restart an url_rewrite_program, when it
dies ?


What version of Squid are you using that does not do this restart
automatically?
Squid only dies when ALL helpers for a needed service are dying too
fast to recover quickly.

Amos
--
Please be using
Current Stable Squid 2.7.STABLE6 or 3.0.STABLE13
Current Beta Squid 3.1.0.6