After successfully with previous question, where I tried to make cardano-node
and cardano-db-sync
run as a services, I tried to play around with +RTS ... -RTS
option on cardano-db-sync
, specifically to reduce the RAM consumption with some option.
Here's the RTS option I tried +RTS -N2 -A16m -qa -qb -qg -M6000M -RTS
.
With cardano-node run ...
, I can do above RTS options, but with cardano-db-sync ...
, I couldn't, here's the sample command
...
...
...
PGPASSFILE=${PGPASSFILE} cardano-db-sync +RTS -N2 -A16m -qa -qb -qg -M4500M -RTS --config ${CONFIG} --socket-path ${CARDANO_NODE_SOCKET_PATH} --state-dir ${STATE_DIR} --schema-dir ${SCHEMA_DIR}
But, it fails, the error shown as below
Mar 08 09:54:54 cardano-db-sync: Most RTS options are disabled. Link with -rtsopts to enable them.
Mar 08 09:54:54 cardano-db-sync-run.service: Main process exited, code=exited, status=1/FAILURE
Mar 08 09:54:54 cardano-db-sync-run.service: Failed with result 'exit-code'.
I tried to add -rtsopts
as suggested on that error, but it also fails
PGPASSFILE=${PGPASSFILE} cardano-db-sync +RTS -N2 -A16m -qa -qb -qg -M4500M -RTS -rtsopts --config ${CONFIG} --socket-path ${CARDANO_NODE_SOCKET_PATH} --state-dir ${STATE_DIR} --schema-dir ${SCHEMA_DIR}
Same error is shown
cardano-db-sync: Most RTS options are disabled. Link with -rtsopts to enable them.
Also, I tried to do that with another way (reference - on official documentation), -with-rtsopts="-N2 -A16m -qa -qb -qg -M6000M"
, but it also fails with error, as shown below
Invalid option `-with-rtsopts=-N2 -A16m -qa -qb -qg -M4500M'
Is it possible to add the options +RTS ... -RTS
like I tried above?
Or, am I did wrong? Like, it must come sequentially right after/before some command?
Thanks in advance! And, have a great day!
*PS
The reason I did try to reduce the RAM consumption is because
cardano-node run
andcardano-db-sync
keeps dropped (killed) from the services, since I had limited RAM (16GB) on my test server. I kinda aware with RAM requirement, but I tried to reduce it, due some circumstances, I can't upgrade RAM on my test server, since it hascardano node
running too.I'm not GHC expert or even linux expert. So, if there's some terms or RTS option that I use incorrectly, please let me know, so I can do in a correct way. :)
db-sync
. Trying to reduce the memory footprint ofdb-sync
using RTS options will fail with 100% certainty. The problem is that bothnode
anddb-sync
have a data structure called ledger state (which is huge, like 8 Gigabytes huge) that is basically identical. Long term, we want to reduce that so thatdb-sync
does not need to maintain that. Until then, you need to just live with the high memory usage.cardano-node run
? || And, "Until then, you need to just live with the high memory usage." - you mean, the only way is to upgrade RAM?RTS
options might allow you to shave as much as 20% off the memory usage at the cost of a performance hit (because the garbage collector will need to run more often). Unfortunately the only current solution is more RAM.RTS
options that might be available for me to use? since, from what I test around from initial options+RTS -N2 -A16m -qa -qb -qg -M6000M -RTS
it gives me error messageMost RTS options are disabled. Link with -rtsopts to enable them.
. Anyway, thanks for your comments.RTS
opts are disabled by default in thedb-sync
build. To enable it add-rtsopts
after-with-rtsopts=-N3
for thecardano-db-sync
executable in the filecardano-db-sync/cardano-db-sync.cabal