Re: [squid-users] reply_body_max_size + delay_pools

From: Chris Robertson <crobertson_at_gci.net>
Date: Fri, 11 Jul 2008 10:45:19 -0800

Heinrich Harrer wrote:
> On Tue, Jul 8, 2008 at 3:36 PM, Chris Robertson <crobertson_at_gci.net> wrote:
> [cut]
>
>> Just use delay pools, and set the initial bucket size to the max object size
>> you don't want to limit. This will have the added benefit of preventing
>> someone from circumventing your reply_body_max_size slowdown by grabbing
>> lots of little bits of a large file.
>>
>> delay pools 1
>> delay_class 1 2
>> delay_access 1 allow all
>> delay_parameters 1 -1/-1 1048576/32000 # The first MByte of non-cached
>> traffic is delay free, and the bucket refills at 256kbps.
>>
>
> Cool, thanks.
>
> My rules are per user, like this (one of them):
>
> acl test src x.y.z.k
> http_access allow test
> delay_class 1414 1
> delay_parameters 1414 16000/16000
> delay_access 1414 allow test
> delay_access 1414 deny all
>

Wow. That's fascinating. Over a thousand individual delay pools. It
seems to me, unless each person's pool is unique, you should be able to
just set up a few different class 2 pools and shuffle IPs to the proper
one...

delay pools 3
delay class 1 2
delay class 2 2
delay class 3 2
delay parameters 1 -1/-1 16000/16000 #128kbps limit
delay parameters 2 -1/-1 1048576/8000 # 10mbits free 64kbps limit
delay parameters 3 -1/-1 8000/8000 #64 kbps limit

acl user1 src x.y.z.j
acl user2 src x.y.z.k
acl user3 src x.y.z.l
acl user4 src x.y.z.m
acl user5 src x.y.z.n

#128kbit customers
delay access 1 allow user1
delay access 1 allow user4
delay access 1 deny all

#10mbit free/64kbit customers
delay access 2 allow user5
delay access 2 deny all

#64kbit customers (the default)
delay access 3 allow all

Alternatively, Squid 3 introduced two new delay classes. One which
works with authentication, and the other which works with tags set by
external_acl. Perhaps one of those would be a better fit.

> I only add/change an other delay_parameters:
>
> delay_parameters 1414 16000/16000
> delay_parameters 1414 1048576/8000
>
> Normal traffic (not cached) is 128kbps limit, objects > 10MB 64kbps.
>
> Its working, I tested!
>
> My question is: this structure is right? (per dst.)
>

Huh. I can't answer that question. I didn't think that you could use
more than one delay_parameter per pool...

Chris
Received on Fri Jul 11 2008 - 18:45:36 MDT

This archive was generated by hypermail 2.2.0 : Sat Jul 12 2008 - 12:00:04 MDT