[squid-users] squid and quota check

From: Piccoli, Lucio <[email protected]>
Date: Tue, 11 Feb 2003 17:10:56 +1100

hi all,

i have implemented quota checking by parsing squid's acces.log and an using
an acl. However it seems that a better solution is possible. The main
problem being that parsing the access.log every 15minutes or so causing a
massive spike in CPU utilisation for several seconds. (To parse a 10Mb
access.log takes 3-5 CPU secs on a sun netra solaris 5.8) I have a read a
few other comments about having quota checking in squid, so i guess it might
be useful. My plan is rather raw at present but goes something like this.

1) Gather the quota statistics as it is being logged to accessLogLog(). Each
time the accessLogLog is called in client_side.c there will be another to
invocation to quota statistics.
2) This will be stored in memory as a value/name pair.
3) The value being the incremented quota usage and the name being the user
name.
4) At sometime later a signal is generated (from a crontab ) to dump the
contents of the quota statistics to a persistent form. The persistence will
involve an out of process helper (similar to the auth helpers). This will
enable custom mechanisms.
5) The checking for excess quota can be handled by the conventional ACL
mechanism which would be related to the quotstat.persistent().

The obvious consideration is that the invocation to the quotastat from
client_side.c must be quick and have a small resource footprint. The
quotstat.persistent() can be left free to the custom implementation.

Any comments are appreciated

thanks

-lucio piccoli
-------------------------
QCOM Australia Pty Ltd
ph +61 7 3858 6256
Received on Mon Feb 10 2003 - 23:44:11 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:13:18 MST