Why is this lagging?

Discussion in 'Performance Tweaking' started by McKidPro, Apr 15, 2017.

  1. You don't need to use PaperSpigot, but, if you have PaperSpigot, you can do the first part of the post.

    Regards.
     
  2. I will try it out, thanks :)
     
  3. electronicboy

    IRC Staff

    Please provide real timings data, the plugin you're using is known over in paper land (and has been proven on spigot itself) to completely screw up the timings output and remove useful information from the output. Paper also has timings v2, which is an improved and more refined version of timings that is more accurate and dumps out more useful information (However, later versions of paper have much more useful information)
     
  4. https://timings.aikar.co/?id=d4c69512305e4a5ea0e1549dba085416

    still lagging ;I
     
  5. Try reducing your tick update rates and whatnot in your spigot and bukkit .yml's.
     
    • Agree Agree x 1
  6. electronicboy

    IRC Staff

    Try reducing the entity activation ranges, you're still on the defaults which are much higher than they need to be, and should help with reducing the overall lag on your server caused by entities, also, 32GB of ram is just stupid for performance, as is using the CMS collector, GC is hitting you a fairly hard, both of the collectors you're using are designed to pause the server while they collect, not only does that hurt your performance because the whole JVM has to pause, in your case, pretty much every second. (actually, even occurring more often than every second).
    https://mcflags.emc.gs/
     
    • Informative Informative x 1
  7. Go into your server folder and open spigot.yml
    Scroll down till you reach world-settings:
    Edit the entity-tracking-range: like this
    Code (Text):
        entity-tracking-range:
          players: 100
          animals: 48
          monsters: 48
          misc: 32
          other: 64
    Your max-tick-time: like this:
    Code (Text):
        max-tick-time:
          tile: 50
          entity: 50
    And your entity-activation-range like this
    Code (Text):
        entity-activation-range:
          animals: 32
          monsters: 32
          misc: 16
    and set mob-spawn-range:
    Code (Text):
        mob-spawn-range: 4
    Let me know if this helped!
     
  8. electronicboy

    IRC Staff

    GC is shitting itself, Xmx should be equal to Xms, otherwise you're going to trigger old gen collections in G1 (in your case, 1/4 of GC collectors are old-gen, which is basically a last resort "scan ALL objects on the heap and try to clean some before I actually request more memory from the OS" (Which, as MC is heavily reliant on short lived objects, doesn't really allow the heap to expand properly, causing this behaviour to just carry on), in which case performs a full GC which will kill performance drastically.
     
  9. My settings is already set lower than your settings

    entity-tracking-range:
    players: 48
    animals: 6
    monsters: 16
    misc: 8
    other: 64

    entity-activation-range:
    animals: 6
    monsters: 16
    misc: 8

    mob-spawn-range: 3

    max-tick-time:
    tile: 50
    entity: 50
     
  10. Code (Text):
    java -Xms12G -Xmx12G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=35 -XX:G1MaxNewSizePercent=60 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AggressiveOpts -XX:+AlwaysPreTouch -Dusing.aikars.flags=mcflags.emc.gs -jar spigot.jar
    is this fine?
     
  11. electronicboy

    IRC Staff

    Well, GC is stable now, and your TPS is basically floating around ~19-20, which is good enough in terms of running a server, and would most likely hit 20 once you looked into what is causing the catchup system to be active; Paper has this mech which if a tick lags, it will try to catch up, to accommodate for that.
    Basically, go over timings; Anything that is red is generally something of concern to the performance of your server, this is generally plugins, however can be caused by stuff on the server, e.g. entities, tile entities... Plugins appear to mostly be your concern, especially with stuff like Skript showing massive performance impacts
     
  12. Code (Text):
    java -Xms12G -Xmx12G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=35 -XX:G1MaxNewSizePercent=60 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AggressiveOpts -XX:+AlwaysPreTouch -Dusing.aikars.flags=mcflags.emc.gs -jar spigot.jar
    Why all the extra? Just use:
    Code (Text):
    java -Xms12G -Xmx12G -jar spigot.jar
    At least I use this, works like charm for me!