As I do NOT want to add extra cost to squid, I will stay with the script and try to optimise it.
Thanks, Amos. > On Dec 3, 2015, at 8:27 PM, Amos Jeffries <squ...@treenet.co.nz> wrote: > > On 4/12/2015 1:14 a.m., GoGo net wrote: >> I am running squid 3.5 in my LAN as a proxy for surfing internet. >> >> The proxy is shared by all users in the LAN, and every user has a >> username/password configured in their web browser. >> >> Now, I want to limit user traffic quota, say every user 100GB/month. How can >> achieve this? >> >> Currently, I use a script to monitor **access.log** of squid, and aggregate >> the traffic from log to calculate user traffic. But I am wondering what is >> the best practise to limit user quota? Is there a better way to limit user >> traffic quota? >> > > Nope. Squid is designed to optimize traffic not to de-optimize it. So > does not do quota limitations. > > However the OS QoS controls often do support quotas and do so far better > than Squid could even get close to. Squid can integrate with those using > tcp_outgoing_tos/mark and qos_flows to deliver per-request > classification tags to the OS QoS system. > > > If you stay wit a helper script you maybe could still optimize it a > little. Your log monitoring Script could be run as a log daemon helper > in order to get the log lines as soon as they are written. That also > lets you send a custom log format separate from the access.log to the > helper so it can work better. > > > Amos > > _______________________________________________ > squid-users mailing list > squid-users@lists.squid-cache.org > http://lists.squid-cache.org/listinfo/squid-users _______________________________________________ squid-users mailing list squid-users@lists.squid-cache.org http://lists.squid-cache.org/listinfo/squid-users