Re: Feature: quota control

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Fri, 27 Feb 2009 17:13:35 +1300

Robert Collins wrote:
> On Fri, 2009-02-27 at 10:00 +1100, Mark Nottingham wrote:
>> Honestly, if I wanted to do byte-based quotas today, I'd have an
>> external ACL helper talking to an external logging helper; that way,
>> you can just log the response sizes to a daemon and then another
>> daemon would use that information to make a decision at access time.
>> The only even mildly hard part about this is sharing state between the
>> daemons, but if you don't need the decisions to be real-time, it's not
>> that bad (especially considering that in any serious deployment,
>> you'll have state issues between multiple boxes anyway).
>
> Sure; I think that would fit with 'ensuring enough hooks' :P
>
> -Rob

The brief description of what I gave Pieter to start with was:

   A pool based on DelayPools in that Squid decrements live as traffic
goes through. With a helper/ACL hook to retrieve the initial pool size
and to call as needed to check for current quotas.

   How the helper operates is not relevant to Squid. Thats important.

The key things being that; its always called for new visitors to assign
the start quota, and when the quota is nearing empty its called again to
see if they get more.

Helper would need to send back "UNITS AMOUNT MINIMUM" where UNITS is the
unit of quota (seconds, bytes, requests, misses?, other?), AMOUNT being
a integer count of units the client is allowed to use, and MINIMUM is
the level of units where the helper is to be asked for an update.

0 remaining units results in an Error page 'quota exceeded' or somesuch.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE6 or 3.0.STABLE13
   Current Beta Squid 3.1.0.5
Received on Fri Feb 27 2009 - 04:13:16 MST

This archive was generated by hypermail 2.2.0 : Fri Feb 27 2009 - 12:00:02 MST