Skip to content

Commit

Permalink
quic tpu: create fewer timeout futures
Browse files Browse the repository at this point in the history
Use a cancellation token instead of polling an Arc<bool> to exit
connection tasks. Before this change we used to create a timeout future
for each tx, and immediately cancel it since virtually all connections
always have incoming tx pending. Cancelling timeout futures is expensive
as it goes inside the tokio driver and takes a mutex. On high load (1M
tps), cancelling timeout futures takes 8% (!) of run time.

With this change we create a cancellation token _once_ when a connection
is established and that's it - no overhead after that.
  • Loading branch information
alessandrod committed Oct 15, 2024
1 parent 47163d4 commit a020333
Show file tree
Hide file tree
Showing 4 changed files with 210 additions and 201 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions streamer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ solana-sdk = { workspace = true }
solana-transaction-metrics-tracker = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["full"] }
tokio-util = { workspace = true }
x509-parser = { workspace = true }

[dev-dependencies]
Expand Down
Loading

0 comments on commit a020333

Please sign in to comment.