]> git.proxmox.com Git - proxmox-backup.git/blob - docs/traffic-control.rst
93f10b6164ddb3a2b5e336cafc2ebab86076aa43
[proxmox-backup.git] / docs / traffic-control.rst
1 .. _sysadmin_traffic_control:
2
3 Traffic Control
4 ---------------
5
6 .. image:: images/screenshots/pbs-gui-traffic-control-add.png
7 :align: right
8 :alt: Add a traffic control limit
9
10 Creating and restoring backups can produce lots of traffic and impact other
11 users of the network or shared storages.
12
13 Proxmox Backup Server allows to limit network traffic for clients within
14 specified networks using a token bucket filter (TBF).
15
16 This allows you to avoid network congestion or to prioritize traffic from
17 certain hosts.
18
19 You can manage the traffic controls either over the web-interface or using the
20 ``traffic-control`` commandos of the ``proxmox-backup-manager`` command-line
21 tool.
22
23 .. note:: Sync jobs on the server are not affected by its rate-in limits. If
24 you want to limit the incomming traffic that a pull-based sync job
25 generates, you need to setup a job-specific rate-in limit. See
26 :ref:`syncjobs`.
27
28 The following command adds a traffic control rule to limit all IPv4 clients
29 (network ``0.0.0.0/0``) to 100 MB/s:
30
31 .. code-block:: console
32
33 # proxmox-backup-manager traffic-control create rule0 --network 0.0.0.0/0 \
34 --rate-in 100MB --rate-out 100MB \
35 --comment "Default rate limit (100MB/s) for all clients"
36
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
40 It is possible to restrict rules to certain time frames, for example the
41 company office hours:
42
43 .. tip:: You can use SI (base 10: KB, MB, ...) or IEC (base 2: KiB, MiB, ...)
44 units.
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
52 If there are more rules, the server uses the rule with the smaller network. For
53 example, we can overwrite the setting for our private network (and the server
54 itself) with:
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 \
61 --rate-in 20GB --rate-out 20GB \
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
66 If there are multiple rules that match the same network all of them will be
67 applied, which means that the smallest one wins, as it's bucket fills up the
68 fastest.
69
70 To 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 ╞═══════╪═════════════╪═════════════╪═════════════════════════╪════════════...═╡
78 │ rule0 │ 100 MB │ 100 MB │ ["0.0.0.0/0"] │ ["mon..fri ... │
79 ├───────┼─────────────┼─────────────┼─────────────────────────┼────────────...─┤
80 │ rule1 │ 20 GB │ 20 GB │ ["192.168.2.0/24", ...] │ ... │
81 └───────┴─────────────┴─────────────┴─────────────────────────┴────────────...─┘
82
83 Rules can also be removed:
84
85 .. code-block:: console
86
87 # proxmox-backup-manager traffic-control remove rule1
88
89
90 To show the state (current data rate) of all configured rules use:
91
92 .. code-block:: console
93
94 # proxmox-backup-manager traffic-control traffic
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 └───────┴─────────────┴──────────────┘