Repository navigation
Diagnostics and Optimization
| Monitor | Measures |
|---|---|
TickMonitor |
MSPT and TPS over 5s, 30s, 1m, 5m, and 15m windows, with P50/P95/P99 and standard deviation |
CpuMonitor |
CPU load for the server process and the host |
MemoryMonitor |
Heap, non-heap, GC pause rate, and allocation rate. Never forces GC. |
NetworkMonitor |
Player ping, kept separate from server-side tick and packet delays |
ChunkMonitor |
Loaded chunks and chunk load, unload, and generation rates |
EntityMonitor |
Entity and block-entity counts by type and world (read-only) |
TaskMonitor |
Pending scheduled tasks and active workers, per plugin |
StorageMonitor |
Free disk space and I/O latency (checked async) |
History is kept in fixed-size ring buffers, so memory use stays flat no matter how long the server runs.
/os diagnose runs the analysis pipeline:
- EvidenceCollector gathers the current metric snapshots.
- AnomalyDetector flags values that stray far from normal (z-score).
- TrendAnalyzer spots metrics that are getting worse over time.
- BottleneckAnalyzer classifies the main bottleneck as one of: CPU · Memory · GC · Chunks · Entities · Plugin Tasks · Storage · Network · Insufficient Evidence
- RecommendationEngine turns the findings into steps you can act on.
Each finding comes with a confidence score and the evidence behind it. If the data doesn't support a clear conclusion, OptimizeServer says so instead of guessing.
/os status # quick overview
/os mspt # is the tick time consistently high or spiky?
/os diagnose full # find the bottleneck
/os profile start # if a plugin is suspected, gather Spark samples
/os profile stop
/os report generate # save everything for later review
These modules make OptimizeServer's own work cheaper, and they never touch gameplay. Each one records before/after measurements and can be rolled back.
| Module | What it does |
|---|---|
config-lookup-cache |
Caches config value lookups |
monitoring-buffer-pool |
Reuses monitoring buffers to cut down on allocations |
bounded-metric-ring |
Stores metric history in fixed-size rings |
zero-alloc-aggregation |
Aggregates statistics without creating new objects |
redundant-query-coalescer |
Merges duplicate world queries made within a short window |
diagnostic-deduplicator |
Suppresses repeated identical findings |
task-batch-coordinator |
Batches small internal tasks together |
These are validated first, and they are blocked while safe mode is on.
| Module | What it does |
|---|---|
adaptive-monitoring-sampler |
Samples world data less often while the server is stable |
worker-pool-governor |
Resizes the async worker pool to match demand |
diagnostic-result-cache |
Caches diagnostic results for a short time |
adaptive-telemetry-batcher |
Batches telemetry processing |
Before any module is turned on, SafetyValidator checks it against all 16 vanilla gameplay rules. A module that could affect gameplay is rejected. If auto-rollback-on-regression is enabled and performance gets worse after a change, RollbackManager reverts that change.
OptimizeServer by NotGamerPratham · MIT License · Source · Report an issue