From e11e374f8bbcf2cd09dbb9473bd80d30cf4a652e Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Wed, 6 Dec 2023 15:20:28 +0700 Subject: [PATCH] estimate: less ram for indexing (#8911) --- eth/ethconfig/estimate/esitmated_ram.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/eth/ethconfig/estimate/esitmated_ram.go b/eth/ethconfig/estimate/esitmated_ram.go index 27b5d1754..278d1ec03 100644 --- a/eth/ethconfig/estimate/esitmated_ram.go +++ b/eth/ethconfig/estimate/esitmated_ram.go @@ -22,9 +22,15 @@ func (r estimatedRamPerWorker) WorkersHalf() int { return cmp.Max(1, r.Worker func (r estimatedRamPerWorker) WorkersQuarter() int { return cmp.Max(1, r.Workers()/4) } const ( - IndexSnapshot = estimatedRamPerWorker(3 * datasize.GB) //elias-fano index building is single-threaded - CompressSnapshot = estimatedRamPerWorker(1 * datasize.GB) //1-file-compression is multi-threaded - ReconstituteState = estimatedRamPerWorker(512 * datasize.MB) //state-reconstitution is multi-threaded + //elias-fano index building is single-threaded + // when set it to 3GB - observed OOM-kil at server with 128Gb ram and 32CPU + IndexSnapshot = estimatedRamPerWorker(4 * datasize.GB) + + //1-file-compression is multi-threaded + CompressSnapshot = estimatedRamPerWorker(1 * datasize.GB) + + //state-reconstitution is multi-threaded + ReconstituteState = estimatedRamPerWorker(512 * datasize.MB) ) // AlmostAllCPUs - return all-but-one cpus. Leaving 1 cpu for "work producer", also cloud-providers do recommend leave 1 CPU for their IO software