From 849c07114697762f8a29d608973af500cff6bea7 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Sun, 22 Jan 2023 23:44:51 -0500 Subject: [PATCH] hash: flush the table more slowly With SIGTERM and fast exit, the trickle writeback is less important. We don't want to flood people's IO subsystems with continuous writes. This really should be configurable at runtime. Signed-off-by: Zygo Blaxell --- src/bees.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bees.h b/src/bees.h index ffedd7d..7a7868d 100644 --- a/src/bees.h +++ b/src/bees.h @@ -61,8 +61,9 @@ const off_t BLOCK_SIZE_HASHTAB_BUCKET = BLOCK_SIZE_MMAP; // Extent size for hash table (since the nocow file attribute does not seem to be working today) const off_t BLOCK_SIZE_HASHTAB_EXTENT = BLOCK_SIZE_MAX_COMPRESSED_EXTENT; -// Bytes per second we want to flush (8GB every two hours) -const double BEES_FLUSH_RATE = 8.0 * 1024 * 1024 * 1024 / 7200.0; +// Bytes per second we want to flush from hash table +// Optimistic sustained write rate for SD cards +const double BEES_FLUSH_RATE = 128 * 1024; // Interval between writing crawl state to disk const int BEES_WRITEBACK_INTERVAL = 900;