Excessive resource consumption - Ardor node

Hello team! :wave:

I have been observing that:

1.- RAM memory grows and grows exponentially is the nodes and this memory is taken by the burning node but never released.

2.- There are very high CPU consumption peaks, generating in VPS with 4 cores load average (LA) higher than 10. I think this can generate problems in the contracts that run on the node itself.

If that is happening without concurrency, I'm a little afraid that it may happen when it is used in full.

In the documentation I can only find the following specifications:

1 GB of RAM (2GB recommended)
10+ GB of Disk

But it doesn't say anything about the CPU... what is the recommended one? I guess the specs are a bit out of date... a node running contracts can eat those 2GB in a matter of a few weeks with the above problem.

Is there any solution?

Thanks!

1.- RAM memory grows and grows exponentially is the nodes and this memory is taken by the burning node but never released.

Which command do you use to get the memory consumption of the java process? It's normal for Java to consume as much memory as is provided to it in order to minimize the garbage collection calls. You can use Ardor's getState API to check what is the actual state of the memory:

  • maxMemory reports the limit which the java process is configure with. The process should not consume more than that. If it does, it's a problem of your Java implementation. You can configure this limit with the -Xmx switch. You can set that in a setenv.sh file in the root dir of the project like this:

export ARDOR_JVM_OPTS=-Xmx700M

  • totalMemory - How much the process currently consumes. This includes both the used and the free memory.
  • freeMemory - The free memory. This memory is still reserved by the JVM if you are using a command like top.

See here for more details: java - What are Runtime.getRuntime().totalMemory() and freeMemory()? - Stack Overflow

About the CPU, we rarely use more than one core at a time. Notice that the actual core under load changes, so you may be observing usage on more than one core. We've successfully run Ardor on a 1GHz CPU, but that's with the current low transaction count on mainnet.

The highest CPU load is during downloading. 4 cores with load average more than 10 is very weird indeed. Do you get that during downloading or with an up-to-date blockchain? And is this a testnet or mainnet node?

For sure if you are running contracts, they may consume more CPU or memory and how much that would be depends on the contarct.

2 Likes

I will do more research on memory, thank you!

It is a node on mainnet, the node is up to date but suffers from CPU spikes which I think has to do with the blocks.

Could it be given by the contracts running such nodes?
Some of the nodes are running 2 or 3 contracts at a time. All of them reviewing the blocks that are generated.

Do you think this could be the reason?

Thank you!

1 Like

There is always a possibility that a contract is unnecessary wasting resources. Try to disable the contacts and check again the CPU usage maybe

1 Like