Re: [squid-users] How to do a limit quota download on a Squid proxy

2009-07-10 Thread John Doe

From: tintin_vefg54e654g maf1...@hotmail.fr
 I have a Mandriva 2009.1 OS, with squid ( + sarg, and mrtg) proxy.
 so, in the purpose to keep few free brandwicth for working using ^^ I would
 like to set limits download.
 I don't have users identifications, I see my users by IP adress.
 The matter is I would like to set a quota as a limit of 100Mb per day of
 download per IP adress.
 How is it possible to do such thing. 

Maybe using an external_acl script given the IP + 'Content-Length' header would 
do, but you have to code it.
You add the size value to a memcache value, based on the IP.
If the memcache value is  100MB, deny access.
Restart/clear memcache everyday.
And you might have to handle ranges...

JD


  



Re: [squid-users] How to do a limit quota download on a Squid proxy

2009-07-10 Thread Adrian Chadd
I had specified how to implement proper quota support for a client -
but the project unfortunately fell through.

Its easy to hook into the end of a HTTP request and mark how much
bandwidth was used. The missing piece is a method of permitting
network access for users so they can't easily access hundreds of
megabytes in a given download. I had outlined another helper process
to allow download quotas in configurable chunks - eg per megabyte.
The other missing piece was to be able to clear all connections from a
given IP or for a given user.

All of these are easy to do if someone has some motivation. :)


Adrian

2009/7/9 tintin_vefg54e654g maf1...@hotmail.fr:

 Hi everyone,

 my configuration is as follow :

 I have a Mandriva 2009.1 OS, with squid ( + sarg, and mrtg) proxy.
 so, in the purpose to keep few free brandwicth for working using ^^ I would
 like to set limits download.

 I don't have users identifications, I see my users by IP adress.
 The matter is I would like to set a quota as a limit of 100Mb per day of
 download per IP adress.
 How is it possible to do such thing.
 is it ? ^^
 if I dare ... most simple way.

 ok, thanks for your help,
 see ya' on the forum

 Tintin


 --
 View this message in context: 
 http://www.nabble.com/How-to-do-a-limit-quota-download-on-a-Squid-proxy-tp24410453p24410453.html
 Sent from the Squid - Users mailing list archive at Nabble.com.




[squid-users] How to do a limit quota download on a Squid proxy

2009-07-09 Thread tintin_vefg54e654g

Hi everyone,

my configuration is as follow :

I have a Mandriva 2009.1 OS, with squid ( + sarg, and mrtg) proxy.
so, in the purpose to keep few free brandwicth for working using ^^ I would
like to set limits download.

I don't have users identifications, I see my users by IP adress.
The matter is I would like to set a quota as a limit of 100Mb per day of
download per IP adress.
How is it possible to do such thing. 
is it ? ^^
if I dare ... most simple way.

ok, thanks for your help,
see ya' on the forum

Tintin


-- 
View this message in context: 
http://www.nabble.com/How-to-do-a-limit-quota-download-on-a-Squid-proxy-tp24410453p24410453.html
Sent from the Squid - Users mailing list archive at Nabble.com.



Re: [squid-users] How to do a limit quota download on a Squid proxy

2009-07-09 Thread Leonardo Carneiro

Hi tintin.

You can use delay pools.

You can set individual buckets with the size of 100mb and a with a regen 
rate of 0kbps and set a script to restart squid at midnight to refresh 
the buckets. I don't know if there is a smarter way of refresh the 
buckets to a full state at once.


Sorry about my poor english.

tintin_vefg54e654g escreveu:

Hi everyone,

my configuration is as follow :

I have a Mandriva 2009.1 OS, with squid ( + sarg, and mrtg) proxy.
so, in the purpose to keep few free brandwicth for working using ^^ I would
like to set limits download.

I don't have users identifications, I see my users by IP adress.
The matter is I would like to set a quota as a limit of 100Mb per day of
download per IP adress.
How is it possible to do such thing. 
is it ? ^^

if I dare ... most simple way.

ok, thanks for your help,
see ya' on the forum

Tintin


  


