fix: increase Bitcoin memory limit to 4g, reduce dbcache to 2048
Bitcoin Knots needs more memory headroom (was OOMing at 2g during IBD). Reduce dbcache from 4096 to 2048 on large disks to stay within the 4g container limit. Low-memory systems get 2g (was 1g). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -255,7 +255,7 @@ pub(super) fn get_health_check_args(app_id: &str, rpc_pass: &str) -> Vec<String>
|
||||
pub(super) fn get_memory_limit(app_id: &str) -> &'static str {
|
||||
match app_id {
|
||||
// Heavy apps
|
||||
"bitcoin" | "bitcoin-core" | "bitcoin-knots" => "2g",
|
||||
"bitcoin" | "bitcoin-core" | "bitcoin-knots" => "4g",
|
||||
"onlyoffice" | "onlyoffice-documentserver" => "2g",
|
||||
"ollama" => "4g",
|
||||
// Medium apps
|
||||
|
||||
@@ -299,7 +299,7 @@ LOW_MEM=false
|
||||
|
||||
mem_limit() {
|
||||
case "$1" in
|
||||
bitcoin-knots) $LOW_MEM && echo "1g" || echo "2g";;
|
||||
bitcoin-knots) $LOW_MEM && echo "2g" || echo "4g";;
|
||||
onlyoffice) $LOW_MEM && echo "1g" || echo "2g";;
|
||||
ollama) $LOW_MEM && echo "1g" || echo "4g";;
|
||||
lnd) echo "512m";;
|
||||
@@ -383,7 +383,7 @@ if ! $DOCKER ps --format '{{.Names}}' 2>/dev/null | grep -qE 'bitcoin-knots|arch
|
||||
log " Small disk (${DISK_GB}GB) — enabling pruning"
|
||||
else
|
||||
BTC_EXTRA_ARGS="-txindex=1"
|
||||
BTC_DBCACHE=4096
|
||||
BTC_DBCACHE=2048
|
||||
log " Large disk (${DISK_GB}GB) — enabling txindex"
|
||||
fi
|
||||
if $DOCKER run -d --name bitcoin-knots --restart unless-stopped \
|
||||
|
||||
Reference in New Issue
Block a user