user6616: 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 and cardano-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 has cardano 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. :)



user5926: RTS opts are disabled by default in the db-sync build. To enable it add -rtsopts after -with-rtsopts=-N3 for the cardano-db-sync executable in the file cardano-db-sync/cardano-db-sync.cabal.

6616: <p>After successfully with <a href="https://cardano.stackexchange.com/q/7435/6616">previous question</a>, where I tried to make <code>cardano-node</code> and <code>cardano-db-sync</code> run as a services, I tried to play around with <code>+RTS ... -RTS</code> option on <code>cardano-db-sync</code>, specifically to reduce the RAM consumption with some option.</p>
<p>Here's the RTS option I tried <code>+RTS -N2 -A16m -qa -qb -qg -M6000M -RTS</code>.</p>
<p>With <code>cardano-node run ...</code>, I can do above RTS options, but with <code>cardano-db-sync ...</code>, I couldn't, here's the sample command</p>
<pre><code>...
...
...
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}
</code></pre>
<p>But, it fails, the error shown as below</p>
<pre><code>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'.
</code></pre>
<p>I tried to add <code>-rtsopts</code> as suggested on that error, but it also fails</p>
<pre><code>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}
</code></pre>
<p>Same error is shown</p>
<pre><code>cardano-db-sync: Most RTS options are disabled. Link with -rtsopts to enable them.
</code></pre>
<p>Also, I tried to do that with another way (reference - <a href="https://downloads.haskell.org/%7Eghc/latest/docs/html/users_guide/runtime_control.html?highlight=rtsopts" rel="nofollow noreferrer">on official documentation</a>), <code>-with-rtsopts=&quot;-N2 -A16m -qa -qb -qg -M6000M&quot;</code>, but it also fails with error, as shown below</p>
<pre><code>Invalid option `-with-rtsopts=-N2 -A16m -qa -qb -qg -M4500M'
</code></pre>
<hr>
<br>
<p>Is it possible to add the options <code>+RTS ... -RTS</code> like I tried above?</p>
<p>Or, am I did wrong? Like, it must come sequentially right after/before some command?</p>
<p>Thanks in advance! And, have a great day!</p>
<br>
<hr>
*PS
<ul>
<li><p>The reason I did try to reduce the RAM consumption is because <code>cardano-node run</code> and <code>cardano-db-sync</code> 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 has <code>cardano node</code> running too.</p>
</li>
<li><p>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. :)</p>
</li>
</ul>
 5926: <p><code>RTS</code> opts are disabled by default in the db-sync build. To enable it add <code>-rtsopts</code> after <code>-with-rtsopts=-N3</code> for the <code>cardano-db-sync</code> executable in the file <code>cardano-db-sync/cardano-db-sync.cabal</code>.</p>
