
一款适用于 Fabric 的轻量级服务端优化模组,通过智能分配计算预算,确保服务器在高负载下依然流畅运行。
Scalable 能够自然地“扩展”服务器性能。它非常适合大型服务器或配置较低的环境。
其结果是,即使服务器面临压力,也能保持响应灵敏。
与类似的模组不同,原版机制保持不变,且在正常情况下,即使是观察力最敏锐的玩家也不会察觉到该模组的存在。
安装方法
需要最新版本的 Fabric Loader 和 Fabric API。将 .jar 文件放入 mods 文件夹即可。无需客户端安装。
如果您在 GitHub 上遇到问题,请提交 Issue:
Scalable 究竟做了什么?
在每个服务器刻(tick)开始时,Scalable 会启动一个计时器。区块加载和实体更新照常进行。但如果预算在刻内耗尽,剩余的工作将被延迟到下一个刻处理,而不是导致整个刻超时。
Scalable 设定了时间上限,一旦达到即停止处理。未处理的部分将在下一个刻继续执行。在正常负载下,一切像往常一样每刻都进行处理。在重负载下,不太重要的内容(远处的区块、遥远的实体)会被延迟,但玩家附近的对象始终保持响应。
区块加载
每个刻中,区块按以下顺序排序并处理:
- 延迟区块:来自上一刻的遗留工作(优先处理)
- 高优先级区块:由传送门、末影珍珠加载的区块。
- 玩家分配区块:剩余区块通过轮询调度器分发给各个玩家,每个玩家的队列根据其未来投影位置(基于当前速度)按距离排序。
- 未认领区块:任何未分配给特定玩家的加载区块
如果预算在处理完所有区块前耗尽,剩余的区块将被延迟。
实体更新
实体也具备预算感知能力并按玩家分配:
- 玩家始终优先更新(优先队列)
- 其他实体被分配给最近的玩家,并按轮询顺序更新
- 如果预算耗尽,剩余的实体将在该刻跳过更新
这意味着即使在重负载下,玩家及其周围环境也始终获得最高优先级。您仍然可以打开物品栏、与世界互动并流畅移动。类似于 TT20 等模组在服务器过载时保持交互性的方式。这里的优势在于,从更广泛的角度来看,游戏实际上仍在运行。
配置
配置文件位于 config/scalable.json,并在首次运行时自动创建。
{
"budget_ms": 40,
"max_deferred": 2048
}
| 字段 | 默认值 | 描述 |
|---|---|---|
budget_ms |
40 |
每刻可用于区块加载和实体更新的毫秒数。设置为 -1 启用自动模式(同样为 40ms)。 |
max_deferred |
2048 |
延迟队列中同时保留的最大区块数量。超出部分将被丢弃(先入先出)。 |
passive_collision_interval |
5 |
每个生物每 5 个刻仍会运行一次被动碰撞检测 |
游戏内命令
所有命令都需要操作员权限。
| 命令 | 描述 |
|---|---|
/scalable budget auto |
切换到自动预算模式(40ms) |
/scalable budget <ms> |
设置固定的预算毫秒数(1–50) |
/scalable profile |
显示当前预算模式、MSPT 和 TPS |
/scalable deferred <max> |
设置最大延迟区块队列大小(0–65536) |
/scalable collisions off|always|adaptive |
设置实体碰撞处理的频率 |
通过命令进行的更改会立即保存到 scalable.json。
局限性
注意: Scalable 可以平滑卡顿峰值并为您的服务器争取喘息空间。它无法消除因持续占用全部刻预算(例如极端数量的实体)而导致的卡顿,但在解决根本原因之前,它会显著改善体验。
- 实体不会跨刻延迟:如果预算在实体循环中途耗尽,这些实体将简单地在该帧不更新。实体的跨刻延迟功能尚未实现。
- 持续的严重卡顿:来自实体或其他非区块源的重度卡顿仍可能导致 TPS 下降,直到这些源头被解决。

