iri icon indicating copy to clipboard operation
iri copied to clipboard

Memory and installation issues, easy solution!!!

Open ALEX778899 opened this issue 8 years ago • 7 comments

Hi, I'm a systems analyst and Java developer, I'm helping lot of persons to setup a full node and today I want to share with you two simply steps for avoid almost all memory and installation problems, IRI don't need so powerful hardware:

STEP 1 use this command: ExecStart=/usr/bin/java -XX:+CrashOnOutOfMemoryError -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses -XX:+CMSParallelRemarkEnabled -XX:+DisableAttachMechanism -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxMetaspaceSize=30m -Xmx8G -Xms2G -Djava.net.preferIPv4Stack=true -jar iri-1.4.1.4.jar --remote -c iota.ini

Pay attention:

  • the maximum RAM (-Xmx) for IRI can't exceed the 70% of the total memory;
  • it's NOT SAFE to remove -XX:+DisableAttachMechanism, if a Java program is deployed in production with remote monitoring enabled, an attacker can connect to the Java Virtual Machine (JVM) and inspect its behavior and data, including potentially sensitive information. An attacker can also exert control over the program's behavior.

STEP 2

  • create in the operative system a SWAP FILE for reach at least the total dimension of 10GB (if you have 8GB RAM you need at least 2GB SWAP FILE);
  • set vm.swappiness=10;
  • set vm.vfs_cache_pressure = 50.

That's it Hurrah IOTA!!!

ALEX778899 avatar Dec 18 '17 19:12 ALEX778899

For anyone reading this, "Restart=on-failure" is NOT part of the startup line, so leave that out.

Antyrael avatar Dec 19 '17 08:12 Antyrael

Jep, Docker part i guess

Berndinox avatar Dec 19 '17 08:12 Berndinox

"And create a SWAP FILE double than RAM with: vm.swappiness=10 vm.vfs_cache_pressure = 50"

Where do you do this?

mr-e- avatar Dec 19 '17 21:12 mr-e-

In the operative system.

ALEX778899 avatar Dec 21 '17 11:12 ALEX778899

/etc/sysctl sysctl -p

@mr-e-

Berndinox avatar Dec 21 '17 11:12 Berndinox

What is the justification for having swap double than RAM? If I have 32GB RAM, do I really need 64GB swap? That sounds excessive to be honest, even with 8GB RAM.

My node has 8GB RAM and 1GB RAM swap and it is in sync for 4 days now. I have low swappiness setting and swap never goes beyond 50% usage. Don't have any memory related issues.

nuriel77 avatar Dec 28 '17 08:12 nuriel77

Hi @nuriel77, users with little RAM (<4GB) need a swap file double than RAM, this is not your case :-)

ALEX778899 avatar Dec 28 '17 11:12 ALEX778899