Guide Optimizing Paper - Remove lag spikes, Fix tps & Improve performance!

Discussion in 'Paper Discussion' started by frash23, Mar 28, 2016.

  1. manwithtrouble

    manwithtrouble New Member

    Joined:
    Apr 2, 2016
    Messages:
    20
    Likes Received:
    0
    nope, it's vanilla survival, I was guessing it myself it's probably all the chunk generation, this was a new world on 1.10. i'm switching back to the world i was having doChunkUnload issuses with soon (posted about it on previous page), which doesn't have much to generate.
     
    #81 manwithtrouble, Jun 13, 2016
    Last edited: Jun 13, 2016
  2. frash23

    frash23 Active Member

    Joined:
    Feb 18, 2016
    Messages:
    133
    Likes Received:
    53
    I highly recommend you install a WorldBorder plugin and pre-generate all the terrain inside your border.
     
  3. manwithtrouble

    manwithtrouble New Member

    Joined:
    Apr 2, 2016
    Messages:
    20
    Likes Received:
    0
    I moved back to the previous world, and there seems to be some weird issue with doChunkUnload going on in the overworld. I have no idea how to figure out what could be causing doChunkUnload to be so high. I'll post the settings, they're exactly the same as they were on previous world, which became completely lag free with chunk generation disabled. Server is idling around 10~ tps.

    worldguard profile http://paste.enginehub.org/tsMcdJ.profile
    worldguard profile -t * throws a 503 error everytime I try it, but here's the profile.txt generated from it http://www.filedropper.com/profile
    timings, lag view http://i.imgur.com/la6ltbZ.png
    timings, all view http://i.imgur.com/cEI89Al.png
    paper.yml http://pastebin.com/raw/iKJa8jUu
    spigot.yml http://pastebin.com/raw/GkeLNcay
    bukkit.yml http://pastebin.com/raw/JHsbxL9j
    server.properties http://pastebin.com/raw/9HLizvwx
    java flags http://pastebin.com/raw/uv5zvv6Z copied from aikar's suggestions. have tested increasing in increments of 2gb starting from 10gb, no difference
    paper build 785

    edit: forgot to mention, on the fresh world started with 1.10 paper, doChunkUnload barely used 1% with same amount of players and same settings

    edit: solved the lagspike issue, it was due to structure saving being enabled. doChunkUnload remains very high, 50%>
     
    #83 manwithtrouble, Jun 17, 2016
    Last edited: Jun 20, 2016
  4. manwithtrouble

    manwithtrouble New Member

    Joined:
    Apr 2, 2016
    Messages:
    20
    Likes Received:
    0
    No ideas what could cause ridiculously high doChunkUnload usage? like between 30-60% in timings? What does that function do and what could make it be so slow and hog ticks?
     
  5. L4BORG

    L4BORG New Member
    Trusted

    Joined:
    Feb 1, 2016
    Messages:
    12
    Likes Received:
    0
    And that's as good as it gets?

    I've been playing around with those flags and even with i.e.:

    Code:
    java -Xms7G -Xmx7G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AggressiveOpts -XX:+AlwaysPreTouch -jar spigot-survival.jar
    I would get lag spikes here and there...

    Code:
    >sm tps
    [16:32:51 INFO]: TPS history: 20, 19.11, 19.03, 19.76, 19.96, 19.8, 19.8, 19.71, 20, 19.47, 19.55, 19.79, 19.84, 20, 20, 20, 20, 19.19, 19.67, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 6.98, 6.63, 20, 18.1, 17.87, 20, 20, 20, 20, 12.89, 12.15, 20, 19.67, 20, 20, 19.5, 19.79, 19.96, 19.93, 19.81, 19.84, 19.65, 19.85, 20, 20, 20, 19.84, 19.39, 19.63, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 5.2, 4.95, 19.96, 19.68, 20, 19.78, 19.57, 19.91, 20, 20, 20, 19.77, 20, 19.76, 17.41, 19.69, 20, 20, 19.63, 19.45, 20, 20, 19.76, 19.73, 19.85, 19.91, 19.9, 19.79, 19.81, 20, 19.73, 20, 20, 18.9, 20, 19.86, 20, 20, 20, 20, 20, 20
    ^ 1 record = avg TPS every 1 sec... and you can see random TPS drops between 2 and 3 seconds every now and then.

    That's with 125 players on view-distance: 4 and nothing popped out on timings... but it would usually lag on/before (major) GC hits...

    and I don't think memory leaks are the issue here, considering:

    Code:
    >sm
    [16:36:02 INFO]: Players: 121 / 175
    [16:36:02 INFO]: TPS: 20 (History: 20, 19.81, 20, 20, 20, 20, 19.12, 19.58)
    [16:36:02 INFO]: Uptime: 12 hours 56 minutes 9 seconds
    [16:36:02 INFO]: Memory: 812 MB free, out of 7,168 MB (Maximum 7,168 MB)
    [16:36:02 INFO]: Redstone disabled: false, Spanwers disabled: false
    [16:36:02 INFO]: Ticking locations: 135, blocked chunks: 0
    [16:36:03 INFO]: Loaded: 6777 entities, 44655 tile entities, 7160 chunks, 3 worlds
    >sm
    [16:36:09 INFO]: Players: 122 / 175
    [16:36:09 INFO]: TPS: 20 (History: 20, 20, 18.02, 18.99, 19.97, 18.12, 19.07, 20)
    [16:36:09 INFO]: Uptime: 12 hours 56 minutes 16 seconds
    [16:36:09 INFO]: Memory: 2,661 MB free, out of 7,168 MB (Maximum 7,168 MB)
    [16:36:09 INFO]: Redstone disabled: false, Spanwers disabled: false
    [16:36:09 INFO]: Ticking locations: 437, blocked chunks: 0
    [16:36:09 INFO]: Loaded: 6889 entities, 45502 tile entities, 7292 chunks, 3 worlds
    >sm
    [16:36:19 INFO]: Players: 119 / 175
    [16:36:19 INFO]: TPS: 16.33 (History: 17.17, 20, 19.42, 18.81, 20, 20, 20, 20)
    [16:36:19 INFO]: Uptime: 12 hours 56 minutes 26 seconds
    [16:36:19 INFO]: Memory: 2,581 MB free, out of 7,168 MB (Maximum 7,168 MB)
    [16:36:19 INFO]: Redstone disabled: false, Spanwers disabled: false
    [16:36:19 INFO]: Ticking locations: 540, blocked chunks: 0
    [16:36:20 INFO]: Loaded: 6532 entities, 43658 tile entities, 6855 chunks, 3 worlds
    >
    
    Not even sure if that's GC's fault but idk what else to look for anymore.... :(
     
  6. Techcable

    Techcable Benevolent Sith Dictator
    Administrator Waterfall Core Developer Paper Developer

    Joined:
    Feb 1, 2016
    Messages:
    282
    Likes Received:
    124
    Its probably a plugin.
     
  7. WindUnwaken

    WindUnwaken New Member

    Joined:
    Jun 29, 2016
    Messages:
    4
    Likes Received:
    0
    mob-spawner-tick-rate
    Default: 1
    Suggested: 20

    Did the stats recommend 20 or 2 ?
    I've tested it, mob-spawner not spawn any mob.

    Your post in Spigot also said Suggeted:2-3

    https://goo.gl/bQFdd0
     
    • Agree Agree x 1
  8. frash23

    frash23 Active Member

    Joined:
    Feb 18, 2016
    Messages:
    133
    Likes Received:
    53
    The guide on SpigotMC is a little outdated. A value of 20 is recommended.
    I've already explained to your in private that this value does not affect mob spawning.
     
  9. Kevan

    Kevan New Member

    Joined:
    Jun 8, 2016
    Messages:
    3
    Likes Received:
    0
    From my experience, mob-spawner-tick-rate in paper yml as 20 actually does slow down mob spawns from spawners. I keep my setting at 1.

    Edit: I posted this then scrolled up a post to see what WindUnwaken said about this. I agree.

    I do have a mob stacking plugin though, one that keeps a single entity and multiplies the loot on a kill. It seems to me that even with a vanilla setting of 1, the spawners are still too slow. I want to speed them up, would I put a negative value or a decimal such as 0.5 or .5 to increase the tick rate from 1? I don't have timings on me, but I can say that spawners aren't a lag issue for me currently, just that I want there to be less time between mob spawns from spawners.

    Thanks for any help.
     
  10. frash23

    frash23 Active Member

    Joined:
    Feb 18, 2016
    Messages:
    133
    Likes Received:
    53
    The mob-spawner-tick-rate setting does not influence frequency of mob spawning by mob spawners.

    Setting it to a value less than 1 would not make sense due to the way ticking works.
    The server carries out twenty actions per second (20TPS). If you tick mob spawners every 20 ticks, you will get up to 20 ticks delay per spawn, which is one second. Additionally, this will even out with every other spawn.
    This does not affect the total amount of mobs spawned over time.

    A value of "1" means check every tick. A value of "2" means check every 2nd tick. 5 would be every fifth tick.
    Setting it to "0" would mean "tick mob spawners every zero'th tick". It defies the logic of the server.
     
    • Like Like x 1
    • Agree Agree x 1
  11. WindUnwaken

    WindUnwaken New Member

    Joined:
    Jun 29, 2016
    Messages:
    4
    Likes Received:
    0
    I know what you are saying, but after several days testing, I have two servers, A set mob-spawner-tick-rate: 2, B mob-spawner-tick-rate: 20
    A spawn mob from spawner normally, B rarely spawn a mob from spawner, but why?

    I trust your theory, maybe a specified condition cause this issue.
    Would more users join to test this value?
     
    • Agree Agree x 1
  12. Kevan

    Kevan New Member

    Joined:
    Jun 8, 2016
    Messages:
    3
    Likes Received:
    0
    Same thing with me. A setting of 2 seems to be less frequent with spawns as well. Ive left mine at 1.
     
  13. RoboMWM

    RoboMWM Moderator
    Moderator

    Joined:
    Feb 1, 2016
    Messages:
    118
    Likes Received:
    18
    Have you switched the values? Perhaps the spawn conditions for the other spawner are different and can cause less spawns. Also remember a player needs to be nearby, etc. Also note that the interval is completely random (according to Minecraft wiki, a mob can spawn between any period of "200 to 799 ticks (10 to 39.95 seconds)")
     
  14. manwithtrouble

    manwithtrouble New Member

    Joined:
    Apr 2, 2016
    Messages:
    20
    Likes Received:
    0
    from my testing with mob-spawner-tick-rate:

    20 - after a random duration a single mob spawns from the spawner
    1 - after a random duration four mobs spawn at the same time from the spawner
     
  15. croderdai

    croderdai New Member

    Joined:
    Sep 26, 2016
    Messages:
    4
    Likes Received:
    0
  16. croderdai

    croderdai New Member

    Joined:
    Sep 26, 2016
    Messages:
    4
    Likes Received:
    0
  17. RoboMWM

    RoboMWM Moderator
    Moderator

    Joined:
    Feb 1, 2016
    Messages:
    118
    Likes Received:
    18
  18. Chris_GSPvP

    Chris_GSPvP New Member

    Joined:
    Oct 6, 2016
    Messages:
    2
    Likes Received:
    0
    I am having some questions related to this topic:

    • Is it usual that some of the cores are using 100% (for a couple of seconds) and that 1 of my server threads are over 200%? Click here to see my htop.
    • Here is my free -h output, this fine? What about the 12G in cache?
    • Do I need to alter the max-tick value in spigot.yml or leave it like it is?
    • When I used the start-up script from @Aikar, the server crashed within a hour (The CPU, SWAP and RAM went up to 100% in my SoYouStart panel), could this be because of having -XX:MaxGCPauseMillis on 100 instead of 45?
    • Do I need to alter netty-threads? My CPU: click here.
    • CPU usage (SoYouStart): click here.
     
  19. L4BORG

    L4BORG New Member
    Trusted

    Joined:
    Feb 1, 2016
    Messages:
    12
    Likes Received:
    0
    Why not just paste timings url?

    Depending on server load, ofc. Spigot can do something async...

    http://askubuntu.com/questions/198549/what-is-cached-in-the-top-command

    Crashed how? OOM?

    No.

    You can't expect to have 100% usage and/or efficiency.
     
  20. croderdai

    croderdai New Member

    Joined:
    Sep 26, 2016
    Messages:
    4
    Likes Received:
    0

Share This Page