Community discussions

MikroTik App
 
jonathandick
just joined
Topic Author
Posts: 18
Joined: Fri Feb 10, 2017 12:26 pm
Location: Kenya

Limiting Max bandwidth per user in a queue

Wed Mar 01, 2017 3:06 am

Hello, we've set up set up simple queues for each VLAN on our network after upgrading to a CCR. This has added a lot of stability to our network but we now have a problem where individuals within the queue max out the allocated bandwidth. Is there a way to set a limit within the queue such that no user can consume more than a set amount? For example, say we have a 5 MB / 5 MB queue. Can we set it so that no user within the queue can ever use more than 1 MB / 1 MB? Note that we'd like this to apply to all users within the queue, not to set an individual rule for a particular ip/MAC.

Thanks for your help.
 
User avatar
dgnevans
Member
Member
Posts: 469
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: Limiting Max bandwidth per user in a queue

Wed Mar 01, 2017 4:47 am

You can create queue types pcq and set upload and download limits. Apply these to your simple queues. Set the max limit for the queue to 5mb up down.
/queue type
add kind=pcq name=pcq-upload-1M pcq-classifier=src-address pcq-rate=1M pcq-total-limit=4000KiB
add kind=pcq name=pcq-down-1M pcq-burst-time=8s pcq-classifier=dst-address pcq-rate=1M pcq-total-limit=4000KiB
/queue simple
add max-limit=5M/5M name=Subnet queue=pcq-upload-1M/pcq-down-1M target=192.168.1.0/24
I would also create a parent queue and set the maximum bandwidth for that queue to the maximum your link can pass. if you do this you can drop the max limit for each inidividual queue unless you want to limit that vlan to max 5m
 
jonathandick
just joined
Topic Author
Posts: 18
Joined: Fri Feb 10, 2017 12:26 pm
Location: Kenya

Re: Limiting Max bandwidth per user in a queue

Wed Mar 01, 2017 5:47 am

@dgnevans, thanks for the quick response. This seems to be what we need.

A question: If a VLAN has a simple queue set to 5 MB / 5 MB, what is the point of then setting pcq-total-limit=4000KiB in the pcq definition? Will that total limit be constrained by the 5MB on the simple queue? Is it necessary to set the pcq-total-limit at all if the simple queue as a upload/download rate set?
 
User avatar
dgnevans
Member
Member
Posts: 469
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: Limiting Max bandwidth per user in a queue

Wed Mar 01, 2017 6:07 am

Dont confuse pcq-total-limit to the simple queue total limit. pcq-total-limit refers to the Total queue size of all sub-streams (in kilobytes) Each queue is 50 KB by default I set the total queue at 4000 KB this means that there can be up to 80 queues before the Queue limit is reached and packets are dropped. Basically if you are limited at 1 mb packets are delayed and placed in queue. when this queue is full traffic will be dropped. by packets being delayed or dropped computer device throttles connection. when the max limit for the simple queue is reached packets will be queued or if queue is full will be dropped. It is described quite well here. viewtopic.php?t=14269
 
jonathandick
just joined
Topic Author
Posts: 18
Joined: Fri Feb 10, 2017 12:26 pm
Location: Kenya

Re: Limiting Max bandwidth per user in a queue

Wed Mar 01, 2017 7:45 am

Thanks for the clarification.

Is this 4000 kb limit per queue? per request? per ip?

Say I have a vlan with 10 users and an allocation of 5Mb/5Mb in the simple queue, and say all 10 users are downloading large files at the same time, what will this look like with regards to the pcq's if configured the way you describe?
 
User avatar
dgnevans
Member
Member
Posts: 469
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: Limiting Max bandwidth per user in a queue

Wed Mar 01, 2017 9:21 am

4000KB is per queue ie simple queue. So if each users individual queue = 50KB you can have a maximum of 80 users downloading or uploading at one time. So the 10 users all downloading a file each will be limited to 10% of the 5 mbps +- 500kbps each. Once a user fills there individual queue of 50KB packets will be dropped. This will cause the device to send less packets there by throttling the connection.
Statistics will look something like this.
name="Vlan24" target=172.17.24.0/24 rate=260.1kbps/1989.3kbps total-rate=0bps packet-rate=210/237 total-packet-rate=0 queued-bytes=0/53105 total-queued-bytes=0 queued-packets=0/49 
      total-queued-packets=0 bytes=28190420918/196644144073 total-bytes=0 packets=139987984/168596625 total-packets=0 dropped=87332/12665349 total-dropped=0 pcq-queues=15/16
This Simple queue is limiting each person in VLAN 24 to a PCQ of 1.5 mbps down. as you can see there are 15 queues (15 devices) on the upload and 16 queues (16 devices) on the download and you can see the dropped packets.

Who is online

Users browsing this forum: GoogleOther [Bot], Grumpy, holvoetn, Jörg and 53 guests