[fix] lag on my server

Discussion in 'Performance Tweaking' started by FyFou57, Sep 1, 2018.

  1. hello !
    I have big lag problems on my server I hope you can help me
    Version : PaperSpigot 1.8.8 (with bungee)

    I thought the problem was the mobs, but I often do / killmob / lagg killmob kill 100-300 monsters which is not huge (100-200) and the tps do not rise after ... i have mobstacker
    #1 FyFou57, Sep 1, 2018
    Last edited: Oct 7, 2018
  2. Mobs actually seem to be the issue on your server. I suggest trying to optimize the mob activation ranges and minimize the amount of mobs that spawn.

    Also, your /lagg killmob doesn't seem to clear all mobs. you usually have around 2000 entities alive on your server.

    Not only that, but there was a huge spike in the amount of tile entities. This means blocks that have special behaviours like inventories (chests, hoppers), Text (Signs), etc.

    There was a spike from 14k Tile entities to 28k tile entities. It may mean that a lot of chunks got loaded.

    I suggest investing some time in optimizing your server, from your spigot to your paper spigot configuration.

    I also suggest you to ditch ClearLagg. You can implement all useful optimization features from it via paper.yml, spigot.yml, and bukkit.yml.\
    You shoudn't use that much ram too. Keep it at 12 GB maximum (i'd recommend 8GB but you'll need a lot of optimization for that to work out)
  3. See this thread, is very very useful
  4. Can you try this startup script.
    Code (Text):
    java -Xmx8G -Xms8G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+AggressiveOpts -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -Dusing.aikars.flags=mcflags.emc.gs -jar server.jar
    Replace server.jar with your jar
  5. Optimizes the GC and ram
  6. hire sys admin
  7. You have 20gb assigned to the server, that's way too much, the garbage collector has to do much more work and might cause lag. Try reduce the ram to max 8-10gb. Won't solve completely your issue, but it helps.
  8. Can you try this startup script. Do not edit the ram values.
    Code (Text):
    java -Xmx8G -Xms8G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+AggressiveOpts -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -Dusing.aikars.flags=mcflags.emc.gs -jar server.jar
    Replace server.jar with your jar
  9. Check out this thread by @Celebrimbor : https://www.spigotmc.org/threads/guide-server-optimization‚ö°.283181/ (I believe it just received an update yesterday, it's very updated and maintained, it also has info on PaperSpigot.)

    Also, I recommend these flags in your start bat file:
    Code (Text):
    java -Xms6G -Xmx6G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+AggressiveOpts -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -Dusing.aikars.flags=mcflags.emc.gs -jar spigot.jar
    Source: https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/
  10. your timings say your script is
    Code (Text):
    java -Xmx20480M -Xms20480M -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=45 -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AggressiveOpts -jar Factions.jar -o false
    echo "If you want to completely stop the server process now, press Ctrl+C before
    the time is up!"
    echo "Rebooting in:"
    for i in 5 4 3 2 1
    echo "$i..."
    sleep 1
    echo "Rebooting now!"
    -Xmx20480M -Xms20480M == -Xmx20G -Xms20G
    more ram = less gc = less performance
  11. how about you figure out how set your startup script. your timings report says that the script is
    Code (Text):
    java -Xmx15360M -Xms15360M -jar spigot.jar
  12. I suggest getting an sys admin. Heard @chckn is very good!
  13. I had the same kind of issue before but it was not tps issue, it was ram issue. After a while it was just eating away at my allocated ram for the server and what fixed it was just removing the java arguments in the startup. I've never seen them to work well and some can even impact on the performance. Make sure you have efficiently coded plugins and try limit the amount by making a core that has some small ish things in it. Also, make sure you are clearing entities and have a scheduled reboot every 24 hours

Share This Page