|
| 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. |
0 commit comments