From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 5DF913CB35 for ; Tue, 26 May 2020 08:50:21 -0400 (EDT) Received: by mail-lf1-x143.google.com with SMTP id d7so1060081lfi.12 for ; Tue, 26 May 2020 05:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=S4loKgGk+RapM2sN/qVHGR43pl8Rw8sjnejRSyy4FSI=; b=G3bKxpLmYUzmA5tteDN2AdhesFUxpeJxwh0t9/8ziYraS01Bn1qLPSdBZzoRehwc8u Aq8ghYO4cdBrhJGNimXulGfYHltnTMkJzWM4pPfoFz3jVT4S89iU74I4/mABE1cddDGd CE5QfRYmTIMmOVQx7VYLM2SSVoSzNiDemL85BwdJJB0hExpBFI0RhgsdInjejC3bPNhh xIbIcfRoCz8DaQ+78VwdSc59s1WxLah+aV72ZCXK8lhySweoSylBx/hB2EPxY/FDZigo LJERgSWfkou3EOYARIL/R5PiXVkH53uPHP6RrkHQM1YVztfmddH4bFKUPF96MoGAnXbR x1TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=S4loKgGk+RapM2sN/qVHGR43pl8Rw8sjnejRSyy4FSI=; b=lyklr0pK2aPnjOsklKs9B0sdL/4gft9+LN3UITCXjYI//5shesUrvGPuIsU04Qg0uK xmhkU57BZRIgGeFGmbS4KFIbnSor7L1jmMbR4AA9ikBpHkBG8dg1a14Yr/5Hep6+yy/O f3FklmmJjYJnPIJRIoLRUv0zf2dIM8eyCx1YlJh/JWcmbct9a2LW6O7U7Y3JsDKWubtd rIgFS2EV5YD16/xzwpPgs1K0Oip+aa+6FPYWZMtbQhx0dSEeDXTY03tpHYcyjP85weoK MH4bzUrCB7+qX4SHP7IlRfW7G7DuCVYivcJENz6om+9gGMgosc4FyCQYgdNIJOCH3ovi 4EJw== X-Gm-Message-State: AOAM533mV4xgWC837f34EQ8wZXMa5jeJRGU1GAGi+myKshJgDlbqaibf Iulh+I+swOzAEXz0Vq7Cycs= X-Google-Smtp-Source: ABdhPJwZ4WS6FtMBWlwMq8dl7TyFcqlotfhXH05lkfq2ilRebaOyNzmJcR15QShFWVcspey9SbbYvg== X-Received: by 2002:a19:5f5c:: with SMTP id a28mr459198lfj.98.1590497420268; Tue, 26 May 2020 05:50:20 -0700 (PDT) Received: from jonathartonsmbp.lan (83-245-237-52-nat-p.elisa-mobile.fi. [83.245.237.52]) by smtp.gmail.com with ESMTPSA id p19sm2543541lfc.91.2020.05.26.05.50.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2020 05:50:19 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.5\)) From: Jonathan Morton In-Reply-To: Date: Tue, 26 May 2020 15:50:18 +0300 Cc: bloat@lists.bufferbloat.net, marco maniezzo Content-Transfer-Encoding: quoted-printable Message-Id: <6E9DF291-4DD8-46D5-A6E0-E7917EDCD4B3@gmail.com> References: To: Jose Blanquicet X-Mailer: Apple Mail (2.3445.9.5) Subject: Re: [Bloat] CPU consumption using TC-TBF and TC-POLICE to limit rate X-BeenThere: bloat@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: General list for discussing Bufferbloat List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2020 12:50:21 -0000 > On 26 May, 2020, at 12:47 pm, Jose Blanquicet = wrote: >=20 > We have an embedded system with limited CPU resources that acts as > gateway to provide Internet access from LTE to a private Wi-Fi > network. Our problem is that the bandwidth on LTE and Wi-Fi links is > higher than what the system is able to handle thus it reaches 100% of > CPU load when we perform a simple speed test from a device connected > to our Wi-Fi Hotspot. >=20 > Therefore, we want to limit the bandwidth to avoid system gets > saturated is such use-case. To do so, we thought to use the QDISC-TBF > on the Wi-Fi interface. For instance, to have 10Mbps: >=20 > tc qdisc add dev wlan0 root tbf rate 10mbit burst 12500b latency = 50ms >=20 > It worked correctly and maximum rate was limited to 10Mbps. However, > we noticed that the CPU load added by the TBF was not negligible for > our system. Just how limited is the CPU on this device? I have successfully shaped = at several tens of Mbps on a Pentium-MMX, where the limiting factor may = have been the PCI bus rather than the CPU itself. Assuming your CPU is of that order of capability, I would suggest = installing Cake using the out-of-tree build process, and the latest = stable version of the iproute2 tools to configure it. Start with: git clone https://github.com/dtaht/sch_cake.git This provides a more efficient and more effective shaper than TBF, and a = more effective AQM than a policer, and good flow-isolation properties, = all in a single bundle that will be more efficient than running two = separate components. Once installed, the following should set it up nicely for you: tc qdisc replace dev wlan0 root cake bandwidth 10Mbit besteffort = flows ack-filter Cake is considered quite a heavyweight solution, but very effective. If = it doesn't work well for this particular use case, it may be feasible to = backport some more recent work which takes a simpler approach, though = along similar lines. - Jonathan Morton