Merge pull request #967 from ludovic111/feat/site-host-a-server
🤖 Agent: merged after verify passed. The site's nav links Host a server; README gains a hosting paragraph; tools/server.py and docs/server-quickstart.txt retired.
This commit is contained in:
@@ -43,6 +43,8 @@ Horizon is downloaded only through **the Horizon launcher**: get it from [playho
|
||||
|
||||
**You need** Minecraft: Java Edition installed with the official launcher, with 26.3 played once; Python 3.10 or newer and Java 25 (a JDK, e.g. Eclipse Temurin 25) for the one-time resource preparation; and a GPU with Vulkan on Linux and Windows, or any Apple Silicon Mac.
|
||||
|
||||
**Host a server:** `horizon-server` is one native program with no Java, one settings file, a command line, a web panel, backups and updates that roll back by themselves. It installs with one command (`curl -fsSL https://raw.githubusercontent.com/ludovic111/horizon/main/packaging/server/install.sh | sh` on Linux and macOS, `irm https://raw.githubusercontent.com/ludovic111/horizon/main/packaging/server/install.ps1 | iex` on Windows). The guide is at [playhorizon.dev/server](https://playhorizon.dev/server) ([docs/hosting.md](docs/hosting.md)).
|
||||
|
||||
### The launcher
|
||||
|
||||
<table>
|
||||
|
||||
+1
-1
@@ -46,4 +46,4 @@ To play, use [the launcher](../launcher/README.md); the project site is [playhor
|
||||
|
||||
## The earlier Java track (no longer developed)
|
||||
|
||||
- [Java performance packs](java-packs.md), with [Vulkan on your Mac](vulkan.md), [collector comparisons](collectors.md), [profiling](profiling.md), [process memory](process-memory.md) and [tick state](tick-state.md); [server quickstart](server-quickstart.txt).
|
||||
- [Java performance packs](java-packs.md), with [Vulkan on your Mac](vulkan.md), [collector comparisons](collectors.md), [profiling](profiling.md), [process memory](process-memory.md) and [tick state](tick-state.md). The Fabric server starter is retired: [host a server](hosting.md) with horizon-server.
|
||||
|
||||
+2
-3
@@ -28,16 +28,15 @@ is not a measured pause total. Use JFR root pause events for pause analysis.
|
||||
The streaming reader is checked against the JDK's event exporter with both
|
||||
default-GC and ZGC fixtures in CI on Windows, Linux and ARM macOS.
|
||||
|
||||
Developer demo and server launchers accept `--gc default`, `--gc g1` or `--gc zgc`.
|
||||
The developer demo launcher accepts `--gc default`, `--gc g1` or `--gc zgc`.
|
||||
For example:
|
||||
|
||||
```sh
|
||||
python3 tools/runtime.py demo --instance .local/runtime/collector-test --heap 6G --gc zgc --compact-headers
|
||||
python3 tools/server.py run --heap 4G --gc zgc
|
||||
python3 tools/test_jfr.py --gc zgc
|
||||
```
|
||||
|
||||
Prepare demo mods/worlds before comparing. The server retains its EULA requirement.
|
||||
Prepare demo mods/worlds before comparing.
|
||||
Options affect only the launched process; they do not change global Java settings.
|
||||
The collector and compact-header experiments can be tested independently.
|
||||
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
# Java performance packs (no longer developed)
|
||||
|
||||
Before the Rust rewrite, Horizon was a lab for Minecraft Java client performance: pinned Fabric performance packs, distant terrain, an original frame and tick recorder, and client and server starter downloads. This track is **no longer developed**. No release downloads are published; build the packs and starters locally with `python3 tools/build_release.py` (see [Build and run](#build-and-run)). This page keeps its documentation.
|
||||
Before the Rust rewrite, Horizon was a lab for Minecraft Java client performance: pinned Fabric performance packs, distant terrain, an original frame and tick recorder, and client and server starter downloads (the server starter is gone: [horizon-server](hosting.md) replaces it). This track is **no longer developed**. No release downloads are published; build the packs and starters locally with `python3 tools/build_release.py` (see [Build and run](#build-and-run)). This page keeps its documentation.
|
||||
|
||||
## Java packs: Mac starter (out of scope)
|
||||
|
||||
@@ -91,9 +91,9 @@ python3 tools/build_mod.py
|
||||
python3 tools/build_release.py
|
||||
```
|
||||
|
||||
Gitignored `dist/` contains twenty packs, our original instrumentation JAR, client/server starter ZIPs and SHA256SUMS. [mods.lock.json](../packs/mods.lock.json) pins mod versions, exact dependency closure, SHA-1/SHA-512 and source/license; [fabric.lock.json](../packs/fabric.lock.json) pins loader/library SHA-256. Packs use the [Modrinth format](https://support.modrinth.com/en/articles/8802351-modrinth-modpack-format-mrpack). They embed only original project code; third-party mods, game and assets download from their publishers.
|
||||
Gitignored `dist/` contains twenty packs, our original instrumentation JAR, the client starter ZIP and SHA256SUMS. [mods.lock.json](../packs/mods.lock.json) pins mod versions, exact dependency closure, SHA-1/SHA-512 and source/license; [fabric.lock.json](../packs/fabric.lock.json) pins loader/library SHA-256. Packs use the [Modrinth format](https://support.modrinth.com/en/articles/8802351-modrinth-modpack-format-mrpack). They embed only original project code; third-party mods, game and assets download from their publishers.
|
||||
|
||||
The server starter uses Lithium/FerriteCore and `/horizonserver bench <label> <seconds>`. [Server instructions](server-quickstart.txt) cover setup and a baseline. Files are prepared before you accept Minecraft's EULA locally. A 50-active-player workload remains to be measured.
|
||||
The Fabric server starter (Lithium/FerriteCore, `tools/server.py`) was retired on 2026-10-19. To host a server, use [horizon-server](hosting.md) ([playhorizon.dev/server](https://playhorizon.dev/server)); its benchmarks are in [server.md](server.md), section 9.
|
||||
|
||||
Local smoke testing uses the game's built-in limited demo; normal play uses Prism's licensed account authentication:
|
||||
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
Horizon server @PACK_VERSION@ — Minecraft 26.3, Fabric 0.19.5, Java 25
|
||||
|
||||
Install Python 3.10+ and native Java 25. Extract this ZIP and open a terminal here.
|
||||
This starter never downloads the game: download the Minecraft 26.3 server jar
|
||||
yourself (https://www.minecraft.net/download/server while 26.3 is current), then:
|
||||
|
||||
python3 tools/server.py prepare --server-jar PATH/TO/server.jar
|
||||
|
||||
Read Minecraft's EULA at https://www.minecraft.net/eula. Create/edit
|
||||
.local/server/optimized/eula.txt to contain eula=true if you agree, then:
|
||||
|
||||
python3 tools/server.py run --heap 4G
|
||||
|
||||
Windows: use python in place of python3 if needed. Your server jar, mods and
|
||||
assets stay in .local. No game code, third-party mod JARs or credentials are bundled.
|
||||
Lithium and FerriteCore optimize the original simulation/storage; tick rate and
|
||||
vanilla gameplay rules are retained. No Paper-style gameplay configuration.
|
||||
|
||||
From the server console:
|
||||
horizonserver bench populated-50 120
|
||||
horizonserver stop
|
||||
|
||||
From an operator's in-game chat, prefix each command with /. JSON/CSV reports
|
||||
appear in the instance's horizon-benchmarks directory. They record actual peak
|
||||
players, tick execution durations, observed tick count per elapsed second,
|
||||
JVM heap/GC and platform metadata. meanRate is tick execution capacity, NOT TPS.
|
||||
An idle server does not establish performance for 50 active players.
|
||||
|
||||
Baseline:
|
||||
python3 tools/server.py prepare --baseline
|
||||
python3 tools/server.py run --baseline --heap 4G
|
||||
|
||||
Use separate world copies with the same seed, settings, Java and maximum heap.
|
||||
Only run one at a time unless you give them distinct ports/resources. When
|
||||
benchmarking 50 players include normal exploration, entity farms, redstone and
|
||||
chunk loading; repeat with 1, 10 and 100. Do not change simulation/view distance
|
||||
between matched runs or turn off game logic to manufacture a speedup.
|
||||
This first release has not been validated under a 50-player real workload.
|
||||
|
||||
Optional Java 25 HotSpot experiment: add --compact-headers to the run command.
|
||||
Reports capture the actual compact object header flag and collector names.
|
||||
Compare against the same workload with the flag omitted; object allocation
|
||||
changes do not establish a whole-server RAM/TPS gain.
|
||||
|
||||
Optional collector comparison: select --gc g1 or --gc zgc on the run command.
|
||||
Match world, player activity, heap, Java and header mode; use one collector at a
|
||||
time. gc_time_ms includes collector cycle accounting, not a measured pause total.
|
||||
Use JFR pause events for pause analysis and compare RSS/CPU/TPS together.
|
||||
|
||||
Compare generated reports:
|
||||
python3 tools/compare_benchmarks.py baseline-ticks.json optimized-ticks.json --strict
|
||||
|
||||
Baseline must be a separate instance: --baseline adds no optimizers but doesn't
|
||||
delete mods from an existing optimized instance. Use clean directories.
|
||||
+3
-4
@@ -7,8 +7,9 @@ should beat vanilla, Paper and Fabric + Lithium on TPS/MSPT, RAM, CPU, chunk gen
|
||||
Gameplay stays vanilla: there are no Paper-style rule changes unless the owner turns one on.
|
||||
|
||||
This page covers what the server does today (measured), the design of `horizon-server`, and what ships for the
|
||||
first working version (2026-10-23). It replaces the Java/Fabric starter (`docs/server-quickstart.txt`,
|
||||
`tools/server.py`), which goes once the benchmark below exists.
|
||||
first working version (2026-10-23). It replaced the Java/Fabric starter (`docs/server-quickstart.txt`,
|
||||
`tools/server.py`, retired on 2026-10-19). The owner's guide is docs/hosting.md, also at
|
||||
https://playhorizon.dev/server.
|
||||
|
||||
## 1. Today
|
||||
|
||||
@@ -574,8 +575,6 @@ machine, then published in `benchmarks/`; and item 5.
|
||||
- a server-only prepare without a JDK;
|
||||
- a Windows service, hot reload, modpacks in the panel;
|
||||
- Paper and Fabric + Lithium in the benchmark;
|
||||
- the website's "host a server" page;
|
||||
- retiring `tools/server.py` and `docs/server-quickstart.txt` (once the benchmark replaces them).
|
||||
|
||||
Online mode works, so a public server can check accounts. An offline server should still run only on a
|
||||
LAN, a tailnet, or behind a whitelist.
|
||||
|
||||
+3
-11
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Create downloadable client/server starters and hashes from original project artifacts."""
|
||||
"""Create the downloadable client starter and hashes from original project artifacts. (The Java/Fabric server
|
||||
starter is gone: horizon-server replaces it, docs/hosting.md.)"""
|
||||
|
||||
import hashlib
|
||||
from pathlib import Path
|
||||
@@ -27,15 +28,6 @@ def main():
|
||||
client["Compare-Benchmarks.html"] = viewer
|
||||
(ROOT / "dist/Compare-Benchmarks.html").write_bytes(viewer)
|
||||
build_pack.write_zip(ROOT / "dist" / f"horizon-mac-starter-{version}.zip", client)
|
||||
server = {"LICENSE": client["LICENSE"], "dist/" + mod.name: mod.read_bytes(),
|
||||
"Compare-Benchmarks.html": viewer,
|
||||
"START-HERE.txt": (ROOT / "docs/server-quickstart.txt").read_text().replace("@PACK_VERSION@", version).encode(),
|
||||
"research-lock.json": (ROOT / "research-lock.json").read_bytes()}
|
||||
for name in ["lab.py", "runtime.py", "server.py", "compare_benchmarks.py"]:
|
||||
server["tools/" + name] = (ROOT / "tools" / name).read_bytes()
|
||||
for name in ["mods.lock.json", "fabric.lock.json"]:
|
||||
server["packs/" + name] = (ROOT / "packs" / name).read_bytes()
|
||||
build_pack.write_zip(ROOT / "dist" / f"horizon-server-starter-{version}.zip", server)
|
||||
artifacts = sorted(path for path in (ROOT / "dist").glob("*") if version in path.name)
|
||||
artifacts.append(ROOT / "dist/Compare-Benchmarks.html")
|
||||
checksums = []
|
||||
@@ -43,7 +35,7 @@ def main():
|
||||
if path.suffix in [".jar", ".mrpack", ".zip", ".html"]:
|
||||
checksums.append(hashlib.sha256(path.read_bytes()).hexdigest() + " " + path.name)
|
||||
(ROOT / "dist/SHA256SUMS.txt").write_text("\n".join(checksums) + "\n")
|
||||
print("Built client/server starters and SHA256SUMS.txt")
|
||||
print("Built the client starter and SHA256SUMS.txt")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Prepare/run a vanilla-rules Fabric server with pinned memory and simulation optimizers."""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
try:
|
||||
from . import lab, runtime
|
||||
except ImportError:
|
||||
import lab
|
||||
import runtime
|
||||
|
||||
ROOT = lab.ROOT
|
||||
|
||||
|
||||
def prepare(instance, baseline=False, server_jar=None):
|
||||
lock, directory = lab.config()
|
||||
launcher = lab.import_server(lock, directory, server_jar)
|
||||
server, libraries = lab.unpack_server(launcher, directory, lock["minecraft"]["version"])
|
||||
libraries = [server, *libraries, *runtime.fabric_libraries()]
|
||||
pack_lock = json.loads((ROOT / "packs/mods.lock.json").read_text())
|
||||
mods = pack_lock["projects"]
|
||||
selection = ["fabric-api"] if baseline else ["fabric-api", "lithium", "ferrite-core"]
|
||||
mod_dir = instance / "mods"
|
||||
mod_dir.mkdir(parents=True, exist_ok=True)
|
||||
for name in selection:
|
||||
entry = mods[name]
|
||||
source = runtime.fetch(entry["url"], ROOT / ".local/pack-cache" / entry["filename"],
|
||||
entry["hashes"]["sha512"], "sha512")
|
||||
shutil.copyfile(source, mod_dir / entry["filename"])
|
||||
original = ROOT / "dist" / f"horizon-{pack_lock['pack_version']}.jar"
|
||||
if not original.exists():
|
||||
raise FileNotFoundError("Build the original mod first with tools/build_mod.py, or use the server starter ZIP")
|
||||
runtime.install_original_mod(original, mod_dir)
|
||||
return libraries
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("command", choices=["prepare", "run"])
|
||||
parser.add_argument("--instance", type=Path, default=ROOT / ".local/server/optimized")
|
||||
parser.add_argument("--heap", default="4G")
|
||||
parser.add_argument("--server-jar", type=Path, help="the pinned server jar you downloaded yourself")
|
||||
parser.add_argument("--baseline", action="store_true", help="Use a separate instance for the baseline")
|
||||
parser.add_argument("--compact-headers", action="store_true", help="Enable Java 25 compact object headers for this server process")
|
||||
parser.add_argument("--gc", choices=["default", "g1", "zgc"], default="default", help="Select a collector for this process; default leaves JVM policy in use")
|
||||
args = parser.parse_args()
|
||||
if not re.fullmatch(r"[1-9][0-9]*[MGmg]", args.heap):
|
||||
parser.error("--heap must look like 4G")
|
||||
instance = args.instance.resolve()
|
||||
if args.baseline and args.instance == parser.get_default("instance"):
|
||||
instance = ROOT / ".local/server/baseline"
|
||||
libraries = prepare(instance, args.baseline, args.server_jar)
|
||||
if args.command == "prepare":
|
||||
print(f"Prepared server at {instance}. Read https://www.minecraft.net/eula before setting eula=true locally.")
|
||||
return
|
||||
eula = instance / "eula.txt"
|
||||
if not eula.exists() or not re.search(r"(?m)^\s*eula\s*=\s*true\s*$", eula.read_text()):
|
||||
if not eula.exists():
|
||||
eula.write_text("# Read https://www.minecraft.net/eula then change this value yourself.\neula=false\n")
|
||||
print(f"Server prepared. Read Minecraft's EULA and set eula=true in {eula} before running.")
|
||||
return
|
||||
subprocess.run(["java", *runtime.jvm_options(args.heap, args.compact_headers, args.gc),
|
||||
"--enable-native-access=ALL-UNNAMED",
|
||||
"-cp", os.pathsep.join(map(str, libraries)), "net.fabricmc.loader.impl.launch.knot.KnotServer",
|
||||
"--nogui"], cwd=instance, check=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -45,6 +45,7 @@
|
||||
<a href="#patch-notes">Notes</a>
|
||||
<a href="#community">Community</a>
|
||||
<a href="#contributors" data-contributors{{CONTRIBUTORS_HIDDEN}}>Contributors</a>
|
||||
<a href="/server">Server</a>
|
||||
</nav>
|
||||
<div class="nav-end">
|
||||
<button class="theme-toggle" type="button" aria-label="Switch between light and dark"><span data-theme-label>Dark</span></button>
|
||||
@@ -64,6 +65,7 @@
|
||||
<a href="#patch-notes">Patch notes</a>
|
||||
<a href="#community">Community</a>
|
||||
<a href="#contributors" data-contributors{{CONTRIBUTORS_HIDDEN}}>Contributors</a>
|
||||
<a href="/server">Host a server</a>
|
||||
</nav>
|
||||
<div class="menu-foot">
|
||||
<a class="button secondary large" href="https://github.com/ludovic111/horizon">GitHub</a>
|
||||
|
||||
+2
-1
@@ -125,7 +125,8 @@ async function setUpLinks() {
|
||||
|
||||
function setUpNav() {
|
||||
const bar = document.querySelector(".nav");
|
||||
const links = [...document.querySelectorAll(".nav-links a")];
|
||||
// The sections on this page (the nav also links to other pages, such as /server).
|
||||
const links = [...document.querySelectorAll('.nav-links a[href^="#"]')];
|
||||
const sections = links.map((a) => document.querySelector(a.getAttribute("href")));
|
||||
|
||||
let current = null;
|
||||
|
||||
Reference in New Issue
Block a user