mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-28 10:41:12 +00:00
s3_client: track memory starvation in background filling fiber
Introduce a counter metric to monitor instances where the background filling fiber is blocked due to insufficient memory in the S3 client. Closes scylladb/scylladb#26466
This commit is contained in:
committed by
Pavel Emelyanov
parent
125bf391a7
commit
413739824f
@@ -235,6 +235,11 @@ void client::group_client::register_metrics(std::string class_name, std::string
|
||||
sm::description("Total time spend writing data to objects"), {ep_label, sg_label}),
|
||||
sm::make_counter("total_read_prefetch_bytes", [this] { return prefetch_bytes; },
|
||||
sm::description("Total number of bytes requested from object"), {ep_label, sg_label}),
|
||||
sm::make_counter("downloads_blocked_on_memory",
|
||||
[this] { return downloads_blocked_on_memory; },
|
||||
sm::description("Counts the number of times S3 client downloads were delayed due to insufficient memory availability"),
|
||||
{ep_label, sg_label})
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1147,6 +1152,8 @@ class client::chunked_download_source final : public seastar::data_source_impl {
|
||||
}
|
||||
|
||||
if (auto units = try_get_units(_client->_memory, _socket_buff_size); !_is_finished && !_buffers.empty() && !units) {
|
||||
auto& gc = _client->find_or_create_client();
|
||||
++gc.downloads_blocked_on_memory;
|
||||
co_await _bg_fiber_cv.when([this] {
|
||||
return _is_finished || _buffers.empty() || try_get_units(_client->_memory, _socket_buff_size);
|
||||
});
|
||||
|
||||
@@ -131,6 +131,7 @@ class client : public enable_shared_from_this<client> {
|
||||
io_stats read_stats;
|
||||
io_stats write_stats;
|
||||
uint64_t prefetch_bytes = 0;
|
||||
uint64_t downloads_blocked_on_memory = 0;
|
||||
seastar::metrics::metric_groups metrics;
|
||||
group_client(std::unique_ptr<http::experimental::connection_factory> f, unsigned max_conn, const aws::retry_strategy& retry_strategy);
|
||||
void register_metrics(std::string class_name, std::string host);
|
||||
|
||||
Reference in New Issue
Block a user