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