๐Ÿš€ Tronsell Wiki

Full Node Performance Optimization

Advanced tuning guide for TRON full nodes. Learn how to optimize JVM settings, RocksDB, network parameters, and system configuration for maximum throughput and stability.

โšก Optimization at a Glance
JVM Heap 16โ€“20 GB
GC Algorithm G1GC (recommended)
Database RocksDB + ZSTD
Network 1 Gbps +
IOPS Target 10,000+
Sync Speed Gain 30โ€“50%

๐ŸŽฏ Why Optimize Your TRON Full Node?

A well-optimized TRON full node delivers faster sync times, lower latency API responses, and better resource utilization. Whether you are running a node for a dApp backend, an exchange, or as an infrastructure provider, performance tuning can significantly improve user experience and operational efficiency.

This guide covers optimization strategies across four key areas: JVM tuning, database configuration, network optimization, and operating system tweaks. Apply these recommendations to get the most out of your hardware.

๐Ÿ“Œ Performance Impact

Proper tuning can reduce initial sync time by 30โ€“50%, lower block propagation latency, and reduce CPU usage by up to 20% on a production node.

โ˜• JVM Tuning for Java-Tron

Java-Tron runs on the Java Virtual Machine (JVM). The default JVM settings are conservative; tuning them can unlock significant performance gains.

Heap Size

The heap size determines how much memory Java-Tron can use for object allocation. Insufficient heap leads to frequent garbage collection (GC) pauses; excessive heap wastes memory.

Server RAM Recommended Heap GC Algorithm
16 GB -Xmx12G -Xms12G G1GC
32 GB -Xmx20G -Xms20G G1GC
64 GB+ -Xmx30G -Xms30G G1GC (or ZGC)
# Example JVM options for a 32 GB server java -Xmx20G -Xms20G \ -XX:+UseG1GC \ -XX:MaxGCPauseMillis=200 \ -XX:ParallelGCThreads=8 \ -XX:ConcGCThreads=4 \ -XX:+DisableExplicitGC \ -jar FullNode.jar -c config.conf
๐Ÿ’ก GC Tuning Tips

Use G1GC for most deployments โ€” it balances throughput and latency. For very large heaps (>32 GB), consider ZGC for ultra-low pause times, but test thoroughly first.

Direct Memory & Off-Heap

Java-Tron also uses off-heap memory for RocksDB and network buffers. Set -XX:MaxDirectMemorySize to avoid OOM errors in native code.

-XX:MaxDirectMemorySize=4G

๐Ÿ—„๏ธ RocksDB Optimization

RocksDB is the storage engine for TRON nodes. Proper configuration dramatically improves read/write performance and reduces storage footprint.

๐Ÿ“ฆ
Compression

Use ZSTD for the best compression ratio. Set db.compression = ZSTD in config.conf.

๐Ÿงน
Compaction

Set db.maxBackgroundCompactions = 4 to speed up compaction. Monitor I/O to avoid saturation.

๐Ÿ“‚
File Size

Increase db.targetFileSize = 64 (MB) to reduce the number of SST files and improve read performance.

๐Ÿงฎ
Block Cache

Set db.blockCacheSize = 2048 (MB) to cache frequently accessed blocks in memory.

# Recommended RocksDB settings in config.conf db.engine = ROCKSDB db.compression = ZSTD db.targetFileSize = 64 db.maxBackgroundCompactions = 4 db.maxOpenFiles = 4096 db.blockCacheSize = 2048
โšก RocksDB Memory Tuning

RocksDB uses both block cache and write buffer memory. Monitor rocksdb.block-cache-usage and rocksdb.mem-table-size to avoid excessive memory pressure.

๐ŸŒ Network Performance Tuning

Network latency and bandwidth directly affect sync speed and block propagation. Optimize your network stack for TRON's P2P traffic.

  • Increase TCP buffer sizes โ€” Set net.core.rmem_max and net.core.wmem_max to 16 MB.
  • Enable TCP fast open โ€” Reduces connection latency for repeated peers.
  • Adjust peer limits โ€” Set maxActiveNodes = 30 in config for better peer diversity.
  • Use a dedicated network interface โ€” Avoid sharing bandwidth with other high-traffic services.
  • Prefer geo-distributed peers โ€” Lower latency improves sync.
# /etc/sysctl.conf network tuning net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.ipv4.tcp_rmem = 4096 87380 16777216 net.ipv4.tcp_wmem = 4096 65536 16777216 net.ipv4.tcp_fastopen = 3

๐Ÿง Operating System Tuning

At the OS level, file descriptor limits, swap behavior, and CPU governor settings can impact node performance.

Setting Recommended Value Impact
ulimit -n 65536 Allows more open file handles
vm.swappiness 1 Prevents swapping, improves latency
CPU Governor performance Maximizes CPU clock speed
Transparent Huge Pages disable Reduces memory overhead
# Increase file descriptor limit for the node user echo "tronuser soft nofile 65536" >> /etc/security/limits.conf echo "tronuser hard nofile 65536" >> /etc/security/limits.conf # Disable swap echo "vm.swappiness=1" >> /etc/sysctl.conf
๐Ÿ“Œ CPU Pinning

For bare-metal servers, consider CPU pinning with taskset to dedicate specific cores to Java-Tron, reducing context switching overhead.

๐Ÿ“Š Monitoring Performance Metrics

To validate your optimizations, monitor these key metrics:

  • Block sync lag โ€” Compare your node's latest block against Tronscan.
  • JVM GC pauses โ€” Use -Xlog:gc* to log garbage collection events.
  • RocksDB stats โ€” Enable db.statistics = true to expose RocksDB metrics.
  • CPU usage โ€” Aim for < 80% sustained CPU utilization.
  • Disk I/O โ€” Monitor iostat for read/write latency and throughput.
  • Network traffic โ€” Ensure inbound/outbound bandwidth is below your cap.
๐Ÿ” Recommended Tools

Use Prometheus + Grafana for comprehensive monitoring. Java-Tron exposes JMX metrics that can be scraped by Prometheus via JMX Exporter.

โ“ Frequently Asked Questions

What is the optimal JVM heap size for a TRON full node?

For a 32 GB server, use -Xmx20G -Xms20G. For 16 GB servers, use -Xmx12G. Leave at least 4โ€“6 GB for RocksDB and OS overhead.

Which GC algorithm is best for Java-Tron?

G1GC is the recommended default. It offers a good balance between throughput and pause times. For very large heaps (>32 GB), evaluate ZGC for sub-millisecond pauses.

How much can RocksDB tuning improve sync speed?

Proper RocksDB tuning (compression, compaction, block cache) can reduce sync time by 30โ€“50% compared to default settings. The improvement is most noticeable during initial sync.

Should I disable swap on my node server?

Yes. Set vm.swappiness=1 to avoid swapping. Swapping can cause severe latency spikes and sync stalls. Ensure you have enough RAM to handle peak load.

How do I know if my node is underperforming?

Monitor block lag, CPU usage, and GC pause times. If your node consistently falls behind the chain tip or API response times exceed 500 ms, investigate tuning your configuration.

โšก Optimize Your Node, Save on Fees

Running a tuned full node? Pair it with Tronsell Energy to power your dApps and transactions at the lowest cost.