Memory and installation issues, easy solution!!!
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!!!
For anyone reading this, "Restart=on-failure" is NOT part of the startup line, so leave that out.
Jep, Docker part i guess
"And create a SWAP FILE double than RAM with: vm.swappiness=10 vm.vfs_cache_pressure = 50"
Where do you do this?
In the operative system.
/etc/sysctl sysctl -p
@mr-e-
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.
Hi @nuriel77, users with little RAM (<4GB) need a swap file double than RAM, this is not your case :-)