A lightweight, AI-readable server-side performance benchmark mod for NeoForge 1.21.1. Lightweight · Sampling-based CPU profiler · JSON/Text reports · No JavaScript rendering required
Note: This mod has nothing to do with another Benchmark mod I developed.
Benchmark Serverside is a performance benchmark mod for Minecraft servers. It samples the server main thread (Server Thread) and exports a performance report as structured JSON (or a human-readable text summary) together with full server context — mod list, plugin list (on hybrid servers), server.properties configuration, system environment and live runtime state.
The report is designed to be directly consumed by large language models (LLM) such as DeepSeek / GPT, or by server admins, so that lag sources can be located and optimized quickly — no need for JavaScript-rendered profile viewers (e.g. Spark).
ThreadMXBean-based sampling approach (not instrumentation), with a configurable interval (default 50 ms) and duration (default 60 s). Sampling overhead is negligible and only runs while a benchmark is active (/bcs start), so it never affects normal server operation.view-distance, simulation-distance, entity-broadcast-range-percentage, network-compression-threshold, max-players), Java/JVM info, OS, CPU cores, memory, disk space, worlds, online players and current TPS.benchmark-reports/benchmark_<yyyyMMdd_HHmmss>.json./bcs command tree with OP level 4 permission.| Item | Value |
|---|---|
| Minecraft | 1.21.1 |
| NeoForge | 21.1.241 |
| Java | 21 |
benchmarkserverside-1.0.0.jar) and place it into the server's mods/ folder./bcs start and wait, then check benchmark-reports/ for the generated report.All sub-commands require OP level 4.
| Command | Description |
|---|---|
/bcs start [seconds] |
Start sampling the server main thread (duration can be overridden). |
/bcs stop |
Stop the current sampling; a report is generated automatically. |
/bcs status |
Show current sampling status / last result. |
/bcs report [format] |
Re-export the latest report. format = json, txt or both. |
Config file: config/benchmarkserverside-common.toml (created on first run).
| Option | Default | Description |
|---|---|---|
sampling.sampleIntervalMs |
50 |
Sampling interval in milliseconds. Keep ≥ 50 ms. |
sampling.sampleDurationSeconds |
60 |
Default sampling duration in seconds. |
sampling.maxStackDepth |
60 |
Max stack frames captured per sample. |
sampling.maxSamples |
100000 |
Max stored samples (memory guard). |
sampling.excludedPackages |
(JDK/system prefixes) | Package prefixes filtered when computing hotspots. |
report.directory |
benchmark-reports |
Report output directory (relative to server root). |
report.topHotspots |
50 |
Number of hotspots kept in the report. |
report.writeTxt |
false |
Also write a plain-text report on auto-generation. |
Reports are saved to benchmark-reports/ in the server root:
benchmark_<yyyyMMdd_HHmmss>.json — structured report (preferred, AI-readable)benchmark_<yyyyMMdd_HHmmss>.txt — human-readable summaryThe JSON report includes: timestamp, sampling_duration_seconds, server_info, environment, config, plugins, mods, runtime, and profiling_results (total/idle/active samples, top_hotspots with percentages, call_stacks).
Example (abridged):
{
"timestamp": "2026-08-16T12:00:00Z",
"sampling_duration_seconds": 60,
"server_info": { "type": "NeoForge", "version": "21.1.241", "minecraft_version": "1.21.1", "worlds": ["minecraft:overworld"] },
"environment": { "java_version": "21.0.2", "os": "Windows 10 10.0 (amd64)", "cpu_cores": 8, "total_memory_mb": 16260, "free_memory_mb": 4838, "disk_free_gb": 33.0 },
"config": { "view_distance": 10, "simulation_distance": 10, "entity_broadcast_range_percentage": 100, "network_compression_threshold": 256, "max_players": 20 },
"mods": [ { "id": "neoforge", "name": "NeoForge", "version": "21.1.241" } ],
"runtime": { "online_players": 0, "tps": 20.0, "process_cpu_usage_percent": 0.5, "system_cpu_usage_percent": 15.6 },
"profiling_results": {
"total_samples": 1200, "idle_samples": 800, "active_samples": 400,
"top_hotspots": [
{ "method": "net.minecraft.server.level.ServerLevel.tick()", "samples": 150, "percentage": 12.5 }
]
}
}
ThreadMXBean#getThreadInfo(threadId, maxDepth) (safe-point sampling — low overhead, statistically meaningful)./bcs stop), the result is compiled and the report is written on the server thread.git clone https://github.com/youyiMC/Benchmark-Serverside.git
cd Benchmark-Serverside
# Windows
gradlew.bat build
# macOS / Linux
./gradlew build
The built jar will be in build/libs/benchmarkserverside-1.0.0.jar.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
The original NeoForged MDK template files remain under the MIT license as noted in
TEMPLATE_LICENSE.txt.
注意:这个模组和我开发的另一个Benchmark模组没有任何关联!
Benchmark Serverside 是一个面向 Minecraft 服务器的轻量级性能基准测试(Benchmark)模组。它对服务器主线程(Server Thread)进行采样,并将性能报告以结构化 JSON(或人类可读的纯文本摘要)的形式导出,同时附带完整的服务器上下文——模组列表、插件列表(混合端)、server.properties 配置、系统环境与实时运行状态。
报告专门设计为可供大语言模型(如 DeepSeek、GPT)直接阅读分析,也可供服主快速定位卡顿根源——无需像 Spark 那样依赖 JavaScript 渲染的报告。
ThreadMXBean 的采样(Sampling)方式而非仪器(Instrumentation),采样间隔(默认 50 ms)与时长(默认 60 s)均可配置。仅在 /bcs start 后才开始采样,平时零开销,绝不干扰服务器正常运行。benchmark-reports/benchmark_<yyyyMMdd_HHmmss>.json。/bcs 指令树,需要 OP 4 级权限。| 项目 | 值 |
|---|---|
| Minecraft | 1.21.1 |
| NeoForge | 21.1.241 |
| Java | 21 |
benchmarkserverside-1.0.0.jar)放入服务器的 mods/ 文件夹。/bcs start 开始采样,等待结束后在 benchmark-reports/ 目录查看生成的报告。所有子指令均需 OP 4 级权限。
| 指令 | 说明 |
|---|---|
/bcs start [seconds] |
开始对服务器主线程采样(可指定时长)。 |
/bcs stop |
停止当前采样,并自动生成性能报告文件。 |
/bcs status |
查看当前采样状态 / 最近一次采样结果。 |
/bcs report [format] |
手动导出最近一次采样的报告,format 为 json、txt 或 both。 |
配置文件:config/benchmarkserverside-common.toml(首次运行自动生成)。
| 配置项 | 默认值 | 说明 |
|---|---|---|
sampling.sampleIntervalMs |
50 |
采样间隔(毫秒),建议不低于 50ms。 |
sampling.sampleDurationSeconds |
60 |
默认采样时长(秒)。 |
sampling.maxStackDepth |
60 |
每次采样获取的最大栈帧深度。 |
sampling.maxSamples |
100000 |
最大采样条数(防止内存溢出)。 |
sampling.excludedPackages |
(JDK/系统前缀) | 热点统计时过滤的包前缀。 |
report.directory |
benchmark-reports |
报告保存目录(相对服务器根目录)。 |
report.topHotspots |
50 |
报告保留的热点方法数量。 |
report.writeTxt |
false |
自动生成报告时是否同时输出纯文本版本。 |
报告默认保存在服务器根目录下的 benchmark-reports/ 文件夹中:
benchmark_<yyyyMMdd_HHmmss>.json —— 结构化报告(首选,AI 可读)benchmark_<yyyyMMdd_HHmmss>.txt —— 人类可读的纯文本摘要JSON 报告包含:timestamp、sampling_duration_seconds、server_info、environment、config、plugins、mods、runtime 与 profiling_results(总/空闲/活跃样本、带占比的 top_hotspots、call_stacks)。
ThreadMXBean#getThreadInfo(threadId, maxDepth) 周期性抓取服务器主线程调用栈(安全点采样,开销极小,统计意义上足以定位热点)。/bcs stop)后,结果被编译并在服务器主线程上写入报告文件。git clone https://github.com/youyiMC/Benchmark-Serverside.git
cd Benchmark-Serverside
# Windows
gradlew.bat build
# macOS / Linux
./gradlew build
构建产物位于 build/libs/benchmarkserverside-1.0.0.jar。
本项目基于 GNU General Public License v3.0 开源,详见 LICENSE 文件。
原始 NeoForged MDK 模板文件仍按 MIT 许可证授权,详见
TEMPLATE_LICENSE.txt。