Optimize SQLite and PrefixHandler for better performance

- Increase PrefixHandler queue size to 500k and batch size to 25k
- Set SQLite PRAGMA synchronous=OFF for faster writes (trades durability)
- Increase SQLite cache to 1GB and mmap to 512MB
- Increase WAL checkpoint interval to 10000 pages
- Set page size to 8KB for better performance
- Increase busy timeout to 30 seconds
- Keep single connection to avoid SQLite locking issues
This commit is contained in:
2025-07-28 02:40:17 +02:00
parent 54bb0ba1cb
commit 7d814c9d2d
2 changed files with 15 additions and 11 deletions

View File

@@ -14,10 +14,10 @@ import (
const (
// prefixHandlerQueueSize is the queue capacity for prefix tracking operations
prefixHandlerQueueSize = 200000
prefixHandlerQueueSize = 500000
// prefixBatchSize is the number of prefix updates to batch together
prefixBatchSize = 10000
prefixBatchSize = 25000
// prefixBatchTimeout is the maximum time to wait before flushing a batch
prefixBatchTimeout = 2 * time.Second