A lightweight server-side optimization mod for Fabric that keeps your server running smoothly under load by intelligently budgeting work.
Scalable naturally "scales" the server performance. It works great for large servers or a low budget.
The result is a server that stays responsive even when it's struggling.
Unlike similar mods, vanilla mechanics stay intact and the mod wont be noticed by even the most observant players under normal conditions.
Installation
Requires the latest version of Fabric Loader and Fabric API. Drop the .jar into your mods folder. No client installation required.
Please let me know if you have issues on github by making an issue:
What does Scalable actually do?
At the start of every server tick, Scalable starts a timer. Chunk ticking and entity ticking proceed normally. But if the budget runs out mid tick, remaining work is deferred to the next tick rather than causing the entire tick to overrun.
Scalable sets a time limit and stops when it's hit. The unprocessed remainder is picked back up next tick. Under normal load, everything is ticked every tick as usual. Under heavy load, less important things (far away chunks, distant entities) are delayed, but the things closest to players stay responsive.
Chunk ticking
Chunks are sorted and processed in this order each tick:
- Deferred chunks from the previous tick (carried over work gets priority)
- Priority chunks those loaded by portals, ender pearls.
- Player-assigned chunks remaining chunks are distributed across players using a round-robin scheduler, with each player's queue sorted by proximity to their projected future position (based on their current velocity).
- Unclaimed chunks any ticking chunks not assigned to a specific player
If the budget runs out before all chunks are processed, the leftovers are deferred.
Entity ticking
Entities are also budget-aware and player-assigned:
- Players are always ticked first (priority queue)
- Other entities are assigned to their nearest player and ticked in round-robin order
- If the budget runs out, remaining entities are simply skipped for that tick
This means that even under heavy load, players and their immediate surroundings are always prioritized. You can still open inventories, interact with the world, and move around smoothly. Similar to how mods like TT20 keep the server interactive even when it's overloaded. The advantage here is that the game is actually still running in a broader sense.
Configuration
Config file is at config/scalable.json and is created automatically on first run.
{
"budget_ms": 40,
"max_deferred": 2048
}
| Field | Default | Description |
|---|---|---|
budget_ms |
40 |
Milliseconds per tick available for chunk and entity ticking. Set to -1 for automatic mode (also 40ms). |
max_deferred |
2048 |
Maximum number of chunks that can be held in the deferred queue at once. Excess entries are dropped (oldest first). |
passive_collision_interval |
5 |
Each mob still runs the pass once every 5 ticks |
In-game commands
All commands require operator.
| Command | Description |
|---|---|
/scalable budget auto |
Switch to automatic budget mode (40ms) |
/scalable budget <ms> |
Set a fixed budget in milliseconds (1–50) |
/scalable profile |
Show current budget mode, MSPT, and TPS |
/scalable deferred <max> |
Set the max deferred chunk queue size (0–65536) |
/scalable collisions off|always|adaptive |
Set how often entity collisions are handled |
Changes made via commands are saved to scalable.json immediately.
Limitations
Note: Scalable smooths out lag spikes and buys your server breathing room. It won't eliminate lag caused by something consistently eating your entire tick budget (e.g. extreme entity counts), but it will make things significantly more bearable while you address the root cause.
- Entities are not deferred between ticks if the budget runs out mid-entity-loop, those entities simply don't tick that frame. Deferred entity carry-over is not yet implemented.
- Consistent heavy lag from entities or other non-chunk sources may still cause TPS drops until those sources are addressed.
下载 Scalable
下载 Scalable
下载 Scalable
下载 Scalable
下载 Scalable
下载 Scalable
下载 Scalable
升级了模组排队功能和性能分析,希望它能更轻量且更容易调试
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
缓冲的原始输入和线程化的事件轮询
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
原版世界生成优化模组
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
评论 0
登录后参与评分
还没有评论,来抢沙发吧