]> git.proxmox.com Git - proxmox-backup.git/blame - docs/traffic-control.rst
docs: fix some typos
[proxmox-backup.git] / docs / traffic-control.rst
CommitLineData
96ec3801
DM
1.. _sysadmin_traffic_control:
2
3Traffic Control
4---------------
5
4954d313
TL
6.. image:: images/screenshots/pbs-gui-traffic-control-add.png
7 :align: right
8 :alt: Add a traffic control limit
96ec3801 9
4954d313
TL
10Creating and restoring backups can produce lots of traffic and impact other
11users of the network or shared storages.
12
13Proxmox Backup Server allows to limit network traffic for clients within
14specified networks using a token bucket filter (TBF).
15
16This allows you to avoid network congestion or to prioritize traffic from
17certain hosts.
18
19You can manage the traffic controls either over the web-interface or using the
20``traffic-control`` commandos of the ``proxmox-backup-manager`` command-line
21tool.
22
23.. note:: Sync jobs on the server are not affected by its rate-in limits. If
c10a6755 24 you want to limit the incoming traffic that a pull-based sync job
4954d313
TL
25 generates, you need to setup a job-specific rate-in limit. See
26 :ref:`syncjobs`.
27
28The following command adds a traffic control rule to limit all IPv4 clients
29(network ``0.0.0.0/0``) to 100 MB/s:
96ec3801
DM
30
31.. code-block:: console
32
33 # proxmox-backup-manager traffic-control create rule0 --network 0.0.0.0/0 \
e201104d 34 --rate-in 100MB --rate-out 100MB \
96ec3801
DM
35 --comment "Default rate limit (100MB/s) for all clients"
36
4954d313
TL
37.. note:: To limit both IPv4 and IPv6 network spaces you need to pass two
38 network parameters ``::/0`` and ``0.0.0.0/0``.
39
40It is possible to restrict rules to certain time frames, for example the
41company office hours:
42
43.. tip:: You can use SI (base 10: KB, MB, ...) or IEC (base 2: KiB, MiB, ...)
44 units.
96ec3801
DM
45
46.. code-block:: console
47
48 # proxmox-backup-manager traffic-control update rule0 \
49 --timeframe "mon..fri 8-12" \
50 --timeframe "mon..fri 14:30-18"
51
4954d313
TL
52If there are more rules, the server uses the rule with the smaller network. For
53example, we can overwrite the setting for our private network (and the server
54itself) with:
96ec3801
DM
55
56.. code-block:: console
57
58 # proxmox-backup-manager traffic-control create rule1 \
59 --network 192.168.2.0/24 \
60 --network 127.0.0.0/8 \
e201104d 61 --rate-in 20GB --rate-out 20GB \
96ec3801
DM
62 --comment "Use 20GB/s for the local network"
63
64.. note:: The behavior is undefined if there are several rules for the same network.
65
4954d313
TL
66If there are multiple rules that match the same network all of them will be
67applied, which means that the smallest one wins, as it's bucket fills up the
68fastest.
69
96ec3801
DM
70To list the current rules use:
71
72.. code-block:: console
73
74 # proxmox-backup-manager traffic-control list
75 ┌───────┬─────────────┬─────────────┬─────────────────────────┬────────────...─┐
76 │ name │ rate-in │ rate-out │ network │ timeframe ... │
77 ╞═══════╪═════════════╪═════════════╪═════════════════════════╪════════════...═╡
e201104d 78 │ rule0 │ 100 MB │ 100 MB │ ["0.0.0.0/0"] │ ["mon..fri ... │
96ec3801 79 ├───────┼─────────────┼─────────────┼─────────────────────────┼────────────...─┤
e201104d 80 │ rule1 │ 20 GB │ 20 GB │ ["192.168.2.0/24", ...] │ ... │
96ec3801
DM
81 └───────┴─────────────┴─────────────┴─────────────────────────┴────────────...─┘
82
83Rules can also be removed:
84
85.. code-block:: console
86
87 # proxmox-backup-manager traffic-control remove rule1
88
89
90To show the state (current data rate) of all configured rules use:
91
92.. code-block:: console
93
94 # proxmox-backup-manager traffic-control traffic
e201104d
DM
95 ┌───────┬─────────────┬──────────────┐
96 │ name │ cur-rate-in │ cur-rate-out │
97 ╞═══════╪═════════════╪══════════════╡
98 │ rule0 │ 0 B │ 0 B │
99 ├───────┼─────────────┼──────────────┤
100 │ rule1 │ 1.161 GiB │ 19.146 KiB │
101 └───────┴─────────────┴──────────────┘