From 88ac31b549eb98aca1723064a4187ef010c8c432 Mon Sep 17 00:00:00 2001 From: Greg Heartsfield Date: Sun, 18 Dec 2022 13:44:28 -0600 Subject: [PATCH] perf: increase channel size for DB communication --- src/server.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server.rs b/src/server.rs index 29953a7..b4819ae 100644 --- a/src/server.rs +++ b/src/server.rs @@ -464,9 +464,11 @@ async fn nostr_server( let cid = conn.get_client_prefix(); // Create a channel for receiving query results from the database. // we will send out the tx handle to any query we generate. - let (query_tx, mut query_rx) = mpsc::channel::(256); + // this has capacity for some of the larger requests we see, which + // should allow the DB thread to release the handle earlier. + let (query_tx, mut query_rx) = mpsc::channel::(20000); // Create channel for receiving NOTICEs - let (notice_tx, mut notice_rx) = mpsc::channel::(32); + let (notice_tx, mut notice_rx) = mpsc::channel::(128); // last time this client sent data (message, ping, etc.) let mut last_message_time = Instant::now();