]>
Commit | Line | Data |
---|---|---|
96ec3801 DM |
1 | .. _sysadmin_traffic_control: |
2 | ||
3 | Traffic Control | |
4 | --------------- | |
5 | ||
4954d313 | 6 | .. image:: images/screenshots/pbs-gui-traffic-control-add.png |
5565e454 | 7 | :target: _images/pbs-gui-traffic-control-add.png |
4954d313 TL |
8 | :align: right |
9 | :alt: Add a traffic control limit | |
96ec3801 | 10 | |
6481fd24 DW |
11 | Creating and restoring backups can produce a lot of traffic, can impact shared |
12 | storage and other users on the network. | |
4954d313 | 13 | |
6481fd24 | 14 | With Proxmox Backup Server, you can constrain network traffic for clients within |
4954d313 TL |
15 | specified networks using a token bucket filter (TBF). |
16 | ||
6481fd24 | 17 | This allows you to avoid network congestion and prioritize traffic from |
4954d313 TL |
18 | certain hosts. |
19 | ||
6481fd24 DW |
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 | |
4954d313 TL |
22 | tool. |
23 | ||
6481fd24 DW |
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 | |
4954d313 TL |
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: | |
96ec3801 DM |
31 | |
32 | .. code-block:: console | |
33 | ||
34 | # proxmox-backup-manager traffic-control create rule0 --network 0.0.0.0/0 \ | |
e201104d | 35 | --rate-in 100MB --rate-out 100MB \ |
96ec3801 DM |
36 | --comment "Default rate limit (100MB/s) for all clients" |
37 | ||
6481fd24 | 38 | .. note:: To limit both IPv4 and IPv6 network spaces, you need to pass two |
4954d313 TL |
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 | |
6481fd24 | 42 | company's office hours: |
4954d313 TL |
43 | |
44 | .. tip:: You can use SI (base 10: KB, MB, ...) or IEC (base 2: KiB, MiB, ...) | |
45 | units. | |
96ec3801 DM |
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 | ||
6481fd24 DW |
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: | |
96ec3801 DM |
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 \ | |
e201104d | 62 | --rate-in 20GB --rate-out 20GB \ |
96ec3801 DM |
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 | ||
6481fd24 | 67 | If there are multiple rules which match a specific network, they will all be |
4954d313 TL |
68 | applied, which means that the smallest one wins, as it's bucket fills up the |
69 | fastest. | |
70 | ||
6481fd24 | 71 | To list the current rules, use: |
96ec3801 DM |
72 | |
73 | .. code-block:: console | |
74 | ||
75 | # proxmox-backup-manager traffic-control list | |
76 | ┌───────┬─────────────┬─────────────┬─────────────────────────┬────────────...─┐ | |
77 | │ name │ rate-in │ rate-out │ network │ timeframe ... │ | |
78 | ╞═══════╪═════════════╪═════════════╪═════════════════════════╪════════════...═╡ | |
e201104d | 79 | │ rule0 │ 100 MB │ 100 MB │ ["0.0.0.0/0"] │ ["mon..fri ... │ |
96ec3801 | 80 | ├───────┼─────────────┼─────────────┼─────────────────────────┼────────────...─┤ |
e201104d | 81 | │ rule1 │ 20 GB │ 20 GB │ ["192.168.2.0/24", ...] │ ... │ |
96ec3801 DM |
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 | |
e201104d DM |
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 | └───────┴─────────────┴──────────────┘ |