Community discussions

MikroTik App
 
itfutura
newbie
Topic Author
Posts: 32
Joined: Tue May 22, 2007 1:25 pm
Location: Poland
Contact:

PCQ and memoru usage

Sun Nov 09, 2008 11:38 am

Hi,

When I use PCQ queues it is normal PCQ uses RAM memory. Qyestion to support:

is
/sys res pri
shows free memory with PCQ buffers or without?

Second Q:

PCQ creates one sub-stream per IP when classifier is dst-ip. What is lifetime of the sub-stream when the IP stops generate traffic? Is sub-stream die momentarily or not?

Third:

If I set total-limit=2000 and limit=50 in PCQ queue, PCQ can create only 40 sub-streams. Such PCQ queue uses ~4,4MB of RAM. I don't know all 4,4MB of RAM is allocated for PCQ queue at start usage this queue? Does ROS free memory when PCQ queue is free of traffic or keep RAM allocated?

My questions are pointed to proper tweak limit, total-limit parameters and its memory usage.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: PCQ and memoru usage

Sun Nov 09, 2008 8:55 pm

1. 'free memory' means 'not used memory', free of buffers and any other data
2. it seems like empty buffers do not occupy router's memory
3. 'If I set total-limit=2000 and limit=50 in PCQ queue, PCQ can create only 40 sub-streams' - No. It may create 1000 substreams with 2 packets in each one. 50 is maximum number of packets. after that packets are not queued but dropped
 
itfutura
newbie
Topic Author
Posts: 32
Joined: Tue May 22, 2007 1:25 pm
Location: Poland
Contact:

Re: PCQ and memoru usage

Mon Nov 10, 2008 11:01 am

AD.3. What about Janism document http://mum.mikrotik.com/presentations/US08/janism.pdf?
He say on page 26 how to calculate substreams. I mean substream is a queue per IP in case classifier is dst-ip or src-ip. Is it?
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: PCQ and memoru usage

Mon Nov 10, 2008 6:54 pm

substream is a queue per IP in case classifier is dst-ip or src-ip. Is it?
yes, that's true. what's unusual?..
 
itfutura
newbie
Topic Author
Posts: 32
Joined: Tue May 22, 2007 1:25 pm
Location: Poland
Contact:

Re: PCQ and memoru usage

Mon Nov 10, 2008 9:47 pm

Unusual for me is how you calculated 1000 substreams in opposite to Janism's calculation. I'm sure you have read it already. Janism's document shows how to calculate substreams:

'number of substreams'=total-limit / limit

In this case it is 2000/50=40 - not so complicated equation ;)

You told there are 1000 substreams. I don't understand. Can you explain your point of view?
 
digicomtech
Frequent Visitor
Frequent Visitor
Posts: 77
Joined: Fri Apr 20, 2007 5:03 pm
Location: Alma, Qc, Canada
Contact:

Re: PCQ and memoru usage

Mon Nov 10, 2008 10:04 pm

He use "may", so it mean that it could be 2 packets per sub-stream so you will have 1000 sub-stream. 50 is just the maximum number of packet per sub-stream.

Example:
PCQ on 4 differents dst-ip

192.168.1.10 : 50 packets
192.168.1.20: 50 packets
192.168.1.30: 50 packets
192.168.1.40: 50 packets
-------------------------
Total: 200 packets

There is place for 1800 packets, so theorically 1800 sub-stream of 1 packet or 900 of 2 packets or 90 of 20 packets, etc.

In the worst case (each dst-ip receive 50 packets), you will have 40 sub-stream.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: PCQ and memoru usage

Mon Nov 10, 2008 10:30 pm

Janism's document shows how to calculate substreams:

'number of substreams'=total-limit / limit
is this your interpretation of his words 'It can take only 40 users to fill the queue'? yes, it can... if each user will occupy 50 places in his queue. but it's rare case, so if every of your 100 users will use 10 packets queue, overall length will be 100*10=1000 packets, so additional packets need to be queued will be queued, still not dropped =)
 
itfutura
newbie
Topic Author
Posts: 32
Joined: Tue May 22, 2007 1:25 pm
Location: Poland
Contact:

Re: PCQ and memoru usage

Mon Nov 10, 2008 11:02 pm

Understood very clearly. Thank You guys.

I have one another question. What PCQ will do in this scenario:

address-list - contain 2000 IPs
I create PCQ queue with those parameters:
classifier - src-address (from address-list via mangle)
limit=50
total-limit=1000

All 2000 IPs are active (theoretically) and doing his job all the time.

PCQ in this scenario can create max 1000 substreams with 1 packet per subs and 1000 IPs can do job and another 1000 IPs will wait for free resources OR will PCQ hang due to no more space for create substream?

Maybe my questions are stupid for you but I have problem and trying to find solution.
 
User avatar
macgaiver
Forum Guru
Forum Guru
Posts: 1768
Joined: Wed May 18, 2005 5:57 pm
Location: Sol III, Sol system, Sector 001, Alpha Quadrant

Re: PCQ and memoru usage

Tue Nov 11, 2008 10:03 am

Answer is simple - you will see a lots of packet drops
 
itfutura
newbie
Topic Author
Posts: 32
Joined: Tue May 22, 2007 1:25 pm
Location: Poland
Contact:

Re: PCQ and memoru usage

Wed Nov 12, 2008 9:37 am

In theory i'm able to agree. But have you ever test such PCQ behavior? I just want to know your opinion is not clear theory but experience from working PCQ implementations.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: PCQ and memoru usage

Wed Nov 12, 2008 12:19 pm

from Janis presentation:
There must be at least 10-20 packet places in queue available per user
so do not do such short queues for such huge address lists!

it's abnormal
 
digicomtech
Frequent Visitor
Frequent Visitor
Posts: 77
Joined: Fri Apr 20, 2007 5:03 pm
Location: Alma, Qc, Canada
Contact:

Re: PCQ and memoru usage

Mon Nov 17, 2008 6:59 pm

You should analyse traffic to see how much packet per second (per IP if you really want to be sure) you've got. Then give a try with your PCQ and watch for the dropped parameter of the queue. If the dropped parameter si not zero then limit or max-limit is insuffisant. You must determinate which one by monitoring in huge traffic period.

Who is online

Users browsing this forum: Bing [Bot], epanig and 53 guests