pcq or simple queues?

Hello,

I need to do shaping for my customers and i’m not sure what is the best approach for it. I’ve studied the forum, the wiki and so on and there are various places where is written that pcq offers higher performance (than simple queues?) and is pretty much the way to go. However, i’m not sure if it is fit for my requirements.

So… we have more customers, each customer has a subscription (upload/download/price) assigned to it and one or more computers (and ip addresses!).
simple queues work pretty good, ip-s go in targets and upload/download is shared amongst that customer’s computers fairly.
However, doing the same thing with pcq, testing shows me that if a computer is using all the available bandwidth, and we start another download on another computer from the same customer (it’s another target in the same queue) the total bandwidth exceeds the queue pcq rates.
Here is a configuration example that i’ve tested and acts this way:

/queue type
add kind=pcq name=lms_t00000000024u pcq-burst-time=1s pcq-classifier=src-address pcq-limit=15M pcq-rate=15M pcq-total-limit=15000
add kind=pcq name=lms_t00000000024d pcq-burst-time=1s pcq-classifier=dst-address pcq-limit=25M pcq-rate=25M pcq-total-limit=25000
/queue simple
add comment="customer 1" name=lms_s00000000026 queue=lms_t00000000024u/lms_t00000000024d target=192.168.0.2/32,192.168.0.3/32,192.168.0.4/32,192.168.0.5/32
add comment="customer 2" name=lms_s00000000026 queue=lms_t00000000024u/lms_t00000000024d target=192.168.0.12/32,192.168.0.13/32,192.168.0.14/32,192.168.0.15/32

Am i doing something wrong or … maybe i don’t fully understand how pcq works?
Is the performance difference worth using pcq, or isn’t too much of a difference vs simple queues?
ps. i’m testing this using a rb2011 @ 750Mhz, routing (not bridging)
Thank you

pcq is used different as other queues, it works with sub-streams.

so you can configure one upload and one download queue which is used for multiple customers. instead of having one queue per customer you have one sub-stream per customer. you can limited the bandwidth per sub-stream. sub-streams are “created” dynamically you have just to configure what is the same sub-stream.

for example:
one sub-stream per destination address (at the download pcq)
one sub-stream per source address (at the upload pcq)

if your customers have a subnet you have to configure the netmask to put multiple sources/destinations into the same sub-stream. if your customer have multiple ips and you make one sub-stream per ip each ip get it’s own limit.

i think the graphics at http://wiki.mikrotik.com/wiki/Manual:Queues_-_PCQ explain pcq quite good.

I understand that it’s possible to add let’s say a /29 network per substream, but I would like to add for example 192.168.0.2, 192.168.0.4 and .5 to one substream and 0.3, 0.6, 0.7 to another substream. Is this possible with pcq? If yes, how?

that’s not possible. if you want to do that you have to add one (simple)-queue per customer and assign the traffic with another method. i think sub-streams get internally addressed by a hash and you just configure which data is used to build the hash. the mask helps to forget the host bits. so just the network part is used build the hash therefor all traffic from/to one subnet ends with the same hash which then address always the same sub-stream.

ok, i understand now
Thank you very much :slight_smile: