mobs bunched up

Discussion in 'Performance Tweaking' started by PhanaticD, Jan 28, 2013.

  1. PhanaticD

    Patron

    do a bunch of mobs being bunched together cause lag? I am looking at a snippet from my server http://aikar.co/timings.php?url=1583563

    and it looks like the biggest source of lag is from entities. a lot of people have farms and im wondering if they go overboard and have chicken farms with hundreds of chickens in a 10x10 area if that would cause a lot of server lag
     
  2. Jigsaw

    Supporter

    Yes, I have noticed if you have a bunch of mobs in a small area it will cause much more lag than the same amount of mobs spread out.

    For example; players on my server have been creating grinders at spawners around the map. The players would afk at the grinders and all the mobs would pile up into a 1x3 hole. At one point a player had 600 skeletons in a 1x3 hole and the server was on its knees begging for mercy (3-5tps). I did a butcher just in the area of the mobs and the tps was back to 20 in about 1-2 minutes. I can have 3-4 times that number of mobs as long as they are spread out and still run at 20tps.

    I eventually tried to reason with the players and ask for their help in ensuring they didn't afk at grinders for too long. That didn't work too well and I eventually had to start using ClearLagg which will kill all lethal mobs at a set interval so as to prevent this issue. It will make players who are die hard grinders a little upset, but the positives outweighed the negatives for me. So far my server has been running at a constant 20tps (occasional drop for world edits) for the past few weeks.
     
  3. PhanaticD

    Patron

    well i have clearlag for mobs, but my players would murder me if i did it regularly for farm animals
     
  4. Jigsaw

    Supporter

    I am not talking about passive mobs. I only clear lethal mobs (skeletons, zombies, spiders, etc..). I have never seen lag from passive mobs. People have huge sheep, pig, and chicken farms on my server. No issues with them.
     
  5. PhanaticD

    Patron

    hmm okay, well thats what i was wondering about
     
  6. Trust me they do cause a ton of lag...

    http://aikar.co/timings.php?url=1571602

    that town entity tick does not include monsters
     
  7. Jigsaw

    Supporter

    I should have been more clear in my statement. What I mean is that I have never had so many passive mobs that they impacted the performance of the server to a noticeable level. I am sure if I had 10,000 sheep in a 10x10 area it would be noticeable lag, but I have way more passive mobs than aggressive and I don't have any issues with them.
     
  8. I will soon have spigot modified to separate timings by type, and youll be amazed how much they use still.

    Most of the heavy parts of LivingEntities (which is the base of both monsters and passive) is in the c() method which is shared between both types... so they are going to be close in the amount of lag they create.
     
    • Like Like x 1
  9. PhanaticD

    Patron

    is there anything that can be done to help performance with it? i dont really know much about craftbukkit code
     
  10. Wait until my upcoming feature for spigot, itll cut down lag caused by entities tremendously if configured at aggressive levels (You will have to balance it based on what your players will find acceptable), The Entity Activation Range. See thread in Developer Ramblings
     
    • Like Like x 2