<div dir="ltr"><div>Hello.</div><div><br></div><div>We've recently had an incident where misbehaving cluster of clients started fetching 4MB file from squid cache with ~1200 RPS (slowed down to 600 RPS later) which resulted in up to 2Gb/s of traffic sent to clients from each of our squid hosts and quickly overloaded squid.</div><div><br></div><div>I'm trying to use client_delay_pools to limit bandwidth per client and prevent misbehaving actors from saturating client-side network / CPU on squid hosts.</div><div><br></div><div>However I can't get it to work reliably. It seems to be working as expected for cache MISS, e.g. getting a speed limit of 10MB/s. But it's completely broken for cache HIT, speed I'm getting is ~5KB/s!</div><div><br></div><div><div>The following configuration:</div><div><br></div><div>client_delay_pools 1<br>client_delay_access 1 allow localnet<br>client_delay_access 1 deny all<br>client_delay_parameters 1 10000000 20000000<br></div></div><div><br></div><div>Testing with an already cached big object (2GB ISO file).</div><div><br></div><div>client_delay_pools disabled MISS: 20MB/s (probably speed limit on origin side)<br></div><div>client_delay_pools disabled HIT: 110MB/s (probably EBS disk speed)<br></div><div><br></div><div>client_delay_pools enabled MISS: 10MB/s (limit from client_delay_parameters)<br></div><div>client_delay_pools enabled HIT: 5KB/s (what ???)<br></div><div><br></div><div>I retested with a smaller file (337MB) but it made no difference. Still got 5KB download speed on cache HIT.</div><div><br></div><div>Any ideas? Am I doing something wrong? Any other ways to limit client-side bandwidth?</div><div><br></div>Squid version:<div><br>Squid Cache: Version 4.14<br>Service Name: squid<br>configure options:  '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/sbin' '--sbindir=/usr/sbin' '--sysconfdir=/etc/squid' '--libdir=/usr/lib' '--libexecdir=/usr/lib/squid' '--includedir=/usr/include' '--datadir=/usr/share/squid' '--sharedstatedir=/usr/com' '--localstatedir=/var' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-epoll' '--enable-removal-policies=heap,lru' '--enable-storeio=aufs,rock' '--enable-delay-pools' '--with-pthreads' '--enable-cache-digests' '--with-large-files' '--with-maxfd=16384' '--enable-htcp'<div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">With best regards, Ivan Larionov.</div></div></div></div>