[0.14.1] Server consumes one CPU core when idle
[0.14.1] Server consumes one CPU core when idle
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
Re: [0.14.1] Server consumes one CPU core when idle
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
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
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
On my server I can see such issue too.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.
Re: [0.14.1] Server consumes one CPU core when idle
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
I've experienced the same issue on a debian server.Loewchen wrote:Please try if just pausing the game while being connected shows the same problem.
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
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
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
Re: [0.14.1] Server consumes one CPU core when idle
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
-
- Manual Inserter
- Posts: 4
- Joined: Mon Aug 29, 2016 11:11 am
- Contact:
Re: [0.14.1] Server consumes one CPU core when idle
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
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
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.
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 (59.26 KiB) Viewed 5648 times
Re: [0.14.1] Server consumes one CPU core when idle
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
Interesting idea - I will try it out with a fresh map soon.
Re: [0.14.1] Server consumes one CPU core when idle
I presume the --no-auto-pause is responsible for adding a client called <server>?
N.B. The above is from a server now running 0.14.2.
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.
Re: [0.14.1] Server consumes one CPU core when idle
Thanks for the report, it is fixed for 0.14.3 now.