From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) (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 409863CB35 for ; Tue, 26 May 2020 10:42:49 -0400 (EDT) Received: by mail-lj1-x235.google.com with SMTP id l15so24467948lje.9 for ; Tue, 26 May 2020 07:42:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Vf9hrlXadSMiD48M6WUza6Pht7LpU5oSTPR8ZRLG9tE=; b=KSDYyw8ls9GM3Qd/muocCabzEfrveUEv/N8yreCl467DWfK1k9/TIA64C2kjyQU2n3 O1yEGR7ejcxoYqDzyWQCaghalLwhm6nKc1jLaR9TW2VR8sEtgfw2jGoT70Fi2zyzkT9E L7AfFCNCmiRbzspfZakc06v/sH1sHyApJbxXZDt5CSzDlbftnZ3StXl4UhiMtgJgDaiS zbv4/wzFJHzRCR0aTWEWECv5qqNmNBa/5pOGErFZ61vQHHJQhAoGko+P9GL08N+aEW40 LGsPX+rS8fS6SaT3oAg2kont9ZJzJKVva0/XJbPj0yi3XQSGRNUjTvZm2qB2SwY3kSbF Q2Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Vf9hrlXadSMiD48M6WUza6Pht7LpU5oSTPR8ZRLG9tE=; b=ooR21KBxTep1s6YspmsbFTH6krPFz/wA8muDYwPYsjCVXqXJ/HVumUnkzvuxF3niHi RzHww2Kj8nOQGLeYWF9gfV5PnbdO8Cce2KG0UV/jsioVQP/BxVwwbaajvZ0wnwObOAtV zLxJ6cL1NI4wtakJ012Nu3kAXoTqKfJ2RJ8QCf0PXihylII3a6U9cjghCInwTLEsuosS Ub+31DUy4KsBiY4hZ04bftM8moNRX+fb7hJrnN5ZpO8Rl/osi/hstsZIvj1Sz/yMp/SU 6IXTki8TV8QZVD8BFvzUqzfDMSngZMkDNuICIa1Suf2wtvOAsyeiR8eBIVGe3U7+TiXb 0n4Q== X-Gm-Message-State: AOAM5302CBdMh7K5n0PXYSFcVXMkjVtmiHN7RRUJczTTLVJNCkvA6ARb dH7N8b9/UHrAMNBZhPy4HNmxbQCe9s/noIrVE3c= X-Google-Smtp-Source: ABdhPJwXAfkcwutgymxu0PQCi0tMATQr652N6fTNYTQ/VXSjS4AkeRFHEA2bb8HBO0ou91dh874RjrsVuRD+ctcrV0A= X-Received: by 2002:a2e:9792:: with SMTP id y18mr756257lji.389.1590504168136; Tue, 26 May 2020 07:42:48 -0700 (PDT) MIME-Version: 1.0 References: <6E9DF291-4DD8-46D5-A6E0-E7917EDCD4B3@gmail.com> In-Reply-To: <6E9DF291-4DD8-46D5-A6E0-E7917EDCD4B3@gmail.com> From: Jose Blanquicet Date: Tue, 26 May 2020 16:42:11 +0200 Message-ID: To: Jonathan Morton Cc: bloat@lists.bufferbloat.net, marco maniezzo Content-Type: text/plain; charset="UTF-8" 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 14:42:49 -0000 Hi Jonathan, Thanks for the response. On Tue, May 26, 2020 at 2:50 PM Jonathan Morton wrote: > > On 26 May, 2020, at 12:47 pm, Jose Blanquicet wrote: > > > > 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. > > > > 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: > > > > tc qdisc add dev wlan0 root tbf rate 10mbit burst 12500b latency 50ms > > > > 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. We have just a percentage of an ARM Cortex A7 (1.2GHz) because the rest is reserved for modem. We are now trying to optimize all the applications in the system but LTE<->WIFI data transfer is indeed the use-case that puts our system in crisis. > 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. Interesting, we will have a look at this and do some test to see how it behaves in our "particular" environment. Thanks, Jose