v.21.7Improvement

Limit Bandwidth for Replication with New Settings in Replicated*MergeTree

Allow to limit bandwidth for replication. Add two Replicated*MergeTree settings: max_replicated_fetches_network_bandwidth and max_replicated_sends_network_bandwidth which allows to limit maximum speed of replicated fetches/sends for table. Add two server-wide settings (in default user profile): max_replicated_fetches_network_bandwidth_for_server and max_replicated_sends_network_bandwidth_for_server which limit maximum speed of replication for all tables. The settings are not followed perfectly accurately. Turned off by default. Fixes #1821. #24573 (alesapin).
Introduces settings to limit the network bandwidth used for replication in ClickHouse, allowing control over the speed of data fetches and sends during replication for both individual tables and the entire server.

Why it matters

This feature addresses the need to manage and restrict the network bandwidth consumption caused by replication processes, preventing replication traffic from overwhelming the network or other resources. It provides more predictable resource usage and helps maintain stability in environments with limited network capacity.

How to use it

Users can configure bandwidth limits by setting the new table-level parameters max_replicated_fetches_network_bandwidth and max_replicated_sends_network_bandwidth in the table settings of Replicated*MergeTree tables. Additionally, server-wide limits can be applied by configuring max_replicated_fetches_network_bandwidth_for_server and max_replicated_sends_network_bandwidth_for_server in the default user profile or other user profiles. These settings are disabled by default and should be enabled and tuned according to network capacity and replication needs.