Diagnosing lag issues with a Timings report

If you are running a server with many plugins it can be very difficult to diagnose performance issues.

One way to help is to generate a Timings report. This can help highlight which mods or plugins are potentially causing lag or instability.

Creating a Timings Report

 

  1. Stop your server
  2. Find the bukkit.yml in the root of your server
  3. Change the 'plugin-profiling' option to 'true' (This will make the /timings command available)
  4. Start the server
  5. *Run the command: /timings on
  6. Leave the server running for 5 minutes during lag / wait until a lag spike event you want to analyse
  7. Run the command: /timings merged
  8. The report will be saved to: /timings/timingsN.txt (where N increments for each new report)
  9. **Run the command: /timings paste
  10. **The report will be sent to http://paste.ubuntu.com/
*If using Spigot build 1261 or later, this step is not needed
**Spigot only

/timings commands

/timings on - Starts the profiler (not in Spigot 1261+)
/timings off - Stops the profiler (not in Spigot 1319+)
/timings reset - Clears the profiling data
/timings merged - Creates a single report file
/timings separate - Creates a report file for each active plugin
/timings paste - Sends a report to http://paste.ubuntu.com/ (Spigot only)

Reading the Report

The report will be in the following format:

NameOfPlugin1
TypeOfEvent Time: 999999 Count: 99 Avg: 10101
TypeOfEvent Time: 999999 Count: 99 Avg: 10101
TypeOfEvent Time: 999999 Count: 99 Avg: 10101
TypeOfEvent Time: 999999 Count: 99 Avg: 10101
TypeOfEvent Time: 999999 Count: 99 Avg: 10101
Total time 4999995 (0s)
NameOfPlugin2
TypeOfEvent Time: 999999 Count: 99 Avg: 10101
TypeOfEvent Time: 999999 Count: 99 Avg: 10101
TypeOfEvent Time: 999999 Count: 99 Avg: 10101
TypeOfEvent Time: 999999 Count: 99 Avg: 10101
TypeOfEvent Time: 9999999999 Count: 99 Avg: 1010101
Total time 10003999995 (20s)

Plugins are listed with the CPU time spent on each event type totalled. A total time for that plugin is also shown. You can ignore the Time: values for the most part. The first place to look is the 'Total time' for each plugin. Ignore the really big number and look at the value in the brackets. This is time spent by the server running that plugin during the time between '/timings on' (or '/timings reset', or server start for Spigot) and '/timings merged'.

We can see above that NameOfPlugin1 has spent 0 seconds (less than 1 second) of CPU time whereas NameOfPlugin2 has spent 20 seconds of CPU time. If we were only profiling for 5 minutes, this would represent 1/15 of our total server time. A huge drain!

Looking at the event types, we can see that the last one listed is where all that time is spent. Identifying the event type could help narrow down the conditions that cause the excessive CPU use.

Aikar's Timing Parser

If you are running a Spigot server then you can parse the report generated by the '/timings paste' command in Aikar's Timing Parser:

  1. Copy the text from the http://paste.ubuntu.com/ page into your clipboard
  2. Open http://www.aikar.co/timings.php
  3. Click the 'Paste Contents' button
  4. Paste your clipboard contents into the text box that appears
  5. Click 'Paste'
You can also paste in a standard report.

The Spigot site has a page on reading the Spigot Timings report: http://www.spigotmc.org/wiki/timings/

 

Was this answer helpful?

 Print this Article

Also Read

What is MCPC+ and how do I install MCPC+

This is why you should use MCPC+ with your modded server and how to install MCPC+MCPC+ is God's...

Client crash when joining server - Ticking Screen - Map Writer config error

This crash has been observed on Yogscast Complete but is not limited to that modpack Symptoms...

Ender Storage in Deep Dark Prevents Server Start

The following error occurs when the server starts: java.lang.NullPointerException at...

Enable Biomes O' Plenty

To enable the Biomes O' Plenty mod all you need todo is remove the .disabled of the mod file.This...

Crashing on connecting after riding a vehicle or entity

This article relates to an incompatibility between the Archimedes Ships mod and blocks added by...