Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.isp > #1526

Re: Traffic shaping on debian

From Aleksey <unite@openmailbox.org>
Newsgroups linux.debian.isp
Subject Re: Traffic shaping on debian
Date 2016-05-27 16:00 +0200
Message-ID <rDqsW-49M-3@gated-at.bofh.it> (permalink)
References <rDor8-2Tz-5@gated-at.bofh.it> <rDoUa-3jS-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2016-05-27 14:48, Dmitry Sinina wrote:
> On 05/27/2016 02:40 PM, Aleksey wrote:
>> Hi guys!
>> 
>> I have a debian box acting as a router and need a tool to perform 
>> traffic shaping based on source/destination IPs, interfaces, etc. I 
>> have tried the default tc, however, it uses plenty of resources, e.g. 
>> 600 mbps without shaping flows through with 3% cpu load and the same 
>> 600mbps with shaping (tc
>> using htb on egress interface) consumes something like 40% cpu.
>> 
>> Probably someone could advise some kind of a tool to do such shaping 
>> with minimum resources consumed - I've searched through the web and 
>> found a module named nf-hishape, however, I didn't manage to find some 
>> reasonably high number of articles about it as well as no manuals and 
>> so on - I guess it's
>> not very popular (if it's actually alive).
>> 
>> Any help would be appreciated.
>> 
>> Thanks in advance.
>> 
> Hi.
> 
> Seems you use flat list of filters. How many filters you have?
> Did you try hash tables for traffic classification?

Hi.

Practically, I haven't done any configuration on my production router - 
I have performed tests in lab environment. Configuration was pretty 
simple:

tc qdisc add dev eth1 root handle 1: htb default 30
tc class add dev eth1 parent 1: classid 1:1 htb rate 1000mbps ceil 
1000mbps
tc class add dev eth1 parent 1:1 classid 1:10 htb rate 3mbps ceil 5mbps
tc class add dev eth1 parent 1:1 classid 1:20 htb rate 5mbps ceil 7mbps
tc class add dev eth1 parent 1:1 classid 1:30 htb rate 1mbps ceil 
1000mbps
tc qdisc add dev eth1 parent 1:10 handle 10:0 sfq perturb 10
tc qdisc add dev eth1 parent 1:20 handle 20:0 sfq perturb 10
tc qdisc add dev eth1 parent 1:30 handle 30:0 sfq perturb 10
tc filter add dev eth1 protocol ip parent 1:0 prio 1 u32  match ip dport 
443 0xffff flowid 1:20
tc filter add dev eth1 protocol ip parent 1:0 prio 1 u32  match ip dport 
80 0xffff flowid 1:10

So after applying it I tried to push some traffic through this lab box 
using iperf. When performing test on ports 80/443 (limited to low 
bandwidth) - CPU load was ok, however when I pushed unrestricted traffic 
(1000 mbps limit) I noticed high CPU usage. I tried setting up filters 
based on fwmark but the result was the same. I'm using debian 7 with 
3.16 kernel installed from wheezy-backports, if it is important.

If some additional info (firewall config, etc) is needed, please ask.

-- 
With kind regards,
Aleksey

Back to linux.debian.isp | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Traffic shaping on debian Aleksey <unite@openmailbox.org> - 2016-05-27 13:50 +0200
  Re: Traffic shaping on debian Mihamina RAKOTOMANDIMBY <mihamina@rktmb.org> - 2016-05-27 14:00 +0200
  Re: Traffic shaping on debian Dmitry Sinina <dmitry.sinina@onat.edu.ua> - 2016-05-27 14:20 +0200
    Re: Traffic shaping on debian Aleksey <unite@openmailbox.org> - 2016-05-27 16:00 +0200
      Re: Traffic shaping on debian lxP <lxp@davizone.at> - 2016-05-27 18:30 +0200
        Re: Traffic shaping on debian lxP <lxp@davizone.at> - 2016-05-28 13:00 +0200
      Re: Traffic shaping on debian Martin Kraus <lists_mk@wujiman.net> - 2016-05-28 17:30 +0200
        Re: Traffic shaping on debian Aleksey <unite@openmailbox.org> - 2016-05-30 13:00 +0200
          Re: Traffic shaping on debian Martin Kraus <lists_mk@wujiman.net> - 2016-05-30 17:40 +0200
            Re: Traffic shaping on debian Aleksey <unite@openmailbox.org> - 2016-06-01 09:30 +0200
              Re: Traffic shaping on debian Raúl Alexis Betancor Santana <rabs@dimension-virtual.com> - 2016-06-01 11:30 +0200

csiph-web