High cpu usage *SOLVED*

Discussion in 'Spigot Help' started by Dargaard, Aug 23, 2015.

  1. I have a small dedicated server for my kids and their friends, I run 2 instances of MC one in creative the other in survival, for about a month it ran with no issues. I just installed Spigot and now I have 100% CPU usage on one core for each instance.

    What I did:
    Backed everything up, ran the latest build tools, launched the servers with spigot to see what kind of issues cropped up before doing anything else. Everything seems to be working fine, no errors but each server keeps one CPU core at 100% which is new. This is with no users logged in, vanilla MC used no CPU when idle.

    Server:
    CPU Intel(R) Xeon(R) CPU W3670 @ 3.20GHz
    8GB ECC ram
    Ubuntu server 14.04 LTS clean install
    Oracle Java 8
    no other server software running
    Latests build tools used as of 2015 08 23

    Screenshot from 2015-08-23 15:47:13.png
     
  2. Mikgreg

    Supporter

    Does this only happen when the server is starting or is it like that permanently? It's normal for that to happen during server start, for me at least.
     
    • Agree Agree x 1
  3. The screen shot is with both servers running, I currently only have 1 running to eliminate the possibility of a conflict, it appears to be on going. I have also discovered the timing command and am letting that run for a bit to gather data. So far nothing stands out in the timing data.
     
  4. Can we see the timing data?
     
  5. danjb2000

    danjb2000 Retired Moderator
    Retired Supporter

    Mind sharing the timings?

    You mentioned it's running, but how long are we talking? As Mikgreg earlier mentioned, during the start-up phase it can be common for a spike in the CPU usage.
     
  6. Over an hour now, still showing 100%
     
  7. danjb2000

    danjb2000 Retired Moderator
    Retired Supporter

    Ouch. This is starting to sound like a difficulty situation.

    Mind sharing your timings report URL?
     
  8. Just like to add that I've loaded Dargaard's world file, on

    Ubuntu 14.04 LTS
    7.6GB RAM
    Intel Core i5-4570 CPU @ 3.20GHz x 4
    Intel Haswell Desktop Graphics
    64-bit

    Running spigot 1.8.8 with no extra plugins.

    My setup idles at 3% on average for top thread.

    I'm wondering if there's a difference in how Spigot handles Xeon vs. i5/i7?
     
  9. Can you run the command top and show us that ?

    Cause I’m confused cause the image you provided of htop is showing like 6 minecraft services running on the following PIDs 135278,13702,13668,13733,13731,13666

    And the server load is not bad at all its only at 2 out of 12 On a multi-processor system, the load is relative to the number of processor cores available That means the "100% utilization" mark or the OH NO SOMETHING IS GOING ON for you would be 12
     
    #10 Rustybot, Aug 26, 2015
    Last edited: Aug 26, 2015
  10. A single thread is running at 100% on spigot, but not on vanilla. If this is normal so be it but I'm still thinking this isn't normal. Top doesn't show threads or individual Cpus/cores.
     
  11. For comparison here is vanilla MC 1.8.8 running both servers, and users actually logged on and playing the game. I also expanded the window to show more threads Screenshot 2015-08-25 21.20.09.png
     
  12. I Agree Spigot shouldn’t be taking 100% of a single core,

    The reason I asked for you to run top was not for threads or individual cpus I can careless about that at this time,
    I want to see see the processes that are running cause the screenshot you gave of htop is showing 6 PIDs that are running minecraft 3 of which are at about 100% but i think that is htop being htop
     
  13. can you try loading a new world temporally on the spigot side and see if what fixes anything
     
  14. Here ya go 2 vanilla servers running one has players one does not.

    Screenshot 2015-08-25 21.34.18.png
     
  15. I will do this when I get a chance I'm not going to kick people off right now.
     
  16. Yes its very odd that spigot is causing that much CPU usage and Vanilla is next to nothing, When you can try it and let us know the results I am interested to find out the results of this.
     
  17. I will experiment, and post results for sure.
     
    • Like Like x 1
  18. Ok finally got some time to experiment, after trying a new world, different command line options, rebuilding spigot, I have narrowed it down to how I launch it. If I run it directly from the command line it works perfectly in all scenarios. If I launch it using upstart one of the threads runs at 100% cpu, in all scenarios. So it must be my upstart script. My plan was to replace my basic script with a more advanced script which will do auto back ups and some management. Seeing as this was only a temporary script anyway I will consider this issue closed for now. I will post my basic script maybe someone can spot the mistake.
    Code (Text):

    description "Minecraft Server"

    start on filesystem or runlevel [2345]
    stop on run level [!2345]

    env USER='minecraft'
    env GROUP='minecraft'
    env APPDIR='/srv/minecraft-server/'
    env APPNAME='/usr/bin/java'
    env APPOPTS='-Xmx3584M -Xms3584M -jar spigot-1.8.8.jar nogui'

    expect fork

    script
    chdir ${APPDIR}
    exec sudo -u ${USER} -g ${GROUP} ${APPNAME} ${APPOPTS} &
    end script
     
     
  19. Now using Minecraft Server Control Script everything is working smoothly so far.
     

Share This Page