From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from webmail.newmedia-net.de (smtps.newmedia-net.de [IPv6:2a05:a1c0:0:de::167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id DBA1F3B2A4 for ; Tue, 17 Sep 2019 05:56:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=newmedia-net.de; s=mikd; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject; bh=HYvHxKgsqjvU7i9UkxV5y+DHff0BvJj2wQ0zgCsm5Ow=; b=QIwi6i/6IvMhQdmeA/NNIA5o1nWtVLLdGAFArhEofuYmQ+Qog0WOnwNFSxrBS/Q4eg3ePNxQbu3bH/yEJhn+BEaK1TS+GPiS/cB2d34HUatqjJihxjGWpqBWIzbMLi8de7rDjQh3jVvLAuGjrOI1B5d7Y+j35twuR5sKLSMjh0g=; To: Jonathan Morton Cc: =?UTF-8?Q?Toke_H=c3=b8iland-J=c3=b8rgensen?= , cake@lists.bufferbloat.net References: <2825CE14-2109-4580-A086-9701F4D3ADF0@gmail.com> <18b1c174-b88d-4664-9aa8-9c42925fc14c@www.fastmail.com> <9a90111b-2389-4dc6-8409-18c40f895540@www.fastmail.com> <43F02160-E691-4393-A0C0-8AB4AD962700@gmail.com> <057ea708-6797-23f5-ef01-9d3d7b002578@newmedia-net.de> <878sqomoj4.fsf@toke.dk> <87h85cl4qk.fsf@toke.dk> <65e68948-6464-23ac-5df0-91735fc298af@newmedia-net.de> <44AD9976-DC81-47F7-BBB3-0D884C880A29@gmail.com> From: Sebastian Gottschall Message-ID: Date: Tue, 17 Sep 2019 11:55:08 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <44AD9976-DC81-47F7-BBB3-0D884C880A29@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Received: from [212.111.244.1] (helo=[172.29.0.186]) by webmail.newmedia-net.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.72) (envelope-from ) id 1iAAE7-00073L-7C; Tue, 17 Sep 2019 11:56:51 +0200 Subject: Re: [Cake] cake memory consumption X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 09:56:46 -0000 Am 17.09.2019 um 11:21 schrieb Jonathan Morton: >> On 17 Sep, 2019, at 8:31 am, Sebastian Gottschall wrote: >> >> 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. > In C, ~0 means "as near to infinity as an unsigned integer can get", or effectively 4GB. That construct is used to get that part of the calculation out of the way, so that it has no effect in the following nested max() and min() macros. > > What actually happens here is that the "packet limit" property of the interface becomes governing, and is recalculated in terms of a byte count by multiplying it by the MTU. So the limit configured for each Cake instance in your particular case is 15MB, corresponding to 10,000 packets: > >> memory used: 0b of 15140Kb > With so many Cake instances loaded (very much *not* the normal configuration!) and only 128MB total RAM, 15MB is obviously too high a limit to be completely safe - even though Cake's AQM action will keep the *average* queue depth well below that limit. > > The correct fix here is not to change the code, but to use the memlimit parameter to override the default. These unusual configurations, where the default logic breaks, are precisely why it was added. okay. so i will handle it custom in my code depending on the device memory > > - Jonathan Morton > >