Skip to content

Commit 02f68b9

Browse files
authoredNov 16, 2024
api: improve parallelism (#16)
1 parent 7ed9c43 commit 02f68b9

File tree

5 files changed

+231
-160
lines changed

5 files changed

+231
-160
lines changed
 

‎CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ The minor version will be incremented upon a breaking change and the patch versi
2525
- geyser: wait all transactions before process block ([#10](https://github.com/solana-stream-solutions/solfees/pull/10))
2626
- frontend: init ([#8](https://github.com/solana-stream-solutions/solfees/pull/8))
2727
- geyser: use process_compute_budget_instructions ([#15](https://github.com/solana-stream-solutions/solfees/pull/15))
28+
- api: improve parallelism ([#16](https://github.com/solana-stream-solutions/solfees/pull/16))
2829

2930
### Breaking

‎solfees-be/config-be.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ listen_rpc:
1515
body_limit: 16KiB # Maximum body size
1616
request_calls_max: 5 # Maximum number of calls in on request
1717
request_timeout: 60s # Request timeout (processed by dedicated tasks, see `pool_size`)
18-
request_queue_max: 5000 # Maximum number of requests in the queue (each request can contain max `request_calls_max` calls)
19-
streams_channel_capacity: 300 # Maximum number of messages in WebSocket channel before disconnect
18+
calls_queue_max: 16384 # Maximum number of requests in the queue (each request can contain max `request_calls_max` calls)
19+
streams_channel_capacity: 512 # Maximum number of messages in WebSocket channel before disconnect
2020
pool_size: 2 # Number of workers processing requests (WebSocket streams processed by separate task)

‎solfees-be/src/bin/solfees-be.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async fn main2(config: Config) -> anyhow::Result<()> {
1717
let (solana_rpc, solana_rpc_futs) = SolanaRpc::new(
1818
config.listen_rpc.request_calls_max,
1919
config.listen_rpc.request_timeout,
20-
config.listen_rpc.request_queue_max,
20+
config.listen_rpc.calls_queue_max,
2121
config.listen_rpc.streams_channel_capacity,
2222
config.listen_rpc.pool_size,
2323
);

‎solfees-be/src/config.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ pub struct ConfigListenRpc {
159159
pub request_calls_max: usize,
160160
#[serde(with = "humantime_serde")]
161161
pub request_timeout: Duration,
162-
pub request_queue_max: usize,
162+
pub calls_queue_max: usize,
163163
pub streams_channel_capacity: usize,
164164
pub pool_size: usize,
165165
}
@@ -171,8 +171,8 @@ impl Default for ConfigListenRpc {
171171
body_limit: 16 * 1024, // 16KiB
172172
request_calls_max: 5,
173173
request_timeout: Duration::from_secs(60),
174-
request_queue_max: 5_000,
175-
streams_channel_capacity: 300,
174+
calls_queue_max: 16_384,
175+
streams_channel_capacity: 512,
176176
pool_size: 2,
177177
}
178178
}

0 commit comments

Comments
 (0)
Please sign in to comment.