[squid-users] squid cache takes a break

Vieri rentorbuy at yahoo.com
Mon Sep 11 08:49:01 UTC 2017


________________________________
From: Amos Jeffries <squid3 at treenet.co.nz>
>
> a) start fewer helpers at a time.
> 
> b) reduce cache_mem.
> 
> c) add concurrency support to the helpers.


So I decreased the startup, idle, cache_mem values:

# egrep 'startup=|idle=' squid.conf
external_acl_type bllookup ttl=86400 negative_ttl=86400 children-max=80 children-startup=10 children-idle=3 %URI /opt/custom/scripts/run/scripts/firewall/squid_url_lookup.pl [...]
sslcrtd_children 128 startup=10 idle=3

# grep cache_mem squid.conf
cache_mem 64 MB

I also set debug_options to "ALL,1 5,9 50,6 51,3 54,9".

As far as concurrency is concerned, I never programmed a helper to support this feature.
If it were to be done in Perl, do you know by any chance if it would require Perl6 "promises" with await/start function calls?

Currently, my "bllookup" helper is a simple Perl5 script which reads from standard input like so:

while( <STDIN> )
{
[...lookup URI in a MySQL database and reply accordingly to Squid...]
}

It does not handle the channel-ID field.

I haven't found many Squid concurrency-enabled helper examples out there.

By the way, I see that Squid defaults to IPv6 for helper communications. I suppose it wouldn't make any real difference if I tried "ipv4" with "external_acl_type".
If I don't get any new info next time Squid slows down to a crawl, I'll probably try ipv4 just for kicks.

What I still don't get is how long it takes for Squid to get back to work after I do a complete restart (after thoroughly killing all related processes, including helpers). I'm talking more than 5 minutes here...
If I ever get the same issue again, I understand that I can:

- stop squid & eventually kill all apparently stalled processes

- modify squid.conf, and decrease or comment out all *startup= and *idle= options

- start squid

At this point, I should expect Squid to be up and serving within a reasonable amount of time, even if I may get squid warnings later on asking me to increase those values.
Or maybe not, because the Linux kernel might be busy cleaning up the swap space anyway?

One last thing. I'm running squid 3.5.26. I'll try to upgrade to 3.5.27 asap.

Thanks,

Vieri


More information about the squid-users mailing list