From 23fd8017a092dbb124c9c7a53ffe07bc8ddd2e1e Mon Sep 17 00:00:00 2001 From: Bernd Date: Sun, 1 Mar 2026 18:31:37 +0100 Subject: [PATCH] fix: optimize Firo node config for memory-constrained VM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reduce memory footprint to prevent swap thrashing on 3.8GB VM running 5 blockchain containers: firo.conf: - dbcache: 512 → 256 MB (saves ~256 MB) - maxmempool: 300 → 100 MB (saves ~200 MB) - mempoolexpiry: 72 → 24 hours - maxorphantx: 100 → 10 (reduces cs_main lock hold time) - rpcworkqueue: 32 → 64 (more buffer before RPC rejection) - maxsendbuffer/maxreceivebuffer: reduced per-connection buffers docker-compose-firo.yml: - Add 2048M memory limit / 1024M reservation - Healthcheck: getblockcount instead of getblockchaininfo (lighter) - Healthcheck interval: 30s → 120s, timeout: 60s → 10s, retries: 10 → 3 --- .../config/docker/docker-compose-firo.yml | 14 ++++++++++---- infrastructure/config/firo/firo.conf | 17 +++++++++++++---- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/infrastructure/config/docker/docker-compose-firo.yml b/infrastructure/config/docker/docker-compose-firo.yml index 2826fb2259..3eecb5c835 100644 --- a/infrastructure/config/docker/docker-compose-firo.yml +++ b/infrastructure/config/docker/docker-compose-firo.yml @@ -4,16 +4,22 @@ services: firod: image: firoorg/firod:0.14.15.2 restart: unless-stopped + deploy: + resources: + limits: + memory: 2048M + reservations: + memory: 1024M volumes: - ./volumes/firo:/home/firod/.firo ports: - '8168:8168' - '8888:8888' healthcheck: - test: firo-cli -conf=/home/firod/.firo/firo.conf getblockchaininfo || exit 1 + test: firo-cli -conf=/home/firod/.firo/firo.conf getblockcount || exit 1 start_period: 120s - interval: 30s - timeout: 60s - retries: 10 + interval: 120s + timeout: 10s + retries: 3 command: > -conf=/home/firod/.firo/firo.conf diff --git a/infrastructure/config/firo/firo.conf b/infrastructure/config/firo/firo.conf index f5f85522f3..3f141c0085 100644 --- a/infrastructure/config/firo/firo.conf +++ b/infrastructure/config/firo/firo.conf @@ -22,9 +22,18 @@ spentindex=0 # Network onlynet=ipv4 - -# Performance -dbcache=512 maxconnections=40 + +# Mempool (defaults: maxmempool=300MB, mempoolexpiry=72h, maxorphantx=100) +maxmempool=100 +mempoolexpiry=24 +maxorphantx=10 + +# Performance (defaults: dbcache=450MB, rpcthreads=4, rpcworkqueue=16) +dbcache=256 rpcthreads=8 -rpcworkqueue=32 +rpcworkqueue=64 + +# Per-connection buffer limits (value * 1000 bytes; defaults: send=1000, receive=5000) +maxsendbuffer=500 +maxreceivebuffer=2000