dtaht / sch_cake

Out of tree build for the new cake qdisc
100 stars 35 forks source link

Per Tin traffic measurement #128

Closed ldir-EDB0 closed 4 years ago

ldir-EDB0 commented 4 years ago

Hi All,

A question more than a problem: Is there a way to produce a rate of traffic type stat per tin? I know I can get 'bytes sent per tin' out of tc -s but that doesn't directly tell me how much data has gone through a tin since the last sample.

I did a quick & dirty 'subtract last value from current value' type display but I'm wondering if there's something more elegant possible within the existing tin variables.?

tohojo commented 4 years ago

Kevin Darbyshire-Bryant notifications@github.com writes:

Hi All,

A question more than a problem: Is there a way to produce a rate of traffic type stat per tin? I know I can get 'bytes sent per tin' out of tc -s but that doesn't directly tell me how much data has gone through a tin since the last sample.

I did a quick & dirty 'subtract last value from current value' type display but I'm wondering if there's something more elegant possible within the existing tin variables.?

Nah, rate is just 'bytes over time', so subtracting works fine. There are a couple of optimisations you can do to get more precise polling, such as not spawning a new TC process every time[0], and using timerfds. See https://github.com/tohojo/flent/blob/master/misc/tc_iterate.c for an example.

[0] This may be broken in newer tc versions, actually, don't quite recall.

ldir-EDB0 commented 4 years ago

Excellent, thanks for the pointer :-)

dtaht commented 4 years ago

the tc_iterate.c tc -b - mode got broken a year or two back. There's a github thread somewhere trying to fix it.

Kevin Darbyshire-Bryant notifications@github.com writes:

Excellent, thanks for the pointer :-)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.