Search Knowledgebase

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/

 

  • 27 Users Found This Useful

Was this answer helpful?

 Print this Article

Also Read

Reinstalling a modpack on your client

If you are having difficulty connecting to a modded server and you are getting errors like the...

Unable to Connect to Any Minecraft Server - java.net.SocketException: Address family not supported by protocol family: connect

Description When attempting to connect to any server the Minecraft client will time out. The...

Crashing on connecting due to holding a bugged item

This article relates to a client crash that is caused by holding a bugged item in the player's...

How to reset or change the Modpack maps

Map reset script This is a user runnable script that will reset your map to one of the starter...

How to Upgrade or Reinstall your Modded Server

Changing the server option in the control panel does not change the server it just chooses a...