--

*Leonardo de Souza Carneiro*
*Veltrac - Tecnologia em Logística.*
lscarne...@veltrac.com.br mailto:lscarne...@veltrac.com.br
http://www.veltrac.com.br http://www.veltrac.com.br/
/Fone Com.: (43)2105-5601/
/Av. Higienópolis 1601 Ed. Eurocenter Sl. 803/
/Londrina- PR/
/Cep: 86015-010/





Re: [squid-users] How to do a limit quota download on a Squid proxy

2009-07-09 Thread Leonardo Rodrigues

Leonardo Carneiro escreveu:

Hi tintin.

You can use delay pools.

tintin_vefg54e654g escreveu:


The matter is I would like to set a quota as a limit of 100Mb per day of
download per IP adress. 




   delay pools cant be used for that.

   delay pools can be used to limit transfer rates and not total transfers.

   squid cannot limit 100Mb per day, for example, with stock 
configuration. You surely can acchieve that with rewrite and external 
ACLs, but you'll have to code that or maybe found a already coded one.


   with simply configuration, you cannot achieve this kind of 
limitation (Mb transfered/day/IP). Not even with delay pools.




--


Atenciosamente / Sincerily,
Leonardo Rodrigues
Solutti Tecnologia
http://www.solutti.com.br

Minha armadilha de SPAM, NÃO mandem email
gertru...@solutti.com.br
My SPAMTRAP, do not email it






smime.p7s
Description: S/MIME Cryptographic Signature


Re: [squid-users] How to do a limit quota download on a Squid proxy

2009-07-09 Thread Leonardo Carneiro
Sorry, but why can't i use delay pools for this? Using individual 
buckets with a 100Mb size, a 0 regen rate and a 100% initial bucket 
level will not provide 100Mb of transfer at full speed and after that 
limit the speed to 0?


Leonardo Rodrigues escreveu:

Leonardo Carneiro escreveu:

Hi tintin.

You can use delay pools.

tintin_vefg54e654g escreveu:


The matter is I would like to set a quota as a limit of 100Mb per 
day of
download per IP adress. 




   delay pools cant be used for that.

   delay pools can be used to limit transfer rates and not total 
transfers.


   squid cannot limit 100Mb per day, for example, with stock 
configuration. You surely can acchieve that with rewrite and external 
ACLs, but you'll have to code that or maybe found a already coded one.


   with simply configuration, you cannot achieve this kind of 
limitation (Mb transfered/day/IP). Not even with delay pools.






--

*Leonardo de Souza Carneiro*
*Veltrac - Tecnologia em Logística.*
lscarne...@veltrac.com.br mailto:lscarne...@veltrac.com.br
http://www.veltrac.com.br http://www.veltrac.com.br/
/Fone Com.: (43)2105-5601/
/Av. Higienópolis 1601 Ed. Eurocenter Sl. 803/
/Londrina- PR/
/Cep: 86015-010/





Re: [squid-users] How to do a limit quota download on a Squid proxy

2009-07-09 Thread Leonardo Rodrigues

Leonardo Carneiro escreveu:
Sorry, but why can't i use delay pools for this? Using individual 
buckets with a 100Mb size, a 0 regen rate and a 100% initial bucket 
level will not provide 100Mb of transfer at full speed and after that 
limit the speed to 0?


   well ... at least on my delay pool understandings, it's used to 
limit transfer rates (bytes per second in fact) and not transfer totals. 
I've never played with 0 regen rate, i dont even know what you mean by 
regen rate, there's nothing documented on that, and initial bucket 
levels  maybe you're right, i've never done in that way.


   i'm used to use delay pools for transfer rates limiting, what delay 
pools are supposed to, at least by the documentations available. Never 
played with it for implementing quotas instead.



--


Atenciosamente / Sincerily,
Leonardo Rodrigues
Solutti Tecnologia
http://www.solutti.com.br

Minha armadilha de SPAM, NÃO mandem email
gertru...@solutti.com.br
My SPAMTRAP, do not email it






smime.p7s
Description: S/MIME Cryptographic Signature