Thoughts on low TPS

Discussion in 'Spigot Discussion' started by Matt, Jan 22, 2013.

  1. I've been running a bukkit/spigot server since Aug '11 essentially using the same plugins and steadily improving hardware and tweaking configurations. I have never had more than ~70 people online but there's almost always ~30 online with evenings averaging ~50. The TPS is fairly steady at 20 TPS when there is 30 on but around 50 players it doesn't take much to bring it down to 10 TPS, someone at a mob grinder or running some redstone contraption. I just want to post all my setup here and see if anyone can spot a reason why it's so fragile with relatively few players. I'll update here with timings and "/lag" when it get's spikes. At the moment it's running fine with 30 online.

    Hardware:
    dedicated server from limestone networks
    e3-1290v2 @ 3.7Ghz
    24gb DDR3 1333
    1gbit network
    Samsung 840 Pro Series 256GB SATA III

    spigot version:
    CraftBukkit version git-Spigot-436 (MC: 1.4.7) (Implementing API version 1.4.7-R0.2-SNAPSHOT)

    Plugins (29): bPermissions, WorldEdit, dhmcDeath, Vault, Multiverse-Core, LogBlock, TreeAssist, WorldGuard, bChatManager, MCBans, dynmap, MinecraftBot, AntiGuest, McftProfiler, MuddersMilk, AxeMod, Lockette, RedstoneClockDetector, Essentials, WorldBorder, EssentialsSpawn, EssentialsGeoIP, PaidSwitch, Multiverse-NetherPortals, VanishNoPacket, Residence, ResProtect, ChestShop, dynmap-residence

    Code (Text):
    >lag
    Uptime: 7 hours 47 minutes 43 seconds
    Current TPS = 20.0
    Maximum memory: 15,293 MB
    Allocated memory: 2,624 MB
    Free memory: 398 MB
    World "axe": 377 chunks, 957 entities
    World "spawn": 3,249 chunks, 4,840 entities
    Nether "nether": 243 chunks, 284 entities
    The End "end": 82 chunks, 101 entities
    Timings after 7.5 hrs of uptime:
    http://aikar.co/timings.php?url=1560810

    bukkit.yml:
    http://paste.md-5.net/bilicunaba.sm

    MySQL running locally off the ramdisk. nothing else on the server.
     
  2. LiLChris

    LiLChris Retired Moderator
    Retired

    Maybe your getting it for less, but let me get this straight...
    Your paying $280 for a 30-50 player server and it still lags, how long have you been paying for this service? o_O

    Honestly your setup is amazing, so that isn't the issue and you don't have a crazy amount of worlds/entities/plugins.
    Have you tried removing Dynmap and see if that helps any bit.
     
  3. Jigsaw

    Supporter

    Matt
    Code (Text):
    Maximum memory: 15,293 MB
    Allocated memory: 2,624 MB
    Free memory: 398 MB
    That looks sort of strange. Do you have some sort of GC flag on your startup line? Can you post the startup line/script you use to start your server?
     
  4. java -d64 -XX:UseSSE=4 -XX:+AggressiveOpts -Xincgc -Xmx15G -server -jar spigot.jar nogui
     
  5. Jigsaw

    Supporter

    I would try this:
    Code (Text):
    java -Xmx15G -Xms4G -jar spigot.jar
    I'm not saying it will fix your problems, but it is worth a shot.

    Edit: I removed Xincgc. It can actually have a negative affect on performance.
     
    #5 Jigsaw, Jan 23, 2013
    Last edited: Jan 23, 2013
  6. makes sense, i havent played with those flags since i was running on much leaner hardware. I'll try without those extra ones.
     
  7. starting to degrade..

    43 online

    Uptime: 2 hours 54 minutes 44 seconds
    Current TPS = 17.272728
    Maximum memory: 13,653 MB
    Allocated memory: 4,018 MB
    Free memory: 1,909 MB
    World "axe": 377 chunks, 384 entities
    World "spawn": 5,909 chunks, 9,980 entities
    Nether "nether": 81 chunks, 86 entities
    The End "end": 81 chunks, 144 entities

    java -Xmx15G -Xms4G -server -jar bukkit.jar

    http://aikar.co/timings.php?url=1564832
     
  8. Jigsaw

    Supporter

    That is a lot of entities. Do a /wg report and you can get the number of entities by their type. Have you tried //butcher to see if it helps the lag? I have a feeling it would bounce back up to 20tps if you ran "butcher" from the console.

    Btw: If you paste your /wg report here make sure to delete/remove some of the personal information it contains.
     
  9. LiLChris

    LiLChris Retired Moderator
    Retired

    Agreed, i have 70 players with about 3k entities right now and I know if I go above 90 players 4k entities it starts to drop the TPS to 18-19.
    I have a cronjob to //butcher every 30mins so that doesn't happen.


    Yes remove SQL login/password, mostly if you can connect from an outside source.
     
  10. Nice, I didn't even know about that report. Very helpful.

    Code (Text):
        Entities  :
            CraftSlime          : 41 [0.006353]
            CraftSheep          : 799 [0.123799]
            CraftCreeper        : 1002 [0.155253]
            CraftSpider        : 202 [0.031298]
            CraftBat            : 231 [0.035792]
            CraftBoat          : 1 [0.000155]
            CraftArrow          : 13 [0.002014]
            CraftItem          : 331 [0.051286]
            CraftExperienceOrb  : 2 [0.000310]
            CraftStorageMinecart: 1 [0.000155]
            CraftSnowman        : 27 [0.004183]
            CraftIronGolem      : 27 [0.004183]
            CraftItemFrame      : 2018 [0.312674]
            CraftMinecart      : 56 [0.008677]
            CraftOcelot        : 35 [0.005423]
            CraftSquid          : 134 [0.020762]
            CraftVillager      : 866 [0.134180]
            CraftChicken        : 745 [0.115432]
            CraftWolf          : 12 [0.001859]
            CraftPlayer        : 67 [0.010381]
            CraftSkeleton      : 884 [0.136969]
            CraftPig            : 249 [0.038581]
            CraftPainting      : 207 [0.032073]
            CraftEnderman      : 91 [0.014100]
            CraftFallingSand    : 3 [0.000465]
            CraftCow            : 578 [0.089557]
            CraftCaveSpider    : 3 [0.000465]
            CraftZombie        : 937 [0.145181]
     
  11. Jigsaw

    Supporter

    I also recommend ClearLagg created by bob7l
    That plugin is very simple to setup and you can customize it to fit your exact needs. Of course, a cronjob works fine also.
     
  12. Jigsaw

    Supporter

    Those item frames! They are the cause of some of your lag. You have a lot of mobs (creepers, zombies, and skeletons). Are people afking at spawners?
     
  13. Ya, grinders are pretty popular, unfortunately... There's virtually no naturally spawning mobs.

    Code (Text):
    spawn-limits:
      monsters: 150
      animals: 50
      water-animals: 5
      ambient: 10
    ticks-per:
      animal-spawns: 200
      monster-spawns: 2
      autosave: 0
     
  14. Jigsaw

    Supporter

    Matt did you try to run "butcher" from the console? Check your TPS about a minute after you do that. If that helps check the plugin I linked you above.
     
  15. /butcher killed 3449 mobs.. TPS dropped to 12 for about 30 seconds. then back to 10,000 entities and 18TPS
     
  16. I never got how people comfortably butcher all their mobs every X minutes/hours. If I did that I would have people pitchforking outside my house :p I guess if you guys are PVP servers or something and people are used to it :eek:
     
  17. Yeah I can't imagine doing it on a schedule. Even when i do it once to debug people start getting up in arms. If i could better limit the max mobs per chunk that would be better.
     
  18. LiLChris

    LiLChris Retired Moderator
    Retired

    Laggy server with mobs
    Or
    Stable server with less mobs

    If he wants to grow, its only going to get worse, and having 2k item frames is crazy...
    I am surprised they made so many, I have 104 and 80 of them are from spawn shop I made.

    What type of server are you running?


    TPS drops were from AFKers in mob spawners, which is why I put the cronjob...never had that issue even at 100/100 since I did that.
     
  19. Me? 1270v2, 32GB of RAM, 128GB Samsung 830 SSD. I have never killed all the mobs in my world. And we hit over 200 players very often. I have been having some issues with TPS but they're related to plugins grabbing the main thread. I fixed a lot of those issues and can 20TPS pretty consistently.
     
  20. can you post bukkit.yml, plugins list, wg entities report?