Page 1 of 1
[0.14.1] Server consumes one CPU core when idle
Posted: Sun Aug 28, 2016 12:25 pm
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.
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Sun Aug 28, 2016 12:30 pm
by Loewchen
Please upload a screenshot of a diagnostic tool showing the CPU time of the factorio process when the issue occurs.
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Sun Aug 28, 2016 1:38 pm
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
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Sun Aug 28, 2016 1:47 pm
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.
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Sun Aug 28, 2016 2:07 pm
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.
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Sun Aug 28, 2016 2:15 pm
by Loewchen
Please try if just pausing the game while being connected shows the same problem.
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Sun Aug 28, 2016 3:55 pm
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
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Sun Aug 28, 2016 4:13 pm
by randomic
Here are some htop screenshots.
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Mon Aug 29, 2016 9:55 am
by randomic
For some reason this time around the cpu usage isn't climbing past 50% and keeps hopping randomly between cores.
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Mon Aug 29, 2016 11:20 am
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).
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Tue Aug 30, 2016 10:44 am
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.
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Wed Aug 31, 2016 2:24 am
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.
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Wed Aug 31, 2016 1:43 pm
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?
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Wed Aug 31, 2016 1:52 pm
by Hexus_One
Interesting idea - I will try it out with a fresh map soon.
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Wed Aug 31, 2016 6:54 pm
by randomic
I presume the --no-auto-pause is responsible for adding a client called <server>?
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.
Re: [0.14.1] Server consumes one CPU core when idle
Posted: Thu Sep 01, 2016 11:39 am
by kovarex
Thanks for the report, it is fixed for 0.14.3 now.