Per-query/per-server throttling for remote IO/local IO/BACKUPs#48242
Per-query/per-server throttling for remote IO/local IO/BACKUPs#48242robot-clickhouse merged 14 commits intoClickHouse:masterfrom
Conversation
|
There was a problem hiding this comment.
Looks very good. But I'm still a little bit worried about disabling native copy even for files and disks because I'm not closely familiar with this code. Let's ask for some help with this case from @vitlibar.
Vitaly, here is the place, where native copy is disabled for files with throttler enabled (also note, the same logic applies for Disk in this PR). Might it lead to a degradation of backup in some corner cases?
|
4248aff to
c8da660
Compare
Right now those two settings are applied only at start: - max_remote_read_network_bandwidth_for_server - max_remote_write_network_bandwidth_for_server Signed-off-by: Azat Khuzhin <[email protected]>
This will be required later, for per-query bandwidth limiting. Signed-off-by: Azat Khuzhin <[email protected]>
Controlled with: - max_remote_read_network_bandwidth - max_remote_write_network_bandwidth Signed-off-by: Azat Khuzhin <[email protected]>
Server settings: - max_local_read_bandwidth_for_server - max_local_write_bandwidth_for_server Query settings: - max_local_read_bandwidth - max_local_write_bandwidth This is the preparation for adding ability to throttle BACKUPs Signed-off-by: Azat Khuzhin <[email protected]>
Server settings: - backup_read_bandwidth_for_server - backup_write_bandwidth_for_server Query settings: - backup_read_bandwidth - backup_write_bandwidth Signed-off-by: Azat Khuzhin <[email protected]>
There is no need in separate read/write throttling, because you cannot write faster then read anyway, and plus this makes the code less cleaner (and also it will allow avoid implementing throttling backups to S3, since it does not use common S3 writer). Signed-off-by: Azat Khuzhin <[email protected]>
Signed-off-by: Azat Khuzhin <[email protected]>
$ yes | head | clickhouse-obfuscator --structure 'id String' --seed foo --input-format TSV --output-format TSV
Poco::Exception. Code: 1000, e.code() = 0, Null pointer: _pInstance in file "/src/ch/clickhouse/base/poco/Util/include/Poco/Util/Application.h", line 446, Stack trace (when copying this message, always include the lines below):
0. /src/ch/clickhouse/contrib/llvm-project/libcxx/include/exception:134: std::exception::capture() @ 0x15605622 in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
1. /src/ch/clickhouse/contrib/llvm-project/libcxx/include/exception:112: std::exception::exception[abi:v15000]() @ 0x156055ed in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
2. /src/ch/clickhouse/base/poco/Foundation/src/Exception.cpp:27: Poco::Exception::Exception(String const&, int) @ 0x2ebd2d80 in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
3. /src/ch/clickhouse/base/poco/Foundation/src/Exception.cpp:132: Poco::LogicException::LogicException(String const&, int) @ 0x2ebd3667 in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
4. /src/ch/clickhouse/base/poco/Foundation/src/Exception.cpp:134: Poco::NullPointerException::NullPointerException(String const&, int) @ 0x2ebd3da7 in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
5. /src/ch/clickhouse/base/poco/Foundation/src/Bugcheck.cpp:42: Poco::Bugcheck::nullPointer(char const*, char const*, int) @ 0x2ebc5851 in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
6. /src/ch/clickhouse/base/poco/Util/include/Poco/Util/Application.h:446: Poco::Util::Application::instance() @ 0x1ee3e6cd in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
7. /src/ch/clickhouse/src/Interpreters/Context.cpp:358: DB::ContextSharedPart::ContextSharedPart() @ 0x263b0cca in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
8. /src/ch/clickhouse/contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:714: std::__unique_if<DB::ContextSharedPart>::__unique_single std::make_unique[abi:v15000]<DB::ContextSharedPart>() @ 0x26387b6e in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
9. /src/ch/clickhouse/src/Interpreters/Context.cpp:652: DB::Context::createShared() @ 0x26361a3c in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
10. /src/ch/clickhouse/programs/obfuscator/Obfuscator.cpp:1293: mainEntryClickHouseObfuscator(int, char**) @ 0x1ef6eb26 in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
11. /src/ch/clickhouse/programs/main.cpp:481: main @ 0x155e569a in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
12. ? @ 0x7ffff7dd2790 in ?
13. __libc_start_main @ 0x7ffff7dd284a in ?
14. _start @ 0x155e51ae in /src/ch/clickhouse/.cmake-debug/programs/clickhouse
(version 23.3.1.2537)
Signed-off-by: Azat Khuzhin <[email protected]>
…r_server Signed-off-by: Azat Khuzhin <[email protected]>
Signed-off-by: Azat Khuzhin <[email protected]>
Signed-off-by: Azat Khuzhin <[email protected]>
…py() Signed-off-by: Azat Khuzhin <[email protected]>
Signed-off-by: Azat Khuzhin <[email protected]>
Signed-off-by: Azat Khuzhin <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Per-query/per-server throttling for remote IO/local IO/BACKUPs (server settings:
max_remote_read_network_bandwidth_for_server,max_remote_write_network_bandwidth_for_server,max_local_read_bandwidth_for_server,max_local_write_bandwidth_for_server,max_backup_bandwidth_for_server, settings:max_remote_read_network_bandwidth,max_remote_write_network_bandwidth,max_local_read_bandwidth,max_local_write_bandwidth,max_backup_bandwidth)Documentation entry for user-facing changes
Previously it was possible to throttle only network and only globally.
This PR adds ability to throttle not only globally, but on a per-query basis.
Also ability to throttle local IO had been added (this is required for throttling BACKUPs), and also, what was the main purpose of this PR - throttle BACKUPs.
BACKUPs can eat all IO (even with
backup_threads=1), and so the queries will be affected, and this does not allow to do BACKUPs on a running server.