Free tool
Minecraft Start File Generator
Create the start.bat (Windows) or start.sh (Linux) file to launch your server with optimal settings.
On Pterodactyl don't use a start.bat: paste these flags into the Java arguments field (Startup tab in the panel). Don't include -Xmx or -Xms; the panel assigns RAM for you.
Flags for Pterodactyl
-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20
Pick your environment above. If your server is on TaroHosting, use the Pterodactyl mode: RAM and startup are already managed in your panel.
Flags help. The CPU decides.
With this start file Java stops pausing your world and you gain TPS. What flags can't fix is an oversold node: if the server still crawls with an optimized startup, the problem is underneath it.