ServerTune
ServerTune 是一个高度可配置的 Paper 插件,用于服务器性能监控、优化、诊断和故障保护。
它按固定间隔采样 TPS、MSPT、CPU、内存、区块和实体。在此基础上,它还包含可选的优化模块、按需运行的插件分析器,以及一个状态机:当服务器已经陷入困境时,该状态机会将插件自身的工作暂停,以避免加重负担。
功能
- 监控 TPS、MSPT、CPU、内存、区块、实体、玩家、插件和数据包
- 针对警告/严重/紧急阈值配置警报
- 七个独立开关的优化模块
- 诊断引擎,提供按区块热点排名和严重程度分级的发现结果
- 基于测量样本生成的配置建议(绝不自动应用)
- 按需进行的插件性能诊断
- 自适应性能防护,支持故障降级和分阶段恢复
- 自监控:按子系统划分预算,超预算的模块将被挂起
命令
三个命令树。/serverhealth(简写 sh, health)用于读取信息,/optimizer(简写 opt, optimize, servertune, st)用于控制,/serverhealthcore(简写 shc, healthcore)为单屏摘要视图。不带子命令的 /serverhealth 和 /optimizer 分别运行健康概览和状态查询。
| 命令 |
描述 |
权限 |
/serverhealth |
TPS, MSPT, CPU, 内存, 玩家, 区块, 实体, 状态 |
serverhealth.use |
/serverhealth version |
插件、服务器和 Bukkit 版本信息 |
serverhealth.use |
/serverhealth chunks |
已加载区块总数、各世界计数、加载/卸载速率 |
serverhealth.use |
/serverhealth entities |
实体总数及主要类型 |
serverhealth.use |
/serverhealth plugins |
已安装的插件及其启用状态 |
serverhealth.use |
/serverhealth datapacks |
已启用和禁用的数据包 |
serverhealth.use |
/serverhealth diagnose |
上次采样中的发现结果(按严重程度分类),附带采样时间 |
serverhealth.diagnose |
/serverhealth hotspots |
上次采样中得分最高的区块 |
serverhealth.diagnose |
/serverhealth live / live stop |
自动刷新视图,2 秒更新,上限 5 分钟 |
serverhealth.use |
/serverhealth debug |
采集器计时和内部状态 |
serverhealth.admin |
/serverhealthcore |
精简的核心指标 |
serverhealth.core |
/optimizer status |
配置文件、间隔、模块数量、当前性能、功能开关 |
optimizer.use |
/optimizer version |
插件、作者、API 和服务器版本 |
optimizer.use |
/optimizer chunks / entities |
总数及相关模块的状态 |
optimizer.use |
/optimizer profile [name] |
显示每个配置文件解析出的间隔。仅检查 — 切换需编辑 config.yml |
optimizer.use |
/optimizer reload |
重新读取 config.yml 并应用到所有活动组件 |
optimizer.reload |
/optimizer recommendations |
基于上次采样的建议配置更改 |
optimizer.recommendations |
/optimizer diagnose |
与 /serverhealth diagnose 相同的诊断结果 |
optimizer.diagnose |
/optimizer diagnose plugins [3-60] |
启动临时插件分析窗口(默认 10 秒) |
optimizer.diagnose.plugins |
/optimizer diagnose plugins cancel |
停止正在运行的窗口并报告其观察结果 |
optimizer.diagnose.plugins |
/optimizer debug |
按子系统的执行计时 |
optimizer.admin |
/optimizer debug selfmonitor [on|off|status] |
在运行时切换 SelfMonitor 控制台日志;不修改 config.yml |
optimizer.admin |
/optimizer debug selfmonitor verbose [on|off] |
详细 SelfMonitor 日志;不带参数则切换 |
optimizer.admin |
/optimizer discord status |
Discord 集成状态、传输层、分发器、队列、警报 |
optimizer.use |
/optimizer discord test |
通过配置的传输层发送测试嵌入消息 |
optimizer.discord.test |
/optimizer discord reload |
重新加载 Discord 配置和密钥,重建传输层/分发器 |
optimizer.discord.reload |
权限
默认均需要 op 权限;servertune.* 授予所有权限。
| 权限 |
默认值 |
用途 |
serverhealth.use |
op |
只读健康视图 |
serverhealth.core |
op |
/serverhealthcore |
serverhealth.diagnose |
op |
读取现有样本:diagnose, hotspots |
serverhealth.admin |
op |
/serverhealth debug |
serverhealth.alert |
op |
接收警报和防护状态变更(非命令节点) |
optimizer.use |
op |
只读优化器视图 |
optimizer.reload |
op |
重新加载配置 |
optimizer.recommendations |
op |
查看建议(只读;不会做任何更改) |
optimizer.diagnose |
op |
读取周期性采样数据 |
optimizer.diagnose.plugins |
op |
启动测量。 特意与 optimizer.diagnose 分离 — 其他所有诊断子命令都读取已存在的样本,而此命令会暂时包装其他插件的事件处理器。授予低成本读取权限不应同时授予测量权限。 |
optimizer.admin |
op |
调试输出和 SelfMonitor 运行时控制 |
optimizer.discord.test |
op |
发送 Discord 测试消息 |
optimizer.discord.reload |
op |
重新加载 Discord 配置 |
兼容性
| 平台 |
支持情况 |
| 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
Three trees. /serverhealth (sh, health) reads, /optimizer (opt, optimize, servertune, st) controls, /serverhealthcore (shc, healthcore) is a one-screen summary. Bare /serverhealth and /optimizer run the health overview and status respectively.
| Command |
Description |
Permission |
/serverhealth |
TPS, MSPT, CPU, memory, players, chunks, entities, status |
serverhealth.use |
/serverhealth version |
Plugin, server and Bukkit versions |
serverhealth.use |
/serverhealth chunks |
Loaded chunk totals, per-world counts, load/unload rates |
serverhealth.use |
/serverhealth entities |
Entity totals and the top types |
serverhealth.use |
/serverhealth plugins |
Installed plugins and their enabled state |
serverhealth.use |
/serverhealth datapacks |
Enabled and disabled datapacks |
serverhealth.use |
/serverhealth diagnose |
Findings by severity from the last sample, with the sample's age |
serverhealth.diagnose |
/serverhealth hotspots |
Highest-scoring chunks from the last sample |
serverhealth.diagnose |
/serverhealth live / live stop |
Auto-refreshing view, 2 s updates, 5 min cap |
serverhealth.use |
/serverhealth debug |
Collector timings and internal state |
serverhealth.admin |
/serverhealthcore |
Compact core metrics |
serverhealth.core |
/optimizer status |
Profile, intervals, module count, current performance, feature switches |
optimizer.use |
/optimizer version |
Plugin, author, API and server version |
optimizer.use |
/optimizer chunks / entities |
Totals plus the relevant modules' states |
optimizer.use |
/optimizer profile [name] |
Shows what intervals each profile resolves to. Inspects only — switching means editing config.yml |
optimizer.use |
/optimizer reload |
Re-reads config.yml and re-applies it to every live component |
optimizer.reload |
/optimizer recommendations |
Suggested config changes from the last sample |
optimizer.recommendations |
/optimizer diagnose |
Same diagnosis as /serverhealth diagnose |
optimizer.diagnose |
/optimizer diagnose plugins [3-60] |
Starts a temporary plugin profiling window (default 10 s) |
optimizer.diagnose.plugins |
/optimizer diagnose plugins cancel |
Stops a running window and reports what it observed |
optimizer.diagnose.plugins |
/optimizer debug |
Per-subsystem execution timings |
optimizer.admin |
/optimizer debug selfmonitor [on|off|status] |
Toggles SelfMonitor console logging at runtime; does not touch config.yml |
optimizer.admin |
/optimizer debug selfmonitor verbose [on|off] |
Verbose SelfMonitor logging; bare form toggles |
optimizer.admin |
/optimizer discord status |
Discord integration status, transport, dispatcher, queues, alerts |
optimizer.use |
/optimizer discord test |
Sends a test embed via configured transport |
optimizer.discord.test |
/optimizer discord reload |
Reloads Discord config and secrets, recreates transport/dispatcher |
optimizer.discord.reload |
Permissions
All default to op; servertune.* grants everything.
| Permission |
Default |
Purpose |
serverhealth.use |
op |
Read-only health views |
serverhealth.core |
op |
/serverhealthcore |
serverhealth.diagnose |
op |
Reads an existing sample: diagnose, hotspots |
serverhealth.admin |
op |
/serverhealth debug |
serverhealth.alert |
op |
Receives alerts and guard state changes (not a command node) |
optimizer.use |
op |
Read-only optimizer views |
optimizer.reload |
op |
Reload configuration |
optimizer.recommendations |
op |
View recommendations (read-only; changes nothing) |
optimizer.diagnose |
op |
Reads the periodic sample |
optimizer.diagnose.plugins |
op |
Starts a measurement. Deliberately separate from optimizer.diagnose — every other diagnose subcommand reads a sample that already exists, while this one temporarily wraps other plugins' event handlers. Granting the cheap read should not grant the measurement. |
optimizer.admin |
op |
Debug output and SelfMonitor runtime controls |
optimizer.discord.test |
op |
Send Discord test messages |
optimizer.discord.reload |
op |
Reload Discord configuration |
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
登录后参与评分
还没有评论,来抢沙发吧