Odd 100% CPU usage spikes every 10-15 min

Discussion in 'Performance Tweaking' started by khani, Jun 28, 2013.

  1. Hi, I'm having issues on the MC server I administer. Currently we are having odd CPU spikes, that hog 100% of the CPU for up to 30 sec.

    The server is pretty crowded most of the time with around 10-50 players 24/7.

    The server runs CentOS and got more than good enough specs for the server currently.
    Specs:
    Xeon Quad Core E3-1270 3.40 Ghz
    6 GB DDR3-1333 ECC SDRAM
    1TB 7200RPM HDD
    100mbit/s uplink

    Our regular load with both the MC server and a TF2 server with around 40 and 10 players is at 40-50% CPU and 80% RAM

    Timings on pastebin:
    http://pastebin.com/vu9FicdL


    Thanks for the help in advance :)
     

    Attached Files:

  2. joehot200

    Supporter

    Give us the timings in aik.co please. It is hard to identify the problem with a text file.
     
  3. http://aikar.co/timings.php?url=5807946

    Player Tick is on the high side, but it doesn't seem that excessive. Was this timing report taken during a lag spike?
    Also, I'm not sure if 12.801 seconds is a long enough timing period to identify the problem.
     
    • Agree Agree x 1
  4. Hm, this is odd. It was supposed to run for +24 hours.

    I will see if I can run this again.

    And yes, there were several lagspikes during the timings logging.
     
  5. jeff142

    Benefactor

    under no world is 50 players clouded for a e3-1270.
     
    • Like Like x 1
  6. Hey folks, I'm the owner of the server in question. We had some confusion on how timings commands work, but we've got it running now and will post a link with several hours later tonight. Thanks so much for the help.
     
  7. Here's one that we let run for several hours: http://aikar.co/timings.php?url=5810629

    It baffles me what could make the CPU of all things hit 100%. It lasts for 5-10 seconds, everyone gets booted, and then all goes back to normal.
     
    #7 Beaupedia, Jun 29, 2013
    Last edited: Jun 29, 2013
  8. md_5

    Administrator Developer

    Could be garbage collection, try -Xingc as a java flag.
     
    • Winner Winner x 1
  9. What other flags would you recommend? We currently don't have any flags, other than those that McMyAdmin includes automatically.
     
    #9 Beaupedia, Jun 29, 2013
    Last edited: Jun 29, 2013
  10. That seems to have done the job. Well, first it crashed us, but we figured out a c was missing here. We put "-Xincgc". CPU is fine now.

    That being said, our TPS is dipping down to around 14 or so when we're only at 20 or so people. Our RAM is down around 30% and our CPU is even lower. I don't get it.

    Here's a few hours of timings from after we made md_5's suggested change: http://aikar.co/timings.php?url=5813015
     
  11. md_5

    Administrator Developer

    Try adding -Xmx5G to your startup as well.
     
    #11 md_5, Jun 30, 2013
    Last edited: Jun 30, 2013
    • Informative Informative x 1
  12. try this

    java -d64 -XX: ParallelGCThreads=6 -Xmx5G -Xms5G -Xincgc -jar spigot.jar
     
    • Informative Informative x 1
  13. joehot200

    Supporter

    I believe the flag -XX:+UseConcMarkSweepGC enables garbage collection, which might reduce your RAM loss rate,
     
  14. md_5

    Administrator Developer

    Garbage collection is always enabled, ConcMarkSweep is just a different form, -Xincgc is probably gonna be better for his issue.
     
    • Informative Informative x 3
  15. Thanks so much, will give it a shot!
     

  16. This worked for my lagspikes, thanks!
     

  17. When I try that, I get this:

    Code (Text):
    Notice    : Starting Minecraft Server...
    Notice    : Minecraft server has stopped running.
    Warning : Server was not yet ready, automatically restarting (Attempt: 1 of 5)
    Console    : Unrecognized VM option ''
    Console    : Error: Could not create the Java Virtual Machine.
    Console    : Error: A fatal exception has occurred. Program will exit.
    Notice    : Starting Minecraft Server...
    Console    : Unrecognized VM option ''
    Console    : Error: Could not create the Java Virtual Machine.
    Notice    : Minecraft server has stopped running.
    Console    : Error: A fatal exception has occurred. Program will exit.
    Warning : Server was not yet ready, automatically restarting (Attempt: 2 of 5)
    Notice    : Starting Minecraft Server...
    Console    : Unrecognized VM option ''
    Console    : Error: Could not create the Java Virtual Machine.
    Console    : Error: A fatal exception has occurred. Program will exit.
    Notice    : Minecraft server has stopped running.
    Warning : Server was not yet ready, automatically restarting (Attempt: 3 of 5)
    Notice    : Starting Minecraft Server...
    Console    : Unrecognized VM option ''
    Console    : Error: Could not create the Java Virtual Machine.
    Console    : Error: A fatal exception has occurred. Program will exit.
    Notice    : Minecraft server has stopped running.
    Warning : Server was not yet ready, automatically restarting (Attempt: 4 of 5)
    Notice    : Starting Minecraft Server...
    Notice    : Minecraft server has stopped running.
    Console    : Unrecognized VM option ''
    Warning : Server was not yet ready, automatically restarting (Attempt: 5 of 5)
    Notice    : Starting Minecraft Server...
    Console    : Unrecognized VM option ''
    Notice    : Minecraft server has stopped running.
    Console    : Error: Could not create the Java Virtual Machine.
    Console    : Error: A fatal exception has occurred. Program will exit.
    Error    : Server failed to start 5 times. Not automatically restarting.
    Warning : Server stopped unexpectedly! Automatically restarting...
     

  18. -XX: ParallelGCThreads=6 Remove the space between : and Parrallel
     
    • Agree Agree x 1

  19. I still remember when I added "-Xingc" as md_5 advised (not this one). Took me like 2 hours to figure out why my server wouldn't start. D:
    Speaking of -Xincgc, its an awesome flag. It helped a lot for cpu spikes on my server.
     
    #19 Nikecow, Jul 19, 2013
    Last edited: Jul 26, 2013
  20. Lol, does he know he's telling people the wrong thing?