With Spigot, it is possible to pin-point potential causes of lag on your server by using the Spigot Timings feature.
To use the timings function, simply type the following into your server console:
After that’s done, you should be given a URL in the console window that would show you your timing results. It is parsed into a way that it easily readable and should give you a pretty good idea of where your lag is coming from.
For other lag troubleshooting methods, check out our other guide: Common Causes of Minecraft Server Lag Issues
If all else has failed and you’re still facing issues with lag in Spigot, Bukkit or Paper versions of Minecraft, you can try using the EntityTrackerFixer plugin to remove large amounts of entities, these are things in the Minecraft World, such as Mobs, Items, dropped items, etc.
EntityTrackerFixer will automatically remove any excessive entities once it detects the servers TPS (Ticks Per Second) has fallen below 19.5