CPU Throttling & Performance Optimization Guide
The -cputhrottle flag provides comprehensive control over CPU usage
across all resource-intensive operations in the TYCHON Quantum Readiness. This feature prevents system overload,
ensures smooth operation alongside other applications, and provides predictable performance characteristics.
Supported values are none, low, medium, and high (case-sensitive).
Omitting -cputhrottle selects medium. An unsupported value emits a warning naming
the invalid value and the applied medium fallback to the console and, when configured, the scan log.
The scan continues; the invalid value alone does not cause a nonzero exit or prevent report creation.
The fallback preserves the existing default limits: 75% target CPU, adaptive throttling, and
75% of CPU cores rounded up with a minimum concurrency of 2 and a maximum of 16.
Based on testing with a 14-core system scanning 516 cipher suites and 2,300+ filesystem certificates:
| Metric | None | Low | Medium | High |
|---|---|---|---|---|
| CPU Usage | ||||
| Memory Usage | ||||
| Scan Time (relative) | ||||
| Concurrent Operations | 28 | 7 | 14 | 14 |
| Filesystem Workers | 56 | 14 | 28 | 28 |
| System Responsiveness | Poor | Excellent | Good | Fair |
Filesystem scans (-scanfilesystem and the per-application config scan) retain only files that match a certificate, key, keystore, config or encrypted-file pattern. The shared walk cache holds at most 200,000 entries across all roots, including concurrent walks still buffering entries. Walks that do not fit are streamed to consumers and walked again by later scanner phases. Certificate and config candidates are processed incrementally; config references are resolved before directly embedded material. This limits retained discovery metadata, not total process memory: directory traversal and report findings can still require additional memory.
| Files scanned | Before | After |
|---|---|---|
| 600,000 | 268 MB peak | 122 MB peak |
| 3,600,000 | 1,092 MB peak | 117 MB peak |
Measured on Linux with -scanmemory -scanfilesystem -cputhrottle high. Before the change, memory grew by roughly 0.3 KB per file for the life of the scan.
The throttle level also sets a Go runtime soft memory limit, so the garbage collector works harder as the heap approaches it. Set GOMEMLIMIT in the environment to override it.
Note that high is the least throttled setting that still applies throttling: none is unthrottled, low is the most throttled. The Linux in-memory certificate scan also honors the throttle delay between large memory regions.
CPU throttling comprehensively controls resource usage across all scanner operations:
Why Low: Minimizes impact on production services, uses only 50% CPU, allows normal server operations to continue unimpeded.
Why Medium: Default setting provides good balance, allows concurrent development work while scanning completes reasonably quickly.
Why High: Maximizes scanning speed during off-hours, completes comprehensive audits faster while system is idle.
Why Low: Ensures pipeline stability, prevents build agent resource exhaustion, predictable execution time.
Why None: Maximizes throughput on dedicated hardware, completes large-scale assessments in minimum time.
Scanning large CIDR blocks (e.g., /8, /16) without proper throttling can cause:
Always use -cputhrottle low or medium for large-scale scans!
• Applied throttling to filesystem, port scanning, and DNS operations
• Added CIDR expansion limits (max 65,536 IPs)
• Fixed memory leak preventing 57.9GB allocation on /8 networks
• Introduced -cputhrottle flag with four levels
• Applied to cipher scanning operations
• Added adaptive throttling based on system load