Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to increase the node qps for both jsonrpc and http api? #6159

Open
PikaZ76 opened this issue Feb 4, 2025 · 3 comments
Open

How to increase the node qps for both jsonrpc and http api? #6159

PikaZ76 opened this issue Feb 4, 2025 · 3 comments

Comments

@PikaZ76
Copy link

PikaZ76 commented Feb 4, 2025

I'd like to deploy a Tron full node used to sync data through it's jsonrpc and http api, is there any solution in configuration to hit the limition of the server?
I got a 64 core CPU, 256 GB Memory.

and I used this configuration:


node {
  tcpNettyWorkThreadNum = 128

  udpNettyWorkThreadNum = 8 
}

rpc {
    thread = 32
}

rate.limiter{
  # global qps, default 50000
  global.qps = 500000
  # IP-based global qps, default 10000
  global.ip.qps = 500000
}

so, are there any way to do in configuration file or JVM to maxmum the api performance?
@angrynurd
Copy link

@PikaZ76
Based on your machine specifications (which are quite high-end), I would recommend the following configurations to maximize resource utilization:

  1. Increase JVM memory allocation in startup command:
# Example: increase to 128GB
JAVA_OPTS="-Xms128g -Xmx128g"
  1. Increase QPS limits:
rate.limiter = {
  global.qps = 500000
  global.ip.qps = 500000
}

3.HTTP configuration:

node {
  maxHttpConnectNumber = 500  # increase from default 50
}

When adjusting these configurations, please tune them gradually based on monitoring metrics:

If CPU usage is too high, consider reducing thread count
If memory usage is too high, reduce maxHttpConnectNumber
If response time increases, lower QPS limits

@PikaZ76
Copy link
Author

PikaZ76 commented Feb 4, 2025

any solution on leveldb config?

@angrynurd
Copy link

angrynurd commented Feb 5, 2025

any solution on leveldb config?

@PikaZ76
If you are using a mainstream SSD drive, the query latency of LevelDB is very low (compared to the overall latency of JSON-RPC/HTTP interfaces). Typically, in a single API query, LevelDB only takes about 5-10ms, which is already very fast. The disk(especially SSD drive ) is usually not the bottleneck.

If you still want to improve LevelDB performance, you can try modifying the following parameters in the storage section of the main_net_config.conf file:

Image

1.cacheSize: Recommended to set a larger value (like 4GB or more) to improve cache hit rate
2.maxOpenFiles: Set a larger value to avoid frequent file open/close operations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants