[PR #6580] [MERGED] Dedicated server: log slow ticks and vanilla's overload warning #6963

Closed
opened 2026-11-03 06:30:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6580
Author: @ludovic111
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: perf/dedicated-slow-tick-log


📝 Commits (1)

  • c9d0659 Dedicated server: log slow ticks and vanilla's overload warning

📊 Changes

4 files changed (+65 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+9 -0)
📝 crates/horizon-client/src/game/dedicated.rs (+40 -2)
📝 crates/horizon-client/src/game/levels.rs (+12 -3)
📝 docs/hosting.md (+4 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Why

The official server shows 10–13 s freezes. During them, 15 or more players get "moved too quickly" at once. The log never says where the time went: the spike log (HORIZON_SPIKES) is off unless someone sets the variable, and the server catches up without saying anything.

What

  • A dedicated server now times its spans on every tick. Any tick slower than 250 ms goes to the log as the existing Horizon: slow tick line, with its spans. HORIZON_SPIKES still sets a different threshold. The integrated server and the client are unchanged.
  • A server more than two seconds behind already skipped the ticks it missed. It now also logs vanilla's MinecraftServer.runServer warning, at most every 15 s:
    Can't keep up! Is the server overloaded? Running 13027ms or 260 ticks behind
  • docs/hosting.md describes both lines.

Cost

Spans are a handful of Instant::now() calls per tick, not per entity. On the bench (50 bots, playhorizon), the runs already had spans on through HORIZON_SPIKES, so the MSPT numbers in the related perf PRs include this cost.

Tests

  • the_overload_warning_reads_as_vanilla_s (dedicated.rs) checks the message against vanilla's format.
  • On playhorizon (head c9d06599c7): cargo test --profile fast --no-default-features -p horizon-client --lib -- overload (the game module now lives in the lib, so --bin runs 0 tests): test game::dedicated::tests::the_overload_warning_reads_as_vanilla_s ... ok, test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 592 filtered out.
  • cargo clippy --profile fast --no-default-features -p horizon-client --all-targets -- -D warnings: clean. cargo fmt -p horizon-client -- --check: clean.
  • parity.py --changed: CI.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6580 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/dedicated-slow-tick-log` --- ### 📝 Commits (1) - [`c9d0659`](https://github.com/horizon-rust/horizon/commit/c9d06599c7ab249b74ab7ec1fffe4791404cdae9) Dedicated server: log slow ticks and vanilla's overload warning ### 📊 Changes **4 files changed** (+65 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+9 -0) 📝 `crates/horizon-client/src/game/dedicated.rs` (+40 -2) 📝 `crates/horizon-client/src/game/levels.rs` (+12 -3) 📝 `docs/hosting.md` (+4 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## Why The official server shows 10–13 s freezes. During them, 15 or more players get "moved too quickly" at once. The log never says where the time went: the spike log (`HORIZON_SPIKES`) is off unless someone sets the variable, and the server catches up without saying anything. ## What - A dedicated server now times its spans on every tick. Any tick slower than 250 ms goes to the log as the existing `Horizon: slow tick` line, with its spans. `HORIZON_SPIKES` still sets a different threshold. The integrated server and the client are unchanged. - A server more than two seconds behind already skipped the ticks it missed. It now also logs vanilla's `MinecraftServer.runServer` warning, at most every 15 s: `Can't keep up! Is the server overloaded? Running 13027ms or 260 ticks behind` - `docs/hosting.md` describes both lines. ## Cost Spans are a handful of `Instant::now()` calls per tick, not per entity. On the bench (50 bots, playhorizon), the runs already had spans on through `HORIZON_SPIKES`, so the MSPT numbers in the related perf PRs include this cost. ## Tests - `the_overload_warning_reads_as_vanilla_s` (dedicated.rs) checks the message against vanilla's format. - On playhorizon (head c9d06599c7): `cargo test --profile fast --no-default-features -p horizon-client --lib -- overload` (the `game` module now lives in the lib, so `--bin` runs 0 tests): `test game::dedicated::tests::the_overload_warning_reads_as_vanilla_s ... ok`, `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 592 filtered out`. - `cargo clippy --profile fast --no-default-features -p horizon-client --all-targets -- -D warnings`: clean. `cargo fmt -p horizon-client -- --check`: clean. - `parity.py --changed`: CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:30:22 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6963
No description provided.