LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Squid speed limit (https://www.linuxquestions.org/questions/linux-newbie-8/squid-speed-limit-4175590684/)

Y_Sam 10-03-2016 11:44 AM

Squid speed limit
 
Hi all,


I've configured squid3 on my Ubuntu-14.04-x86 server.
I want to limit speed limit for each ip 300kbps (i don't have a list of ips. just want to limit everyone who connects)

Also max speed for all users 5mbps

Thank you :)

bathory 10-04-2016 03:26 PM

Quote:

Originally Posted by Y_Sam (Post 5613246)
Hi all,


I've configured squid3 on my Ubuntu-14.04-x86 server.
I want to limit speed limit for each ip 300kbps (i don't have a list of ips. just want to limit everyone who connects)

Also max speed for all users 5mbps

Thank you :)

Try delay pools

szboardstretcher 10-04-2016 03:33 PM

Squid documentation on delay pools:

http://wiki.squid-cache.org/Features/DelayPools

Y_Sam 10-05-2016 12:18 AM

Quote:

Originally Posted by bathory (Post 5613898)

Quote:

Originally Posted by szboardstretcher (Post 5613902)
Squid documentation on delay pools:

http://wiki.squid-cache.org/Features/DelayPools

Thank you both :)

I've tested this its working fine.
#max speed 5mbps
delay_pools 1
delay_class 1 1
delay_access 1 allow all
delay_parameters 1 640000/640000

It's not working when I limit speed for each connection. I've tried replacing "192.168.1.0/24" with my server ip. But still struggling :(

acl only128kusers src 192.168.1.0/24
delay_pools 1
delay_class 1 3
delay_access 1 allow only128kusers
delay_access 1 deny all
delay_parameters 1 640000/640000 -1/-1 16000/640000

Please help me with that?

Y_Sam 10-12-2016 02:18 PM

anyone ?

bathory 10-13-2016 07:44 AM

Quote:

Originally Posted by Y_Sam (Post 5617141)
anyone ?

We have pointed you out that you have to use delay pools in squid. Now it's up to you to read the documentation and implement it, so squid does what you want.

If the above example doesn't work, check squid logs for errors and use your favorite search engine for a solution, or to find another howto that fits your needs.


Regards

szboardstretcher 10-13-2016 10:58 AM

Your configuration looks close. However, if you changed that IP SUBNET to your IP ADDRESS then you would only be limiting yourself. You would want to put in a SUBNET which contains the IP ADDRESSES that you want to limit. Ie:

192.168.100.0/24 or 10.0.1.0/23

Also, you changed the pool parameters to 640000, which is far more bandwidth than you think.

Y_Sam 10-15-2016 07:13 AM

Quote:

Originally Posted by bathory (Post 5617429)
We have pointed you out that you have to use delay pools in squid. Now it's up to you to read the documentation and implement it, so squid does what you want.

If the above example doesn't work, check squid logs for errors and use your favorite search engine for a solution, or to find another howto that fits your needs.


Regards

I read whole doc. I know I'm close but still unable to do it.

Quote:

Originally Posted by szboardstretcher (Post 5617500)
Your configuration looks close. However, if you changed that IP SUBNET to your IP ADDRESS then you would only be limiting yourself. You would want to put in a SUBNET which contains the IP ADDRESSES that you want to limit. Ie:

192.168.100.0/24 or 10.0.1.0/23

Also, you changed the pool parameters to 640000, which is far more bandwidth than you think.

ah that 640000 just for testing. I can change it anytime.

I want to apply these limits to everyone who connects to my server. I can't specify by ip or subnet. It can be any country. There are tons of subnets.
How could I do that?

Thank you very much for the support

bathory 10-16-2016 12:05 PM

Quote:

I want to apply these limits to everyone who connects to my server. I can't specify by ip or subnet. It can be any country. There are tons of subnets.
How could I do that?
I have never used delay-pools, but I guess you may try the following:
Code:

delay_pools 1
delay_class 1 3
delay_access 1 allow all
delay_parameters 1 640000/640000 -1/-1 16000/640000



All times are GMT -5. The time now is 02:29 PM.