chore: schedule chains (#3819)

Use intrusive queue that allows batching of scheduling calls instead of handling each call separately.
This optimizations improves latency and throughput by 3-5%
In addition, we expose batching statistics in info transaction block.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-10-11 22:41:31 +03:00 committed by GitHub
parent e71f083f34
commit 5d2c308c99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 130 additions and 26 deletions

View file

@ -2440,7 +2440,8 @@ void ServerFamily::Info(CmdArgList args, ConnectionContext* cntx) {
append("tx_normal_total", m.coordinator_stats.tx_normal_cnt);
append("tx_inline_runs_total", m.coordinator_stats.tx_inline_runs);
append("tx_schedule_cancel_total", m.coordinator_stats.tx_schedule_cancel_cnt);
append("tx_batch_scheduled_items_total", m.shard_stats.tx_batch_scheduled_items_total);
append("tx_batch_schedule_calls_total", m.shard_stats.tx_batch_schedule_calls_total);
append("tx_with_freq", absl::StrJoin(m.coordinator_stats.tx_width_freq_arr, ","));
append("tx_queue_len", m.tx_queue_len);