High CPU use on linux servers

    Joined
    Jul 8, 2014
    Messages
    1
    Reaction score
    0
    Hello, call me Zuss. I run a game hosting provide, and Starmade is one of my top sellers.

    I recently noticed a problem with Starmade, limiting the server count on a box to the number of cores available.

    The problem is, that the servers use up 100% of one core, AT ALL TIME. It has nothing to do with load spikes, or high amount of players, it is constantly using 100%. Is this just a bug with linux, will switching to windows fix it or is this just how it is?
     
    Joined
    Jun 20, 2013
    Messages
    293
    Reaction score
    48
    • Purchased!
    Use CPU limit or NICE to keep load times down. Make sure flush pings is off and use a RAM disk if you can. A lot of the LA is due to the file handling that SM does.
     

    AndyP

    Customer Experience Manager
    Joined
    Aug 15, 2013
    Messages
    1,199
    Reaction score
    264
    • Schine
    • Wired for Logic
    You may have some problem in your setup or any cpu-load worst cases located on the server.


    Code:
    Tasks: 146 total,   3 running, 143 sleeping,   0 stopped,   0 zombie
    %Cpu(s):  1.8 us,  0.1 sy,  0.0 ni, 98.0 id,  0.1 wa,  0.0 hi,  0.0 si,  0.0 st
    KiB Mem:  32808160 total, 30522844 used,  2285316 free,   355296 buffers
    KiB Swap: 16768892 total,    14076 used, 16754816 free. 27034940 cached Mem
    
    PID     USER    PR   NI    VIRT      RES      SHR   S  %CPU %MEM  TIME+    COMMAND
    28952 starmade   20   0    9184652   1.732g   32576 S  14.3  5.5  60:47.38 java
    This is while 3 players were playing on the testserver.
    Cannot really see the 100% all the time issue.

    A few common problems:
    • Stations going over borders of sectors
    • Overlapping ship AABB with regular movement
      (example: Zero friction setup, rotating cores in a large undocked ship, will trigger a full any to any collision detection on every bit a core moves. A docked ship for example has no physics as it cant move while docked to a station and it WILL relieve all those collision detections and physics by a large amount. Or undocked ships, in a station, with more undocked ships inside)
    • slow disk speed - currently the log output is the highest usual stress a server has - but for detecting bugs its needed

    If those aren't the reasons and you made sure of that, feel free to send me a /logs directory of a server-startup and ~1-6hours operation. (Depending on logs amount. Some servers produce 20 logs (4MB each) in 5 minutes if the users do not know how to behave and what to avoid ^^° while some have 1 log per hour even with 5-8 players online.)

    [Edit]
    Ah, forgot to mention:
    Just cutting off the available CPU power is the worst thing you can do,
    it will lead to the server not being responsive (frequent 'no answer 5 sec' messages),
    delayed saving sometimes not working at all (timeouts)
    rollbacks, sometimes even chunk disruptions while the server had no time to unpack it in time.
    Also any sector change, build action or else, WILL impact the communication to other users, and this is not wanted in most cases. =)

    [/Edit]

    - Andy
     
    Last edited:
    Joined
    Jun 20, 2013
    Messages
    293
    Reaction score
    48
    • Purchased!
    You may have some problem in your setup or any cpu-load worst cases located on the server.

    [Edit]
    Ah, forgot to mention:
    Just cutting off the available CPU power is the worst thing you can do,
    it will lead to the server not being responsive (frequent 'no answer 5 sec' messages),
    delayed saving sometimes not working at all (timeouts)
    rollbacks, sometimes even chunk disruptions while the server had no time to unpack it in time.
    Also any sector change, build action or else, WILL impact the communication to other users, and this is not wanted in most cases. =)

    [/Edit]

    - Andy
    CPU limit does not do that, it limits the amount of cores/CPU power an application has access to and is recommended by many VPS companies to prevent a breach in TOS.
     

    AndyP

    Customer Experience Manager
    Joined
    Aug 15, 2013
    Messages
    1,199
    Reaction score
    264
    • Schine
    • Wired for Logic
    Yeah, okay, so its only a load-balancer.
    For single malfunctioning servers this would keep the others in normal operation, but as Zuss wrote 'ALL' servers are affected,
    this would not help, without removing the cause.

    - Andy
     
    Last edited by a moderator: