What is Nostr?
mleku
npub1fjq…leku
2025-04-25 21:54:50
in reply to nevent1q…80p3

mleku on Nostr: i found a solution #!/usr/bin/env bash export APP_NAME=realy export LISTEN=0.0.0.0 ...

i found a solution

#!/usr/bin/env bash
export APP_NAME=realy
export LISTEN=0.0.0.0
export PORT=3334
export PPROF=false
export SUPERUSER=npub1fjqqy4a93z5zsjwsfxqhc2764kvykfdyttvldkkkdera8dr78vhsmmleku
export GOGC=10
export MEMORYLIMIT=1000000
export GOMAXPROCS=1
/home/mleku/.local/bin/realy

now, it can swallow 180mb of events from a backup without blowing out the memory (2gb)

the other thing i did was disable running the database compact/gc cleanup and force it to pause a second every 1000 events, to give the GC more time to throw out the trash

and voila, runs nicely in 2gb of memory with plenty of space for the heap blowing up from normal business and no swap required

swap also fixed the problem, but it didn't really make it much faster, so, GC > swap
Author Public Key
npub1fjqqy4a93z5zsjwsfxqhc2764kvykfdyttvldkkkdera8dr78vhsmmleku