ServerTune
ServerTune 是一个高度可配置的 Paper 插件,用于服务器性能监控、优化、诊断以及故障保护。
它以固定间隔采样 TPS、MSPT、CPU、内存、区块和实体数据。在此基础上,它还提供了可选的优化模块、按需运行的插件分析器,以及一个状态机——当服务器已经处于挣扎状态时,该状态机会将插件自身的任务让路出去。
功能
- 监控 TPS、MSPT、CPU、内存、区块、实体、玩家、插件和数据包
- 在警告/严重/紧急阈值上配置警报
- 七个独立开关的优化模块
- 诊断引擎,具备按区块热点排名和严重程度分级的发现结果
- 基于测量样本生成的配置建议(绝不自动应用)
- 按需进行的插件性能诊断
- 自适应性能守护程序,支持回退和分阶段恢复
- 自我监控:按子系统分配预算,超预算的模块将被挂起
命令
| 命令 |
描述 |
权限 |
发送者 |
/servertune / /servertune status |
优化器状态 |
servertune.use |
两者 |
/servertune version |
插件、作者、API 和服务器版本 |
servertune.use |
两者 |
/servertune reload |
重新加载配置并刷新模块/诊断信息 |
servertune.reload |
两者 |
/servertune recommendations |
来自上次采样的建议配置更改 |
servertune.recommendations |
两者 |
/servertune diagnose |
分析最新缓存的诊断快照 |
servertune.diagnose |
两者 |
/servertune diagnose --force |
强制进行主线程受限采样 |
servertune.diagnose.force |
两者 |
/servertune diagnose plugins [seconds] |
临时性的插件事件分析 |
servertune.diagnose.plugins |
两者 |
/servertune diagnose plugins cancel |
停止正在运行的分析窗口 |
servertune.diagnose.plugins |
两者 |
/servertune profile [name] |
显示每个配置文件解析到的间隔 |
servertune.use |
两者 |
/servertune chunks |
缓存的区块总数 + 模块状态 |
servertune.use |
两者 |
/servertune entities |
实体总数 + 模块状态 |
servertune.use |
两者 |
/servertune op |
列出在线玩家的运算符及其延迟 |
servertune.op |
两者 |
/servertune datapack |
按需静态数据包风险扫描 |
servertune.datapack |
两者 |
/servertune modules |
列出已启用和禁用的模块(只读) |
servertune.use |
两者 |
/servertune debug |
各子系统的执行时间 |
servertune.admin |
两者 |
/servertune debug selfmonitor [on|off|status] |
运行时切换 SelfMonitor 控制台日志记录 |
servertune.admin |
两者 |
/servertune debug selfmonitor verbose [on|off] |
详细的 SelfMonitor 日志;基础切换 |
servertune.admin |
两者 |
/servertune discord status |
Discord 集成状态 |
servertune.use |
两者 |
/servertune discord test |
通过配置的传输通道发送测试嵌入消息 |
servertune.discord.test |
两者 |
/servertune discord reload |
重新读取 Discord 设置/密钥 |
servertune.discord.reload |
两者 |
/servertune health |
TPS、MSPT、CPU、内存、玩家、区块、实体、状态 |
serverhealth.use |
两者 |
/servertune health version |
插件和服务器版本 |
serverhealth.use |
两者 |
/servertune health chunks |
缓存的已加载区块总数 |
serverhealth.use |
两者 |
/servertune health entities |
实体总数及主要类型 |
serverhealth.use |
两者 |
/servertune health plugins |
已安装的插件及其启用状态 |
serverhealth.use |
两者 |
/servertune health datapacks |
已启用和禁用的数据包 |
serverhealth.use |
两者 |
/servertune health diagnose |
来自上次采样的按严重程度分类的发现结果 |
serverhealth.diagnose |
两者 |
/servertune health hotspots |
来自上次采样的得分最高的区块 |
serverhealth.diagnose |
两者 |
/servertune health live / /servertune health live stop |
仅针对玩家的缓存健康更新 |
serverhealth.use |
仅限玩家 |
/servertune health debug |
收集器时间及内部状态 |
serverhealth.admin |
两者 |
/servertune core |
紧凑的核心指标 |
serverhealth.core |
两者 |
权限
默认情况下所有权限都归属于 op;servertune.* 授予全部权限。
权限继承: 每个 /servertune 子命令还需要 servertune.use。Paper 注册的 /servertune diagnose 分支额外需要 servertune.diagnose,包括其 --force 和 plugins 子项。对于强制诊断,请授予以下三项权限:servertune.use、servertune.diagnose 和 servertune.diagnose.force。每个 /servertune health 子命令还需要 serverhealth.use;/servertune core 使用其独立的 serverhealth.core 权限。
| 权限 |
默认值 |
用途 |
serverhealth.use |
op |
只读健康视图 |
serverhealth.core |
op |
/servertune core |
serverhealth.diagnose |
op |
读取现有样本:diagnose、hotspots |
serverhealth.admin |
op |
/servertune health debug |
serverhealth.alert |
op |
接收警报和守卫状态变更(非命令节点) |
servertune.use |
op |
/servertune 的基础访问权限;单独授予时不提升任何子级权限 |
servertune.reload |
op |
重新加载配置 |
servertune.recommendations |
op |
查看建议(只读;不会修改任何内容) |
servertune.diagnose |
op |
读取缓存的诊断快照;同时也是已注册诊断分支的父级门控权限 |
servertune.diagnose.force |
op |
请求新的强制扫描;不由 servertune.diagnose 隐含授予 |
servertune.diagnose.plugins |
op |
启动/停止临时插件事件性能分析;不由缓存读取权限隐含授予 |
servertune.op |
op |
查看操作员列表 |
servertune.datapack |
op |
请求静态数据包风险扫描 |
servertune.admin |
op |
调试输出与 SelfMonitor 运行时控制 |
servertune.discord.test |
op |
发送 Discord 测试消息 |
servertune.discord.reload |
op |
重新加载 Discord 配置 |
servertune.* |
op |
授予所有 servertune.* + serverhealth.* 权限 |
兼容性
| 平台 |
支持情况 |
| Java |
25 或更高版本(硬性要求) |
| Spigot / Bukkit |
不支持。仅使用 Paper API |
配置
| 部分 |
控制内容 |
performance.* |
采样配置文件以及健康/深度分析的间隔时间 |
alerts.* |
警告、严重和紧急阈值、冷却时间、恢复通知 |
optimization.modules.* |
各模块的启用开关及其调优。performance.profile 不会更改这些设置 |
fallback.* |
触发与恢复阈值、分阶段恢复延迟 |
performance-guard.* |
状态机、迟滞行为,以及是否允许其主动执行而非仅报告 |
self-monitoring.* |
各子系统的毫秒级预算与日志记录 |
diagnostics.* |
采样预算、过期时间、热点阈值 |
diagnostics.plugin-scan.* |
默认与最大窗口、结果数量、最低置信度 |
recommendations.* |
建议输出 |
优化模块
实体 / 物品 — item 和 xp 合并邻近的物品堆和掉落物,并限制每区块上限;projectile 在指定间隔后移除箭矢和三叉戟;entity 按类别应用全局及每区块上限。前三项默认开启,entity 默认关闭。
红石 / 方块系统 — hopper 通过限制每区块及连接网络的红石漏斗传输和拾取来节流;redstone 在五种模式(从 vanilla 到 aggressive)中对活塞和发射器进行速率限制。两者默认均关闭。
区块 — chunk 卸载超过超时时间的空闲区块,每个周期有上限,并包含出生点区块和显式保护列表。默认关闭。
Discord 集成
ServerTune 包含完整的 Discord 集成,用于服务器通知和性能警报。
传输方式
| 传输方式 |
描述 |
| WEBHOOK |
使用 Discord Webhook URL。简单,无需机器人账号。 |
| BOT |
使用 Discord Bot REST API。需要机器人令牌和频道 ID。支持更丰富的格式。 |
性能与安全
链接
提交错误报告时请包含你的 Paper 和 Java 版本、/optimizer status 输出、启用的模块列表,如果有的话,请附上完整的堆栈跟踪信息。对于性能投诉,请使用 /optimizer debug,这是判断成本是否来自 ServerTune 的最快方法。
如需支持,请联系 Discord -
ServerTune
ServerTune is a highly configurable Paper plugin for server performance monitoring, optimization, diagnostics and fallback protection.
It samples TPS, MSPT, CPU, memory, chunks and entities on a fixed interval. On top of that sit optional optimization modules, an on-demand plugin profiler, and a state machine that pulls the plugin's own work out of the way when the server is already struggling.
Features
- TPS, MSPT, CPU, memory, chunk, entity, player, plugin and datapack monitoring
- Configurable alerts on warning/critical/emergency thresholds
- Seven independently toggleable optimization modules
- Diagnostics engine with per-chunk hotspot ranking and severity-graded findings
- Config recommendations derived from measured samples (never auto-applied)
- On-demand plugin performance diagnostics
- Adaptive performance guard with fallback and staged recovery
- Self-monitoring: per-subsystem budgets, with over-budget modules suspended
Commands
| Command |
Description |
Permission |
Sender |
/servertune / /servertune status |
Optimizer status |
servertune.use |
Both |
/servertune version |
Plugin, author, API and server version |
servertune.use |
Both |
/servertune reload |
Reloads configuration and refreshes modules/diagnostics |
servertune.reload |
Both |
/servertune recommendations |
Suggested config changes from the last sample |
servertune.recommendations |
Both |
/servertune diagnose |
Analyzes latest cached diagnostic snapshot |
servertune.diagnose |
Both |
/servertune diagnose --force |
Fresh bounded main-thread sampling |
servertune.diagnose.force |
Both |
/servertune diagnose plugins [seconds] |
Temporary plugin event profiling |
servertune.diagnose.plugins |
Both |
/servertune diagnose plugins cancel |
Stops running window |
servertune.diagnose.plugins |
Both |
/servertune profile [name] |
Shows what intervals each profile resolves to |
servertune.use |
Both |
/servertune chunks |
Cached chunk totals + module state |
servertune.use |
Both |
/servertune entities |
Entity totals + module states |
servertune.use |
Both |
/servertune op |
Lists operators with ping for online players |
servertune.op |
Both |
/servertune datapack |
On-demand static datapack risk scan |
servertune.datapack |
Both |
/servertune modules |
Lists enabled and disabled modules (read-only) |
servertune.use |
Both |
/servertune debug |
Per-subsystem execution timings |
servertune.admin |
Both |
/servertune debug selfmonitor [on|off|status] |
Toggles SelfMonitor console logging at runtime |
servertune.admin |
Both |
/servertune debug selfmonitor verbose [on|off] |
Verbose SelfMonitor logging; bare toggles |
servertune.admin |
Both |
/servertune discord status |
Discord integration status |
servertune.use |
Both |
/servertune discord test |
Sends a test embed via configured transport |
servertune.discord.test |
Both |
/servertune discord reload |
Re-reads Discord settings/secrets |
servertune.discord.reload |
Both |
/servertune health |
TPS, MSPT, CPU, memory, players, chunks, entities, status |
serverhealth.use |
Both |
/servertune health version |
Plugin and server version |
serverhealth.use |
Both |
/servertune health chunks |
Cached loaded chunk totals |
serverhealth.use |
Both |
/servertune health entities |
Entity totals and top types |
serverhealth.use |
Both |
/servertune health plugins |
Installed plugins and their enabled state |
serverhealth.use |
Both |
/servertune health datapacks |
Enabled and disabled datapacks |
serverhealth.use |
Both |
/servertune health diagnose |
Findings by severity from the last sample |
serverhealth.diagnose |
Both |
/servertune health hotspots |
Highest-scoring chunks from the last sample |
serverhealth.diagnose |
Both |
/servertune health live / /servertune health live stop |
Player-only cached health updates |
serverhealth.use |
Player only |
/servertune health debug |
Collector timings and internal state |
serverhealth.admin |
Both |
/servertune core |
Compact core metrics |
serverhealth.core |
Both |
Permissions
All default to op; servertune.* grants everything.
Permission inheritance: every /servertune subcommand also requires servertune.use. Paper's registered /servertune diagnose branch additionally requires servertune.diagnose, including its --force and plugins children. For forced diagnostics, grant all three: servertune.use, servertune.diagnose and servertune.diagnose.force. Every /servertune health subcommand also requires serverhealth.use; /servertune core uses its separate serverhealth.core permission.
| Permission |
Default |
Purpose |
serverhealth.use |
op |
Read-only health views |
serverhealth.core |
op |
/servertune core |
serverhealth.diagnose |
op |
Reads an existing sample: diagnose, hotspots |
serverhealth.admin |
op |
/servertune health debug |
serverhealth.alert |
op |
Receives alerts and guard state changes (not a command node) |
servertune.use |
op |
Base access required for /servertune; grants no elevated leaf by itself |
servertune.reload |
op |
Reload configuration |
servertune.recommendations |
op |
View recommendations (read-only; changes nothing) |
servertune.diagnose |
op |
Reads the cached diagnostic snapshot; also the parent gate for the registered diagnose branch |
servertune.diagnose.force |
op |
Requests a fresh forced scan; not implied by servertune.diagnose |
servertune.diagnose.plugins |
op |
Starts/stops temporary plugin event profiling; not implied by the cached-read permission |
servertune.op |
op |
Views the operator list |
servertune.datapack |
op |
Requests a static datapack risk scan |
servertune.admin |
op |
Debug output and SelfMonitor runtime controls |
servertune.discord.test |
op |
Send Discord test messages |
servertune.discord.reload |
op |
Reload Discord configuration |
servertune.* |
op |
Grants all servertune.* + serverhealth.* |
Compatibility
| Platform |
Support |
| Java |
25 or newer (hard requirement) |
| Spigot / Bukkit |
Not supported. Uses only Paper APIs |
Configuration
| Section |
Controls |
performance.* |
Sampling profile and the health/deep-analysis intervals |
alerts.* |
Warning, critical and emergency thresholds, cooldowns, recovery notices |
optimization.modules.* |
Per-module enable switches and their tuning. Never changed by performance.profile |
fallback.* |
Trigger and recovery thresholds, staged recovery delays |
performance-guard.* |
The state machine, hysteresis, and whether it may act rather than only report |
self-monitoring.* |
Per-subsystem millisecond budgets and logging |
diagnostics.* |
Sampling budget, staleness, hotspot thresholds |
diagnostics.plugin-scan.* |
Default and maximum window, result count, minimum confidence |
recommendations.* |
Recommendation output |
Optimization modules
Entity / item — item and xp merge nearby stacks and orbs with per-chunk caps; projectile removes arrows and tridents after some intervals ; entity applies global and per-chunk caps by category. The first three are on by default, entity is off.
Redstone / block systems — hopper throttles transfers and pickups with per chunk and connected network limits; redstone rate-limits pistons and dispensers across five modes from vanilla to aggressive. Both off by default.
Chunks — chunk unloads chunks inactive past a timeout, bounded per cycle, with spawn chunk and explicit protection lists. Off by default.
Discord Integration
ServerTune includes a full Discord integration for server notifications and performance alerts.
Transports
| Transport |
Description |
| WEBHOOK |
Uses Discord webhook URL. Simple, no bot account needed. |
| BOT |
Uses Discord Bot REST API. Requires bot token and channel ID. Supports richer formatting. |
Performance & Safety
-
Self-monitoring.
-
Fallback.
-
Recommendations
Links
Bug reports should include your Paper and Java versions, /optimizer status output, which modules are enabled, and the full stack trace if there is one. For performance complaints include /optimizer debug the fastest way to tell whether the cost is ServerTune's.
For Support Contact Discord -
评论 0
登录后参与评分
还没有评论,来抢沙发吧