Skip to content

Commit 4625ebe

Browse files
committed
feat: profiling (Spark)
1 parent 3de555c commit 4625ebe

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

config/sidebar.paper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const paper: SidebarsConfig = {
3636
items: [
3737
"admin/how-to/basic-troubleshooting",
3838
"admin/how-to/update",
39+
"admin/how-to/profiling",
3940
"admin/how-to/aikars-flags",
4041
"admin/how-to/anti-xray",
4142
"admin/how-to/get-to-vanilla",
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
slug: /profiling
3+
description: How to profile your Minecraft server.
4+
---
5+
6+
# Profiling
7+
8+
Profiling is a way to diagnose performance problems with your server.
9+
A profiler measures certain characteristics of a running server, e.g. how often a method is called
10+
and how much time it takes up in a single tick, how long and often the garbage collector runs and much more.
11+
12+
## Timings
13+
14+
Paper bundles the [Timings v2](https://timings.aikar.co/) profiler, however Timings has been unmaintained
15+
for multiple years and its reports are difficult to read for beginners. It has been deprecated in favor of
16+
Spark and turned off by default in 1.21, see [this discussion](https://github.com/PaperMC/Paper/discussions/10565)
17+
for more information.
18+
19+
## Spark
20+
21+
Starting with 1.21, Paper bundles the [Spark](https://spark.lucko.me/) profiler, which is the preferred way
22+
to profile Paper.
23+
24+
To start profiling your server, run this command:
25+
```
26+
/spark profiler start --timeout 600
27+
```
28+
29+
After 10 minutes, this will return a URL with a profiler report, which you can analyze yourself or provide
30+
to a developer of a plugin or the Paper support chats.
31+
32+
:::warning
33+
34+
_For the profiling to be effective, the issue you are diagnosing must be actively occurring._
35+
36+
:::
37+
38+
This is only a fraction of what Spark can do, so if you want to learn about the different features of Spark
39+
or learn to analyze reports yourself, check out Spark's documentation [here](https://spark.lucko.me/docs/).
40+
41+
If you need help with analyzing a performance issue, please bring a Spark report to the
42+
[PaperMC Discord server](https://discord.gg/PaperMC) (#paper-help) for assistance.

docs/paper/admin/reference/system-properties.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,8 @@ It also remaps plugin CB calls to remove the version information.
215215

216216
- **default**: `false`
217217
- **description**: Disables plugin remapping introduced in 1.20.5 and everything involving automatic plugin conversion by commodore. For more information see the [userdev](../../dev/getting-started/userdev.mdx#1205-and-beyond) documentation and the official [announcement](https://discord.com/channels/289587909051416579/976631292747735080/1232740079097876570).
218+
219+
#### paper.startSparkBackgroundProfilerImmediately
220+
221+
- **default**: `false`
222+
- **description**: Starts the background profiler as soon as possible when set to true. Otherwise the background profiler starts once the server has finished starting up (when the `Done (X.XXXs)! For help, type "help"` message is sent in console).

0 commit comments

Comments
 (0)