Performance and Spark
Tune MineDuels for stable MSPT, read Spark profiles, and fix common spike causes.
MineDuels is built for fast arena copies and live UI (scoreboard, tab, nametags). Under load, most multi-second MSPT spikes come from chunk loading, arena paste/reset, server restart, or host contention, not from nametag packets alone.
This guide is for owners who use Spark or similar profilers. It explains what to expect in profiles and which settings to change first.
How to read Spark for MineDuels
| Signal | What it usually means |
|---|---|
Low steady % for dev.mineduels on the server thread | Normal with displays enabled. Timers and match logic run every tick or on intervals. |
High % only during /md reload | Reload merges YAML and rebuilds displays. Take a profile after reload finishes. |
Spike at Done! or plugin enable | Startup: database drivers, PacketEvents mappings, other plugins (LuckPerms is a common multi-second enable). |
| Spike when many players queue at once | Arena copies go to PASTING, teleports load chunks, several matches may start in the same few ticks. |
| Chunks loaded jump by hundreds or thousands | Strong hint the tick was world I/O, not hologram text. |
Percentage beats the label. Seeing MineDuels in the tree does not mean it caused a 2 s tick unless its slice is large for that tick.
Profiling windows that mislead you
Avoid starting Spark in the same minute as:
- Full server restart (first 30 to 120 seconds after joinable).
- Mass bot join + mass
/md queue(stress tests). - First open of every GUI on a cold JVM (menus compile layouts once).
For a fair baseline: stable player count, arenas already READY, wait two minutes, then profile 5 to 10 minutes of normal queue play.
Priority checklist (single-server)
| Priority | Action | Why |
|---|---|---|
| P0 | Keep warm arena copies (arenas/*.yml → copies.min, pool not empty) | Matchmaking blocks on ready copies; cold paste on match start loads chunks. |
| P0 | Pre-paste at boot or low traffic; fix copies stuck on PASTING | Paste and reset are heavy; wedged copies stall queues. |
| P0 | Stagger stress tests (bots joining and queuing in the same second) | Many teleports to the grid world in one tick multiply chunk work. |
| P1 | database.yml → performance.async-displays: true | Scoreboard/tab/nametag text work can run off the main thread where supported. |
| P1 | Tune nametags (update-ticks, placeholder-cache-seconds, reconcile-ticks) | Heavy PlaceholderAPI or LuckPerms in tag lines cost lookups, not missing packet mode. |
| P1 | matchmaking.yml → queue.actionbar.enabled: false if you do not need it | Removes periodic action bar work for everyone in queue. |
| P2 | config.yml → arena budgets (budget-ms, parallel-work, parallel-resets) | Spreads paste/reset work. See config.yml arena. |
| P3 | Lower scoreboard/tab update-ticks only after arenas and host are healthy | Faster UI refresh increases display work linearly. |
Arena copies and chunks
Each kit needs at least one arena template linked and ready copies in the pool (instances.yml is internal state).
Copy pool (arenas/<id>.yml)
copies:
min: 2 # try to keep this many READY copies
max: 4 # upper cap for this templatemin: MineDuels tries to maintain this many idle copies. Higherminuses more grid cells and memory, but reduces paste-on-demand when queues pop.max: Hard cap per template.- If every copy is
IN_USEorPASTING, queue matchmaking waits (matchmaking does not pair without a ready arena).
Grid world (config.yml → arena)
spacingmust fit the largest template (often 512+ on Folia).budget-ms,parallel-work, andparallel-resetsspread work across ticks. Defaults are safe; lower budgets smooth ticks but slow resets.
Typical spike pattern (many players queuing)
- Queue pairs players.
- Copies transition paste → reset → teleport.
- Chunk count rises sharply (hundreds to thousands of new chunks in one window).
- MSPT max spikes; median MSPT may stay low.
Mitigation: raise copies.min for busy kits, pre-generate or keep the arena world loaded, avoid running soak tests immediately after restart.
Details: Creating kits and arenas, kits/ and arenas/.
Displays: scoreboard, tab, nametags
All three read YAML on /md reload and refresh on timers.
| File | Default interval | Notes |
|---|---|---|
scoreboard.yml | update-ticks: 20 | Sidebar per player state |
tab.yml | update-ticks: 20 | May refresh faster when an animation line needs it |
nametags.yml | update-ticks: 40 | Hologram mode uses PacketEvents; see Nametags UI |
With database.yml → performance.async-displays: true, much of the string building for displays can run on MineDuels' display thread. Packets for hologram nametags still send from the main thread when something visible changes (health, sneak, teleports, line text).
Nametags and Spark
In hologram mode, tags are packet-based (no scoreboard teams). Spark may still show NameTagService or hologram classes on timer ticks because:
- Lines with static MineDuels keys still reconcile on
update-ticks. - Lines with external placeholders (rank prefix via PAPI) hit PlaceholderAPI and permission plugins.
hologram.reconcile-ticks(default 400) re-checks every viewer (vanish plugins, tracking).
Tuning:
- Increase
update-ticks(e.g. 40 → 60) for busier hubs. - Set
placeholder-cache-secondsto 15 to 60 when rank/prefix lines rarely change. - Keep
reconcile-ticksat 400 unless vanish desync forces lower.
Full keys: nametags.yml.
Queue and matchmaking load
matchmaking.yml → queue:
tick-interval: how often the matcher runs (default 10 ticks).actionbar.enabled: updates the action bar for queued players. Disable if unused.multi-queue: more kits queued per player means more matcher work, still small compared to arena I/O.
Ranked widening (ranked.step-seconds, range-step, max-range) only affects pairing logic, not paste cost.
Host and JVM
MineDuels cannot fix an undersized VPS:
- High system load with no swap increases GC pauses (young-gen collections over 100 ms show up as MSPT tails).
- Two full Minecraft processes on one host contend for the same cores.
- Many plugins on the same tick as MineDuels matches amplify spikes (anticheat, tab list plugins, region protection).
Give the arena grid world RAM headroom; monitor chunk cache and entity counts during soak tests.
Startup timeline (what to expect)
On a typical restart with MineDuels + PacketEvents + LuckPerms:
- Worlds load.
- Plugins enable (LuckPerms and mapping-heavy plugins often take seconds each).
- MineDuels may paste or validate the arena grid on first enable or when templates changed.
- Only after this window does steady-state profiling apply.
If Spark's maximum MSPT is always at minute zero, fix startup and warm copies before chasing nametag ticks.
FAQ cross-links
| Symptom | Start here |
|---|---|
Copies stuck PASTING | FAQ post-match and arenas + arena section in config.yml |
| Spark shows MineDuels often | FAQ performance |
| TAB conflicts | Nametags (other-scoreboards, mode: hologram) |
| Reload lag | Reload matrix |