-
Notifications
You must be signed in to change notification settings - Fork 12
docs: add env var examples for performance tuning #280
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
docs: add env var examples for performance tuning #280
Conversation
|
Oh, I just realized that I forgot to include my suggestion for adding these environment variables to our existing Wiki page as well. |
|
Thank you very much @linconvidal ! This helps a lot. |
|
Additionally I copied your wiki proposal here: https://github.com/cardano-foundation/cardano-rosetta-java/wiki/7.-Advanced-Configuration-and-Performance |
Hi team!
This PR adds examples of environment variables in the
.envfiles to assist those looking to fine-tune performance. These variables were previously suggested as a mitigation for issues caused by the accumulation of long queries.I’m also proposing the creation of a new Wiki page to document these and other potential performance optimization options. I’ve included what I could gather from previous discussions, but feel free to expand, adjust, or refine it as needed.
7. Advanced-Configuration-and-Performance↓Advanced Configuration and Performance
This guide provides details on how to tune cardano-rosetta-java for various workloads and resource constraints. It covers:
.envSettings1. Pruning (Disk Usage Optimization)
Pruning removes spent (consumed) UTXOs from local storage, keeping only unspent UTXOs. This can reduce on-disk storage from ~1TB down to ~400GB, but discards historical transaction data.
PRUNING_ENABLED=truein your environment (e.g., in.env.dockerfileor.env.docker-compose).PRUNING_ENABLED=false.1.1. When to Enable Pruning
1.2. When to Avoid Pruning
2. Database Pool Settings (HikariCP)
cardano-rosetta-java uses HikariCP as the JDBC connection pool. Tuning these values can help manage concurrency and performance.
SPRING_DATASOURCE_HIKARI_MAXIMUMPOOLSIZESPRING_DATASOURCE_HIKARI_LEAKDETECTIONTHRESHOLDSPRING_DATASOURCE_HIKARI_CONNECTIONTIMEOUT2.1. Example
If you’re dealing with high API request volume, consider:
2.2 When to Increase Pool Size
SPRING_DATASOURCE_HIKARI_MAXIMUMPOOLSIZEif your database has the resources (CPU, RAM, I/O) to handle additional connections.3. Tomcat Thread Configuration
By default, Spring Boot (Tomcat) handles incoming HTTP requests with a thread pool. If you anticipate very high concurrency, you might adjust:
SERVER_TOMCAT_THREADS_MAX: Maximum number of threads Tomcat uses to handle requests.200).4. Example
.envSettingsBelow is a snippet of how you might configure
.env.dockerfileor.env.docker-composefor higher throughput:Further Reading