mobspawn is very expensive

Discussion in 'Spigot Help' started by Courtney, May 21, 2015.

  1. From time to time mobspawn jumps to 200%+ tick CPU load for several seconds, causing my server to freeze for a little bit. Spawn limit is set to reasonable amount (50 mobs) peak hours average 100 players. I have no issues with mob AI or enitiy tick. Most of the lag comes from occasional mobspawn maxing out CPU (1-3s lag) it's eating up to 200%+ tick CPU.

    It happens randomly every 1 - 600 seconds and freezes everything for a couple seconds.


    The server is mainly vanilla (latest Spigot 1.8.4 compile) mob farms and mob amount is under control.

    Any idea how I can go about finding what's wrong with mobspawn tick and where do I go from here?
    #1 Courtney, May 21, 2015
    Last edited: May 29, 2015
  2. Bump, lowered mob cap and tried playing around with monster-spawns (1-100 ticks) nothing helps.

    Recent example:
    Mob amount 40 | Mob spawn tick 2
    #2 Courtney, May 29, 2015
    Last edited: May 29, 2015
  3. Wooaaahhh, do you know how many entities are in the world?
  4. bump

    Would be nice to get a reply from somebody who actually understands my issue and can point me in the right direction.

    Everything looks fine when I take timings for some time:

    Yet every ~1-3 minutes server gets all choppy for a couple seconds.

    This is what timings look like during lag spikes:
    (50 mobs & 4 ticks mobspawn)

    I believe it started happening shortly after updating from Spigot 1.7 to 1.8 (could be wrong here)
    World is pretty old and is mainly Vanilla, still trying to see if there is a pattern to this lag spike.
  5. Could you post an entire timings report of all plugins both during the lagspike and in general? I think it would help to be able to see the big picture.
  6. Lag spike comes from mobspawn tick, nothing to do with plugins.

    Worldguard has the highest load when it comes to plugins and it never goes past 5% during peak hours.
    Everything else averages ~0.10% total load or less.

    Like I mentioned before, the server is mainly Vanilla.
    #6 Courtney, Jun 7, 2015
    Last edited: Jun 7, 2015
  7. You seem very protective of your timings, we need the full timings to help you.
  8. I'm pretty certain we've seen all we will need to see, and I'm also pretty certain this looks like you're using an overloaded host.
  9. Linux 3.10.23-xxxx-std-ipv6-64 (amd64)
    Intel Xeon E3 1245v2
    4 cores/ 8 threads
    3.7 GHz
    32 GB DDR3
    2 x 2 TB SATA

    That node is currently running 4 different Vanilla servers, only the oldest one has noticeable problems with mobspawn tick.

    The issue is does not seem to be related to Plugins, IO, CPU or RAM in general.
    #9 Courtney, Jun 7, 2015
    Last edited: Jun 7, 2015
  10. Two questions,
    Are you using a VPS?
    Are you running a bungeecord instance on the same node?
  11. Dedi, bungeecord is on the same node.

    Had issues even before bungeecord.
  12. konsolas


  13. How about look at the screenshots and you would have seen all the information we need.
    Bungeecord is prone to slow down and eat up the CPU usage, i'd suggest testing some CPU affinity settings. Also, maybe get a clear up plugin.
  14. In your bukkit.yml, how often do you allow mob spawns?
  15. You could try configuring it to have more mob spawn passes, but spawn fewer mobs each time. This way, the lag can be spread out rather than all clumped in one place.
  16. Plugins can hook into events, making said event become more expensive while the source is technically the plugin. Won't show up in a timings report.