High CPU Usage

Discussion in 'Bukkit Help' started by ManBearWaffle, Mar 12, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    MrPendulum

    Hi EvilSeph,

    I fired up builds #557 and #558 on my test server (i make a full backup of the bukkit install and world, identical to the one I gave you a copy of, then run it on different hardware so I can test config and plugin changes). I haven't tested if the lag is present, but I suspect it will be. In fact, I have a strong suspicion I know the cause too.

    As you saw for yourself, spawn-animals=false in server.properties.

    Well, have a look at this screenshot:
    [​IMG]

    Squid-Ho!

    Hundreds of the blighters, and they are at the bottom of every such depression in the bottom of every major body of water.

    I can see two possibilities here:
    1) They are still spawning like hell, and bogging down the server. (bukkit bug)
    2) They *were* spawning like hell, and bukkit isn't eliminating them when starting with animals set to false. (so bukkit bug still). If this is the case, does anyone know a good plugin for mass genocide of a mob type?

    Evilseph, let us know if you would like an updated copy of my world to confirm this for yourself.
     
  2. Offline

    ThomasJ

    Also seeing this issue on my server Ubuntu 10.10 with a Phenom II x6 3.2 GHz processor.

    Upon launching an empty bukkit server, no plugins, no users. CPU usage sits steadily at 7%.
    One user joins, CPU usage jumps to 23% and spikes up to 50%. Never goes below 23%.
    Add another user and CPU usage jumps to about 30% if they are in the same area, spikes now at 80%.

    I'll need to do some more testing obviously to narrow things down a bit, just wanted to add a "me too" to the mix.

    On a side note. If the full spawn checks still happen even if mob/animal spawn is still on, and they just "instantly remove them after spawn", thats really bad design by Mojang imo.
     
  3. Offline

    MrPendulum

    Just an update. I updated kitplugin so all my players could access a squid hunting kit (a pumpkin [pumpkin diver plugin, 10x the amount of air], glowstone to see, and a diamondsword), and since culling them the lag and cpu usage is definitely reduced. Additionally, new squid don't seem to be spawning.

    Therefore, I think the issue is that squid which were saved with the map before build #557 can still cause this.

    I will keep watching this and let people know.
     
  4. Offline

    GhostToast

    interesting.
    i wonder if this plugin would help at all? to simply reduce the number of mobs spawning. it seems to me that a player will 'generate' roughly 100-180 mobs simply by existing. i'm sure this number varies based on amount of "spawnable space" near him (i.e. can a pig spawn here, can a skeleton spawn here). not sure if the plugin is working well or not. but it might be nice to simply reduce the number of mobs rather than eliminate them completely. i'm going to try this out.
    http://forums.bukkit.org/threads/mech-mobcontrol-v1-8-02-control-those-mobs-531.4828/

    edit: judging from the # of people who say the plugin isn't working, i guess i'm not going to try it yet.
     
  5. Offline

    tremor

    d
    I've been running for a full 24 hours on the setup from my previous post. While the CPU has improved to an extent, It's now running at a consistent 50% (as opposed to 80-90) but still never settling down to the meager 8%-15% that I recall from Bukkit #493.

    Traditionally I recall the CPU and MEM numbers being reverses, my server often running at 50% MEM 1GB out of the servers 2GB, and never hardly EVER above 20% CPU.

    I haven't added any new plugins since 493.. only updated the releases of the ones you see installed. Additionally, I've run the server sans plugins, to no major change in statistics, so it's safe to say those are completely ruled out.
     
  6. Offline

    GhostToast

    you're lucky your server can run for 24 hours without intervention, i say!
     
  7. Offline

    tremor

    i spoke too soon.. we hit about 12 players just a little while ago.. CPU spiked over 100% - server locked up and had to kill the process from the server shell... rolled back to the last save points.. and another sh1t ton of players never coming back... i've now capped my player limit at 10. I will be working my way back to CB #493 If i can.... this has done more damage to my server than any hacker/griefer could ever imagine... :( sad face.
     
  8. Offline

    Spazmic

    I think resolving the cpu usage should be a priority :S
     
  9. Offline

    anon

    If you guys change world to a new one, does the problem persists?
     
  10. Offline

    GhostToast

    i disabled BackupPlugin and things seem to be a lot better. on 557 at the moment, 15 players on 1 gig of ram.

    no, now everything is sucking again. no idea.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 12, 2016
  11. Offline

    TnT

    Please, for everyone reporting this problem, you need to be running a vanilla CraftBukkit server. There should never be a case of "I removed X plugin, things seem to be better now." because the first thing you should have done is run the server without plugins and work to prove the issue is in the core software.

    That way, you can say, with confidence "Hi EvilSeph, here is my world, running on vanilla CraftBukkit. I get excessive CPU usage, can you see the same?"

    If the problem can be reproduced, the problem can be isolated and fixed.
     
  12. Offline

    tremor

    Already Been done.. I've tested on vanilla craftbook from #522, #527, #531, #556.... The last CPU friendly (recommended) CB is #493. I believe several of the early post in this thread have already covered this stage of the problem....... please read the whole thread. Also, cant very well run a CB Vanilla or locale dev to test this, the problem seems to manifest with player logins... I suppose you could backup your world -run your server in vanilla and let peopel grief the bejezus out of it for the sake of science... or maybe trust that a few of us here know a thing or two.. and focus on the problem being bukkit. The more we billy-bally over plugins thelonger fixing the bukkit based issue will take. For the last time it's not plugins. I offer my server for testing.. I'll set it up in a few hours... vanilla, on #493. Get as many players as I can.. record stats.. then i'll shut it down and repeat for all the other versions.. just to satisfy whatever need it is you need to see this done.
     
  13. Offline

    trivials

    The main problem is you can see the problem only with much players. But how to get on an vanilla server much players ? Thats the problem.

    With 2-5 players you cant see the problem :)
     
  14. Offline

    Kuckeli

    This is weird, i run a server with about 10 people and the CPU stays below 35% pretty much all the time.
    And i run alot of CPU intensive plugins like dynmap and bigbrother. (The CPU is a quadcore btw)
    If there is any testing i can help with, let me know.
     
  15. Offline

    tremor

    java version "1.7.0-ea"
    Java(TM) SE Runtime Environment (build 1.7.0-ea-b125)
    Java HotSpot(TM) Server VM (build 20.0-b06, mixed mode)

    1GB allocated RAM on a 2GB RAM VPS at GoDaddy.

    Bukkit #556 - No plugins:
    startup - didnt catch usage
    8 players - 40.9CPU 19.3MEM (5 minutes after boot)
    11 players - 44.1CPU 21.4MEM (10 minutes after boot)
    12 players - 44.8CPU 21.8MEM (20 minutes after boot)
    Never got more players than this. - stop @ 30 minutes

    Bukkit #531 - No plugins:
    startup - 90% CPU
    8 players - 40.2CPU 11.6MEM (5 minutes after boot)
    12 players - 42.2CPU 16.3MEM (10 minutes after boot)
    15 players - 49.1CPU 21.6MEM (15 minutes after boot)
    13 players - 51.6CPU 22.4MEM (20 minutes after boot)

    Bukkit #522 - No plugins:
    startup - 115% CPU
    12 players - 58.5CPU 20.2MEM (5 minute after boot)
    10 players - 57.5CPU 20.3MEM (10 minute after boot)
    16 players - 58.3CPU 22.8MEM (15 minutes after boot)
    14 players - 60.6 24.6 (20 minutes after boot)

    Bukkit #493
    startup - 143% CPU
    10 players - 43.9CPU 15.2MEM (5 minutes after boot)
    12 players - 49.9CPU 25.4MEM (10 minutes after boot)
    13 players - 51.6CPU 26.0MEM (15 minutes after boot)

    Bukkit #556 BRAND New World
    startup - 120% generating
    11 players - 87.2CPU 16.1MEM (5 minutes after starting)
    13 players - 62.6CPU 20.7MEM (10 minutes after starting fresh world)
    13 players - 58.7CPU 20.8MEM (15 minutes after starting frsh world)
    12 players - 62.4CPU 22.0MEM (20 minutes)

    Bukkit #493 BRAND New World
    startup - 170% generating
    9 players - 64.5CPU 17.4MEM
    11 players - 77.8CPU 48.0MEM


    wtf? really? none of this makes sense now..

    Only a few weeks ago everything ran so smooth, even with lots of plugins, map size was 1.7GB.. what's changed, what's new? Map is only 2.0 GB now.

    Am I going to have to be a millionaire to run a god damn minecraft server on bukkit?

    Did mine and all the rest of us have VPS providers who saw us running minceraft, do something to our CPU to force us into a more expensive option?

    The experimental data from above ran on my 2GB map, then on fresh gen maps.

    Thank you to the dozen or so loyal players at my server who have been sticking with me throught this mess.

    I've now reached wits end. 493 was not fruitful. The data shows nothing as I was never able to achieve a low CPU usage like I claim to once have had.
     
  16. Offline

    MrPendulum

    This is definitely what's causing it!

    [​IMG]

    So many of them that it took almost 2 minutes for the chunk to load. Spawn-animals are off. Yet, these things are worse than rodents.

    This issue really needs a priority fix!

    Edit: I installed worldedit for no other reason than the /butcher command. At this point, 1707 mobs were killed, and instantly the lag disappeared, and CPU usage dropped dramatically.
     
  17. Offline

    tremor

    518 mobs killed with /butcher.. i have mobs on - no cpu reduction after this /butcher... steady at around 52% with 7/15 players. Have had 2 crashes withing last hour tho
     
  18. Offline

    HowIChrgeLazer

    EDIT: My CPU/RAM issues had to deal with the Vegetation plugin, unrelated to craftbukkit.
     
  19. Offline

    QQCucumber

    Tagging @TnT to make sure he sees this, holy crap.
     
  20. Offline

    Survivorman

    I confirm all of the above. I've got the same story. I'm willing to help as much as I can. My only other problem is very high memory usage. Again, we've ran with no plugins, the same story. We've ran the vanilla server also and it wasn't as heavy on resources, not nearly as heavy.

    Everything you need to know:
    - XEN VPS | CPU: 8 core i7 @ 2.27GHz | 2GB dedicated RAM | shared RAID-10 HDD array
    - Ubuntu 10.10 x64 (headless, no Gnome or anything)
    - Java 6 JDK u23 (from Oracle, not OpenJDK) x64 (1.7 JDK x64 has been tested, same performance)
    - CraftBukkit b559
    - McMyAdmin 9.0.0.5 (handles backups, saves, and timed alerts)

    Plugins:
    Code:
    WorldEdit, WorldGuard, CommandBook, GroupManager (With  FakePermissions), MyHome, MyWarp, TelePlus, LWC, HeroChat, SpawnControl,  GuestPrev, EpicZones, PreciousStones, iConomy, iConomyChestShop,  HeroBounty, DropBonus, Help 
    Everything is at its latest build.

    This is when I'm writing my post: We have 12 players online.
    Code:
      1  [||||||||||||||||||||||||||||99.3%]     Tasks: 116 total, 10 running
      2  [||                           1.3%]     Load average: 6.05 6.14 5.46
      3  [|                            0.6%]     Uptime: 1 day, 09:24:26
      4  [                             0.0%]
      5  [|                            0.7%]
      6  [|                            0.6%]
      7  [                             0.0%]
      8  [                             0.0%]
      Mem[||||||||||||||||||||||1596/2070MB]
      Swp[|                       57/4095MB]
    
    I start the server with McMyAdmin, using the default GC methods and the server JVM.
    Essentialy the startup code is "java -server -Xmx2048m -jar craftbukkit.jar nogui" and it runs amazingly well until the resources it has gets dried up. This happens without McMyAdmin, with no plugins, and most Java flags (believe me when I say I've tried everything).
    I've seen a lot about using "-Xincgc" in the start-up line but when I use it in or out of McMyAdmin the server will hang and freeze up very often (usually on start-up, when it does go through and we can play it will time out, the console locks up, and the task needs to be killed.)
    (Most of this was ripped from another post I had..Just found this thread today :/)

    As for the redstone and mobs theory, my map is somewhere near 400MB with moderate redstone usage. Mobs are everywhere, the spawn rate is insane sometimes. I've started our server without mobs and animals, I'll report back soon!

    MY REPORT: Without mobs, my CPU usage drastically lowered, but the RAM usage is still very high. (It goes up and never comes down)
    Code:
      1  [|||||||||||||               37.7%]     Tasks: 114 total, 2 running
      2  [||                           3.2%]     Load average: 3.54 3.64 3.33
      3  [||||                        10.3%]     Uptime: 1 day, 10:35:00
      4  [|                            0.6%]
      5  [                             0.0%]
      6  [                             0.0%]
      7  [                             0.0%]
      8  [                             0.0%]
      Mem[||||||||||||||||||||||1670/2070MB]
      Swp[|                       56/4095MB]
    
    This is with 9 players currently, 12 max. It idles at 40% but frequently spikes to 100% and settle back down. I honestly don't understand the 1.6GB of memory usage for 9 players though.

    EDIT: Seems I spoke to soon! The server's CPU just spiked to 100% and the server is frozen. Don't know what happened.
    Code:
      1  [||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%]     Tasks: 117 total, 3 running
      2  [|||                                                                                 1.9%]     Load average: 2.34 2.93 3.11
      3  [                                                                                    0.0%]     Uptime: 1 day, 10:39:17
      4  [                                                                                    0.0%]
      5  [                                                                                    0.0%]
      6  [                                                                                    0.0%]
      7  [                                                                                    0.0%]
      8  [                                                                                    0.0%]
      Mem[|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||1692/2070MB]
      Swp[||                                                                             55/4095MB]
    
    PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
     29   9 2535M 1307M 10936 R  0.0 63.1 -596523h-14:-8 java -server -d64 -Xmx2G -jar craftbukkit.jar
     29   9 2535M 1307M 10936 S  0.0 63.1  0:00.00 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:03.03 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:01.20 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:06.00 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:00.63 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:01.26 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:00.56 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:01.07 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:00.47 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:01.04 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:01.13 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:02.89 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:02.01 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:07.41 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:01.81 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:02.83 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:05.48 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:09.40 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:01.68 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:00.00 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:15.08 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:14.91 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:00.00 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:00.74 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:00.16 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 R 82.0 63.1  4:09.64 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:04.23 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:04.36 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:04.28 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1 -596523h-14:-8 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:00.19 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:04.03 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:04.54 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:04.48 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1 -596523h-14:-8 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:00.01 java -server -d64 -Xmx2G -jar craftbukkit.jar
     20   0 2535M 1307M 10936 S  0.0 63.1  0:05.99 java -server -d64 -Xmx2G -jar craftbukkit.jar
    
    UPDATE #2: I download the latest Open-JDK 6 and ran my server with mobs/animals set to false. Here is after about an hour of running, with 12 players online:
    Code:
    
      1  [||||||||||||||||||||||||||                                                         28.2%]     Tasks: 113 total, 2 running
      2  [||                                                                                  1.3%]     Load average: 2.74 3.72 3.74
      3  [||||||                                                                              5.2%]     Uptime: 1 day, 11:34:09
      4  [|||||                                                                               4.6%]
      5  [||                                                                                  2.0%]
      6  [                                                                                    0.0%]
      7  [                                                                                    0.0%]
      8  [                                                                                    0.0%]
      Mem[|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||1575/2070MB]
      Swp[||                                                                             54/4095MB]
    
    
    The CPU usage still spikes, and memory usage goes up and does not come back down.
     
  21. Offline

    anon

    I have a +- 500mb maps. I downloaded it to my home pc, and im using mcedit to remove all entities of the map.
    As mcedit freezes on very big maps, im doing this step by step, selcting "small" groups of chunks and deleting it.

    So far I managed to clean 1/3 of the map, mcedit already removed 7000 entities. Maybe worldedit /butcher aint removing all of the mobs. I do realize that entities are more than mobs, but I think 7000 for 1/3 of the map is very big number already.
     
  22. Offline

    Survivorman

    I think that /butcher only kills mobs in the active chunks you stand in, that's why I won't rely on it.
     
  23. Offline

    GhostToast

    this is a wild hypothesis, but goes along with what people are finding - that going back to 493 doesn't really change much. is it possible that there is some network code that's communicating with the mojang servers, which could cause this backup? i mean, obviously we haven't seen a software update for server or client in some time, but we know that at least at some point, there is communication with mojang's servers. and they are working on implementing their own stats and achievements (global if i'm not mistaken). could they be experimentally increasing the amount of processes communicating with their servers? i understand code on "our end" hasn't changed, but its still possible that there is more communication, if you think about it. on the part of the listener, maybe listening longer/harder/less efficiently (and our end continuing to wait for the response). thoughts?
     
  24. Offline

    anon

    onlinemode:false, play offline on minecraft, nothing changes.
     
  25. Offline

    tremor

    Whoa.. this could entirely be possible

    I've put my server in offline mode and its running far better.
     
  26. Offline

    enchanter100

    Just a note for those who are turning off monsters, just because monsters are turned off doesn't mean it removes them all. It seems to just turn of the spawning. To do good testing if monsters are causing this, after turning them off you need to make sure all of them around you are dead.

    I don't have time to investigate the issue, but my cpu gets high usage and causes lag and i'm running a quad 965, 8gb ram. It also just started recently but I thought it was because one of my players just built a huge monster trap.
     
  27. Offline

    anon

    For what I saw on my server:

    My world, very very old from hmod times + 47 plugins takes 97% of a CPU core load. 25 players online

    Same server with a new world takes +- 85% of CPU core load, but with many spykes of 100%, usually when a player logs in on the server, or in chunk generation. 25 players online

    Same server with new world and no plugins at all, +- 78% CPU core load, but with many spykes of 100% usually when player logs in. 25 players online.

    I used mcedit to "clean" this old world of mine of all mobs, didnt solve the issue. Even "vanilla" bukkit is taking too much CPU, even thou it does not lag, but when someone new joins to server, a lag spyke happens and everyone lags.

    Im running java 7, and a vps 8x2.4 Ghz, 2gb memory.
     
  28. Offline

    Eric1212

    Java 7, Dedied server on CentOS 4X2.3 Ghx + 8Gb of memory, i have 2 spots with lots of squids and when someone get "near" of them, the server goes over 150 % use of CPU, even if there is only 1 player in the game.

    I said "near" because we still kinda far from them when the CPU use start to grow...
    Also, i dont know how to delete theses squids.
     
  29. Offline

    Orcworm

    Try this to remove mob groups:
    http://forums.bukkit.org/threads/mech-bmobs-v0-5-6-remove-any-creatures-you-dont-want-522.4111/
     
  30. Offline

    Eric1212

Thread Status:
Not open for further replies.

Share This Page