Wiki/05 - Server Analysis & Debugging
Server Analysis & Debugging
threads
/lt debug threads iterates through every running thread known to the Bukkit server and attributes each one to a plugin. The results are sorted in order of most threads to least threads in use (per plugin). This is not a 100% fail-safe method. A plugin using 8 threads might not necessarily be a bad thing. But if you ever notice a plugin that uses around 30, 80, or maybe 2000 threads, you should look into figuring out ''why'' so many threads are being used. An example of a plugin with a thread leak is Essentials. Every time you reload the server the number of threads it keeps active increases by one. This means it isn't shutting down its own threads properly.
NUKE
'''/lt debug NUKE''' is great for when you need to delete many many files at once. For security reasons it is hard coded to only erase files located in '''./plugins/LumenTech/trash/'''. You will need to drag files into that folder for the NUKE to work. Example uses : Getting rid of old core protect data, or clearing out space from maps you no longer need, or getting rid of dynmap render data.
garbage cleanup
'''/lt debug gc''' runs the garbage cleanup function in Java. This puts extra focus on regaining RAM that is being taken by processes that no longer need it.
plugins
/lt debug plugins Shows an alternate plugin list print out. I might color code it in the future to show which plugins are throwing the most (if any) errors.
stats
/lt debug stats shows some information about RAM available, RAM used, and the number of cores/threads on the current machine. I might add more to this later if I can think of any other ideas. Maybe I'll write a program in C to fetch the CPU usage and then call it from within Java.
log analyze
/lt debug log analyze scans the entire server.log file for errors that plugins have thrown. Though it may not be 100% accurate, it does a great job of summarizing the list of plugins that need to be fixed. To prevent the plugin from becoming too resource intensive I limited this feature to where it will only scan a file if it is less than 20mb in size. I have seen server logs grow to 32gb in size before. If your log is larger than 20mb, you need to erase it and start over anyways. For that reason I also added /lt debug log erase which erases your server.log file. (if you are wondering why LumenTech threw 37 errors, it might be because this is my testing server. So errors do happen.)
log monitor
/lt debug log monitor is a fail safe that I have included for when server.log files are too large to analyze. With the monitor function you can capture errors as they happen. When an error is thrown in console, you will see it in-game (98% of the time). note: vAuth is a terrible plugin that has been known to cause OTHER plugins to throw errors.
disk usage
/lt debug du [path] will tell you how much disk space you've used.
Comments