perf: reduce tokio worker thread blocking to improve responsiveness on low-core machines

- Switch memdb durability from Full to Batch(100) with 10s flush worker
  - Offload BlobManager fjall writes to spawn_blocking
  - Wrap Tantivy commit operations in block_in_place
  - Flush memdb WAL on graceful shutdown
This commit is contained in:
rustmailer
2026-05-24 14:34:16 +08:00
parent 0be2670600
commit 0792bb546d
5 changed files with 49 additions and 17 deletions
+2
View File
@@ -28,6 +28,7 @@ use bichon_core::{
cache::imap::task::SYNC_TASKS,
common::{rustls::BichonTls, signal::SignalManager},
context::{executors::BichonContext, Initialize},
database::manager::DB_MANAGER,
error::{code::ErrorCode, BichonResult},
logger,
migrate::check_data_status,
@@ -116,6 +117,7 @@ pub async fn run() -> BichonResult<()> {
ENVELOPE_MANAGER.shutdown().await;
ATTACHMENT_MANAGER.shutdown().await;
BLOB_MANAGER.shutdown().await;
DB_MANAGER.flush();
info!("Bichon server stopped.");
Ok(())
}