[Cake] cake memory consumption

Sebastian Gottschall s.gottschall at newmedia-net.de
Tue Sep 17 01:31:04 EDT 2019


according to the output there is a flaw/bug in the memory limit calculation
cake_reconfigure     may set buffer_limit to  ~0 if no rate is set.

the following line "min(buffer_limit, max(sch->limit * 
psched_mtu(qdisc_dec(sch), q->buffer_config_limit))" doesnt make it 
better since buffer_config_limit is not configured
so we got a possible memory overuse here.

my proposal

-       q->buffer_limit = min(q->buffer_limit,
-                             max(sch->limit * psched_mtu(qdisc_dev(sch)),
-                                 q->buffer_config_limit));
+       if (q->buffer_config_limit)
+               q->buffer_limit = min(q->buffer_limit,
+                       max(sch->limit * psched_mtu(qdisc_dev(sch)), 
q->buffer_config_limit));
+       else
+               q->buffer_limit = min(q->buffer_limit,
+                       max(sch->limit * psched_mtu(qdisc_dev(sch)), 4U 
<< 20));

Am 16.09.2019 um 16:01 schrieb Toke Høiland-Jørgensen:
> Sebastian Gottschall <s.gottschall at newmedia-net.de> writes:
>
>> Am 16.09.2019 um 14:08 schrieb Toke Høiland-Jørgensen:
>>> Sebastian Gottschall <s.gottschall at newmedia-net.de> writes:
>>>
>>>> after we found out serious out of memory issues on smaller embedded
>>>> devices (128 mb ram) we made some benchmarks with different schedulers
>>>> with the result that cake takes a serious amount of memory. we use the
>>>> out of tree cake module and we use it class based since we have complex
>>>> methods of doing qos per interface, per mac addresse or even per
>>>> ip/network. so its not just simple cake on a single interface solution.
>>>> we made some benchmarks with different schedulers. does anybody have a
>>>> solution for making that better?
>>>>
>>>> HTB/FQ_CODEL ------- 62M
>>>> HTB/SFQ ------- 62M
>>>> HTB/PIE ------- 62M
>>>> HTB/FQ_CODEL_FAST ------- 67M
>>>> HTB/CAKE -------111M
>>>>
>>>> HFSC/FQ_CODEL_FAST ------- 47M
>>>> HTB/PIE ------- 49M
>>>> HTB/SFQ ------- 50M
>>>> HFSC /FQ_CODEL ------- 52M
>>>> HFSC/CAKE -------109M
>>> How are you measuring the memory usage, and what is your full config for
>>> each setup? :)
>> me? nothing. i requested this test from a reporter and he uses just free
>> / top. so there is a error tollerance.
> Ah, I see. So this is just total system memory as reported by top.
>
>> but it shows a significant difference between cake and fq_codel etc.
>> cake is doing a OOM at the end
>>
>> for the full report including config screenshots see this
>> https://svn.dd-wrt.com/ticket/6798#comment:14. it shows also the qos
>> setup which i can use to reproduce and to
>> print out the full tc ruleset if required (which it surelly is for you).
>> if you want i will recreate this setup and send the tc rules on this
>> list
> Yes, please do. The output of 'tc -s qdisc' would be useful as well to
> see how much memory CAKE itself thinks it's using...
>
> Are you setting the memory_limit in your config or relying on CAKE's
> default?
>
> -Toke
>
>


More information about the Cake mailing list