[0.14.1] Server consumes one CPU core when idle

This subforum contains all the issues which we already resolved.
rkfg
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Thu Jan 15, 2015 11:11 pm
Contact:

[0.14.1] Server consumes one CPU core when idle

Post by rkfg »

After prolonged play, the headless server starts to eat 100% of CPU (one core) when no one is connected. If someone connects the load drops to usual 20-30% and gets to 100% back when it's idle. Save attached.
Attachments
_autosave1.zip
(19.18 MiB) Downloaded 120 times
Loewchen
Global Moderator
Global Moderator
Posts: 9287
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by Loewchen »

Please upload a screenshot of a diagnostic tool showing the CPU time of the factorio process when the issue occurs.
SamSam
Inserter
Inserter
Posts: 32
Joined: Fri Jul 10, 2015 2:02 am
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by SamSam »

Have had this issue, can't show much more right now but from my server CPU graph I can clearly see the usage rise to 100% when the bandwidth drops to 0% (indicating all players leaving/desyncing/crashing). It then stays like that for around 2 hours before it drops to 0% (server crashes) and stays there until I reload the server. Makes it very difficult to keep a server going for long :cry:
rkfg
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Thu Jan 15, 2015 11:11 pm
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by rkfg »

Thanks for confirmation. I'll post a screenshot of htop when it happens again, I've restarted it recently. Just some info, I ran it on my VPS (pretty memory restricted one) and then got tired of constant swapping and moved it to my home PC. I have 32 Gb of RAM and i7-2600 so it shouldn't be an issue to run the game with big map reveal. The server uses almost 900 Mb of RAM now.
yfcz
Inserter
Inserter
Posts: 47
Joined: Mon Jul 04, 2016 7:27 pm
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by yfcz »

rkfg wrote:After prolonged play, the headless server starts to eat 100% of CPU (one core) when no one is connected. If someone connects the load drops to usual 20-30% and gets to 100% back when it's idle. Save attached.
On my server I can see such issue too.
Loewchen
Global Moderator
Global Moderator
Posts: 9287
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by Loewchen »

Please try if just pausing the game while being connected shows the same problem.
randomic
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Aug 28, 2016 3:48 pm
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by randomic »

Loewchen wrote:Please try if just pausing the game while being connected shows the same problem.
I've experienced the same issue on a debian server.

If the game is paused while someone is connected the cpu usage is normal (<1% on my box).
Also, the cpu usage seems to be normal when the server is first started and no one has connected. I haven't tested this extensively but the problem only seems to start after someone has disconnected (but not always immediately afterwards).

Additionally if I stop the server while experiencing abnormal cpu usage it seems to take much longer than usual to stop and I see the following error before it does:

Code: Select all

Error InterruptibleStdioStream.cpp:52: Reading stdin failed
This particular error might be to do with the factorio-init script. However the abnormal cpu usage happens when launching the server without factorio-init.


The server is invoked with:

Code: Select all

/opt/factorio/factorio/bin/x64/factorio --config /opt/factorio/factorio/config/config.ini --port 34197 --start-server-load-latest --server-settings /opt/factorio/factorio/data/server-settings.json --autosave-interval 10 --autosave-slots 3 --allow-commands admins-only
randomic
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Aug 28, 2016 3:48 pm
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by randomic »

Here are some htop screenshots.
Immediately after starting the server.
After connecting a client.
After pausing with the client connected.
After unpausing then disconnecting the client.
After connecting and disconnecting a client again.
Here are a few screenshots taken by another user of the box when we first noticed the problem.
CPU usage at 50 percent
randomic
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Aug 28, 2016 3:48 pm
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by randomic »

For some reason this time around the cpu usage isn't climbing past 50% and keeps hopping randomly between cores.
With no clients connected
After I connected a client
After I hit pause on the client
After disconnecting the client
When stopping the factorio server
Erus_Iluvatar
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Aug 29, 2016 11:11 am
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by Erus_Iluvatar »

I'm having the same issue here : 100% usage of 1 core with no players connected, 0,5 % with one player paused (on a save created in 14.1 with only a few hours ingame).
Hexus_One
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Feb 28, 2016 5:17 am
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by Hexus_One »

Experiencing similar issues - (only running 0.14.0 right now) - my AWS server constantly hits the CPU usage cap (of 10%) even when no players are online - however the server has been running constantly with no other problems.
Hexus_One
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Feb 28, 2016 5:17 am
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by Hexus_One »

Update: did some further testing and my server CPU usage supports randomic's findings.

V. little CPU usage on startup, then 10% CPU usage with one player connected and then jumping to full CPU usage when there are no players.

Attached is my CPU usage graph with some pointers.

EDIT: Also forgot to mention, server shut down behaves abnormally in the same fashion to randomic's situation after I left the server.
Attachments
serverCPU.JPG
serverCPU.JPG (59.26 KiB) Viewed 5646 times
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by Oxyd »

If you guys run the server with --no-auto-pause (so that it won't pause the game when the last player leaves), does the CPU usage still go to 100% after the last player leaves?
Hexus_One
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Feb 28, 2016 5:17 am
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by Hexus_One »

Interesting idea - I will try it out with a fresh map soon.
randomic
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Aug 28, 2016 3:48 pm
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by randomic »

I presume the --no-auto-pause is responsible for adding a client called <server>?
Screenshot
Either way, with this option enabled the server stays at a steady normal cpu usage when no clients are connected. Even after connecting/disconnecting multiple times. I can't do an extended test with the option enabled at the moment but hopefully someone else can.

N.B. The above is from a server now running 0.14.2.
kovarex
Factorio Staff
Factorio Staff
Posts: 8207
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.14.1] Server consumes one CPU core when idle

Post by kovarex »

Thanks for the report, it is fixed for 0.14.3 now.
Post Reply

Return to “Resolved Problems and Bugs”