Appearance
Performance Optimization
Optimize your instance to handle large codebases and high-frequency scan volumes.
1. Resource Allocation Matrix
Adjust your hardware and JVM settings based on your total Lines of Code (LoC).
| Total LoC | Min RAM | RISK_XMX (Analysis) | ANALYSER_XMX (Engine) |
|---|---|---|---|
| < 500k | 16 GB | -Xmx2g | -Xmx8g |
| 500k - 2M | 32 GB | -Xmx4g | -Xmx16g |
| 2M+ | 64 GB+ | -Xmx8g | -Xmx32g |
2. Applying Memory Settings
Modify these values in your docker-compose.yml or docker run command to prevent OutOfMemory errors during deep scans.
bash
# Docker Run Example
-e RISK_XMX=-Xmx4g \
-e ANALYSER_XMX=-Xmx16g3. Database Optimization
For instances with 100+ repositories:
- SSD Storage: Ensure PostgreSQL data volumes are mounted on high-speed SSDs.
- Connection Pooling: For external DBs, ensure
max_connectionsis set to at least200.
4. Maintenance
- Log Rotation: Periodically clear the
gamma_data/logsdirectory to save disk I/O. - Snapshot Cleanup: Use the Admin > Cleanup settings to remove old snapshots of deleted branches.
