perf(config): 2 chunk workers instead of 1, gen-parallelism on
Build Delta / Build paperclip jar (push) Successful in 7m9s

worker-threads: -1 means "auto", and auto on 4 cores resolves to ONE worker.
MoonriseCommon.adjustWorkerThreads halves availableProcessors and then, if the
result is <= 4, collapses it further - 4/2=2, and 2<=3 becomes 1. That single
thread generated the spawn region serially.

Measured on zern.cc (4 vCPU, 8 GB), same jar, same flags, cold world vs warm:

                    before   after
  cold, overworld     6770ms  2944ms
  cold, nether        1368ms   888ms
  cold, total         38.5s   24.9s
  warm, overworld     1084ms   803ms
  warm, total         16.4s   12.2s

gen-parallelism "default" already resolved to true at startup, so it is now
spelled out rather than left to string comparison at boot.

3 workers is deliberately NOT set here. The main thread plus Netty share the
same 4 cores, and going to 3 trades main-thread headroom for generation that
does not happen every tick. That needs a profile, not a guess.

Also recorded the corollary: player-max-concurrent-chunk-generates is a rate
limiter, not an accelerator. Speeding up generation without raising it just
makes the engine faster behind a throttle that was sized for the old speed.
This commit is contained in:
SashegDev
2026-10-03 11:58:59 +00:00
parent 5186c9b0e2
commit be3bfc2369
2 changed files with 18 additions and 6 deletions
+10 -3
View File
@@ -47,10 +47,17 @@
- `entities.spawning.spawn-limits` — потолок мобов на чанк. - `entities.spawning.spawn-limits` — потолок мобов на чанк.
### `paper-global.yml` ### `paper-global.yml`
- `chunk-system.io-threads: 2`, `worker-threads: -1` — не даём - **`chunk-system.worker-threads: 2`** — самый недооценённый рычаг. `auto`
чанковой системе съесть 4 ядра. (`-1`) на 4 ядрах даёт **1 воркер**, и генерация чанков идёт
последовательно: Moonrise делит `availableProcessors` пополам, а на
результате 2 опускается до 1, оставляя место главному треду.
Замерено: холодный старт **38.5 → 24.9 с**, тёплый **16.4 → 12.2 с**.
Значение 3 — только с профилем, главному треду на 4 ядрах нужно дышать.
- `chunk-system.io-threads: 2`, `gen-parallelism: true`.
- `chunk-loading.advanced.player-max-concurrent-chunk-loads/generates` — - `chunk-loading.advanced.player-max-concurrent-chunk-loads/generates` —
защита от флуда генерацией при скоростном облёте. защита от флуда генерацией при скоростном облёте. **При ускорении
генерации этот потолок надо поднимать**, иначе движер быстрее, а
ограничитель остался прежним.
## Что НЕ трогаем ## Что НЕ трогаем
- Moonrise (чанковая система) — уже многопоточный, отдельный патч не нужен. - Moonrise (чанковая система) — уже многопоточный, отдельный патч не нужен.
+8 -3
View File
@@ -2,9 +2,14 @@
# Копировать в <сервер>/config/paper-global.yml # Копировать в <сервер>/config/paper-global.yml
chunk-system: chunk-system:
worker-threads: -1 # авто под 4 vCPU (Paper сам считает) # worker-threads: -1 (auto) на 4 ядрах даёт 1 воркер, и генерация чанков
io-threads: 2 # сидеть на 4 ядрах # идёт последовательно. Moonrise делит availableProcessors пополам, а на
gen-parallelism: "default" # результате 2 опускается до 1, чтобы оставить место главному треду и Netty.
# 2 воркера: холодный старт 38.5с -> 24.9с, тёплый 16.4с -> 12.2с.
# 3 пробовать только с замером: главному треду на 4 ядрах нужно дышать.
worker-threads: 2
io-threads: 2
gen-parallelism: true
chunk-loading: chunk-loading:
basic: basic: