Giter Site home page Giter Site logo

qosstats's Introduction

qosstats and wshaper

  • qosstats displays QoS statistics from Linux TC in a summary table.
  • wshaper is a heavily customised version of the WonderShaper QoS script.

qosstats

You can use this utility to display the traffic rates and other salient details of QoS queues in an easy-to-read table form. For example:

[chris@microserver qosstats]$ ./qosstats eth0
eth0
Class Paren Prio  Rate     Ceil  Burst      Sent  Dropped  Backlog   kbps  Pps
==============================================================================
1:1   -     -   100000   100000    6Kb     18372        0    0b/0p   1187  116
1:10  1:1   -    14400    14400    6Kb     18372        0    0b/0p   1187  116
1:11  1:1   0   100000   100000    6Kb         0        0    0b/0p      -    -
1:110 1:10  1     3600    14400    6Kb      2907        0    0b/0p     10   19
1:120 1:10  2        0    14400    2Kb         0        0    0b/0p      -    -
1:130 1:10  3        0     9000    2Kb     15465        0    0b/0p   1176   98
1:140 1:10  3        0     4500    2Kb         0        0    0b/0p      -    -

This tells you that:

  • 1:1 is the root class
  • 1:10 and 1:11 descend from it
  • 1:11 has a much higher bandwidth limit (100 MBps, probably local traffic)
  • 1:10 has four classes under it: 1:110 to 1:140
  • 1:110 has a the highest priority (1), a guaranteed rate of 3.6 MBps, and maximum rate of 14.4 MBps.
  • 1:110 has a current rate of 10 kbps and 19 pps.

This is a typical traffic class layout generated by a wshaper script such as the included one, where 1:110 is used for highest-priority Internet traffic (pings and VoIP) and 1:140 is the lowest priority (backups).

You can watch the statistics live using the watch command:

watch qosstats eth0

Watching the external interface (eth0 in this case) only shows queue status for uploaded traffic. Be sure to monitor the inside interface for downloaded traffic as well.

wshaper

You can use this utility to generate queues on the internal and external interfaces, to monitor and prioritise traffic according to your needs. The script is an example and you will need to customise it.

You will need to set DDEV and UDEV to your downlink (inside) and uplink (outside) devices respectively.

Then set DOWNLINK and UPLINK to about half the bandwidth that you expect to get, and play with them while downloading and uploading large amounts until you get good responsiveness to pings (low latency). You'll need to rerun the wshaper script after every change. watch the output of qosstats and a ping while you do it.

Typically you would get that at 60-80% of maximum capacity, depending on how your connection works. Getting closer to your theoretical maximum is likely to increase delays of all traffic; reducing limits reduces the worst-case delays while also reducing your maximum download and upload speed; therefore you have to choose your tradeoff carefully to suit your needs.

Tests done on the firewall itself will not reveal the effects of traffic shaping on the inside interface DDEV, so you will need to control a computer behind the firewall, both for traffic generation and measurement, to conduct these tests.

The script demonstrates:

  • Querying a pmacct SQL database for traffic downloaded and uploaded by each host over a period, and severely restricting or blocking hosts that exceed their quotas.

  • Using different quotas at different times of day (thanks Virgin Media).

  • Using the iptables CLASSIFY target to set QoS classes for traffic, instead of the tc filter command.

  • Classifying based on protocol (e.g. ICMP), source and destination hosts and ports, and TOS (type of service) flags.

  • Using different queues with different priorities and limits for ICMP (pings), web, interactive SSH and backups over SSH.

  • Using HTB to fairly share bandwidth between classes.

  • Using SFQ to fairly share bandwidth between individual connections within a class.

qosstats's People

Contributors

qris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.