What causes our server lag?

Find multiplayer games.
Tools/scripts to run a dedicated server.
Post Reply
User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 726
Joined: Sun Mar 13, 2016 9:48 am
Contact:

What causes our server lag?

Post by DRY411S »

There are 2 of us playing on a very small server (AMD N36L, 8GB memory, SATA 2 disk) the same game map for 774+ hours, and it's got to the point where lag is unbearable. We have UPS-up mod and that has improved things. The map we're using was made using default settings.

The OS is CentOS-7 64-bit minimal install.

The server is in my house with fibre broadband that 'sends' to the internet at around 20Mbits.

Looking at 'top' on linux, when either or both of us is logged in, a single core is maxxed at 100% all the time, the other seems unused.

Virtual and physical memory occupancy is less than 2GB for OS and factorio.

Everything is pretty smooth unless we decide to go murdering biters to claim some more land.

Then lag means that we just cannot move for up to a minute at a time.

Where is the most likely cause of this lag please?

noliVe
Filter Inserter
Filter Inserter
Posts: 327
Joined: Tue May 24, 2016 7:46 am
Contact:

Re: What causes our server lag?

Post by noliVe »

can you upload the map for testing please?

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 726
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: What causes our server lag?

Post by DRY411S »

noliVe wrote:can you upload the map for testing please?
To where?

noliVe
Filter Inserter
Filter Inserter
Posts: 327
Joined: Tue May 24, 2016 7:46 am
Contact:

Re: What causes our server lag?

Post by noliVe »

here... below you have "UPLOAD ATTACHMENT"

right next to "OPTIONS"

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 726
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: What causes our server lag?

Post by DRY411S »

OK, I assumed that the zip would be to big to be allowed as an attachment.

This is a save the day before we added the UPS-up mod because lag was too great, especially when fighting the local residents.
Attachments
hometest161229.zip
(39.9 MiB) Downloaded 207 times

noliVe
Filter Inserter
Filter Inserter
Posts: 327
Joined: Tue May 24, 2016 7:46 am
Contact:

Re: What causes our server lag?

Post by noliVe »

first i want confirm what version you play on?

the map seams to be 14.21 ? correct?

noliVe
Filter Inserter
Filter Inserter
Posts: 327
Joined: Tue May 24, 2016 7:46 am
Contact:

Re: What causes our server lag?

Post by noliVe »

i cannot find any thing causing lags
... and STOP KILLING trees ;P


check some mods and pls tell us all mods you use

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 726
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: What causes our server lag?

Post by DRY411S »

noliVe wrote:i cannot find any thing causing lags
... and STOP KILLING trees ;P


check some mods and pls tell us all mods you use
Well I guess unless you are using the same spec of server, and are using something higher, and better bandwidth, you won't see lag,

Artentus
Filter Inserter
Filter Inserter
Posts: 307
Joined: Sat Sep 24, 2016 8:16 pm
Contact:

Re: What causes our server lag?

Post by Artentus »

I'm pretty sure there is no other way to improve this than to upgrade your Processor. The N36L is so weak, I'm kinda surprised you even managed to play for this many hours.
Ideally you'll want something in the 3.5-4GHz range from Intel to run large maps at 60 UPS.

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 726
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: What causes our server lag?

Post by DRY411S »

Artentus wrote:I'm pretty sure there is no other way to improve this than to upgrade your Processor. The N36L is so weak, I'm kinda surprised you even managed to play for this many hours.
Ideally you'll want something in the 3.5-4GHz range from Intel to run large maps at 60 UPS.
Thanks for your reply.

So you think this a CPU issue, rather than network? I've assumed memory and disk speed is not a cause.

Is there anything I can display in the game debug menus to show what specifically the CPU is doing that is causing the lag?

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: What causes our server lag?

Post by mrvn »

DRY411S wrote:
Artentus wrote:I'm pretty sure there is no other way to improve this than to upgrade your Processor. The N36L is so weak, I'm kinda surprised you even managed to play for this many hours.
Ideally you'll want something in the 3.5-4GHz range from Intel to run large maps at 60 UPS.
Thanks for your reply.

So you think this a CPU issue, rather than network? I've assumed memory and disk speed is not a cause.

Is there anything I can display in the game debug menus to show what specifically the CPU is doing that is causing the lag?
You mentioned running top and it shows 100% cpu used. That is you limiting factor. Factorio is pretty much single core and your game speed is determined by the slowest system in the game.

Artentus
Filter Inserter
Filter Inserter
Posts: 307
Joined: Sat Sep 24, 2016 8:16 pm
Contact:

Re: What causes our server lag?

Post by Artentus »

Yes I very much think this is a CPU issue.
Factorio is heavily CPU bottlenecked. The biters are one of the more CPU demanding things so them lagging the game out is a clear indication of a CPU bottleneck.

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 726
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: What causes our server lag?

Post by DRY411S »

mrvn wrote:
DRY411S wrote:
Artentus wrote:I'm pretty sure there is no other way to improve this than to upgrade your Processor. The N36L is so weak, I'm kinda surprised you even managed to play for this many hours.
Ideally you'll want something in the 3.5-4GHz range from Intel to run large maps at 60 UPS.
Thanks for your reply.

So you think this a CPU issue, rather than network? I've assumed memory and disk speed is not a cause.

Is there anything I can display in the game debug menus to show what specifically the CPU is doing that is causing the lag?
You mentioned running top and it shows 100% cpu used. That is you limiting factor. Factorio is pretty much single core and your game speed is determined by the slowest system in the game.
Thanks for the reply. I also mentioned that CPU is showing in top as 100% almost all the time. Then when the game lags I don't see any processor wait states or queuing being flagged. So is all the lag being managed inside the game? The game 'knows' my processor isn't powerful enough and starts queuing work itself?

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: What causes our server lag?

Post by mrvn »

Guessing but this is probably how it works: The game computes one game tick. Then it checks the time to see if it should sleep before starting the next tick. If there is time between ticks the CPU usage will drop below 100%. If there is no time the game will compute one tick after the other as fast as it can. How fast it can do it determines the UPS you get.

Now in multiplayer there is another step: After computing a tick it computes a hash (probably not every time) of the game state and checks that with other players. Everyone has to have the same hash or you get a desync issue. This check can stop your local game from doing 60 UPS if other players or the network are slow. You have to wait for the slowest player, and that includes the headless server. In this case I would assume you would see the CPU usage go below 100%. But it might also be stuck at 100% in a waiting state. But that too should be visible.

noliVe
Filter Inserter
Filter Inserter
Posts: 327
Joined: Tue May 24, 2016 7:46 am
Contact:

Re: What causes our server lag?

Post by noliVe »

i tested on our servers without any mods, 3,4ghz xeno CPU 48 gb Ram, linux Debian 6
my Computer 3,2 ghz I7 .3770 16GBRam

my analys..
- Multiplayer heavy lags when going near chunks with more then 10 nests
- Solo Game not a single lag.

i think its the size of the map and visíble biter nests if you may notice you never get attackt from more than 2 sides at the same time ?
Here comes my opinon. the game always calculate biter movement, on some maps you can see biters are not spawning when you are not near a loaded chunk so on my maps i keep the map very clean without biters be seen much.
on his map its nearly impossible to clean that area maybe try kill them with a kill bash command could solve a smaller radius?

what about cpu temperature, amd always have problems with that too. but still its the games fault! you cannot do anything about this right now, wait for an update 0.15 is nearly out

still i have the same issues on my maps using roboports. thats why i started using Trains only

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 726
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: What causes our server lag?

Post by DRY411S »

noliVe wrote:i tested on our servers without any mods, 3,4ghz xeno CPU 48 gb Ram, linux Debian 6
my Computer 3,2 ghz I7 .3770 16GBRam

my analys..
- Multiplayer heavy lags when going near chunks with more then 10 nests
- Solo Game not a single lag.

i think its the size of the map and visíble biter nests if you may notice you never get attackt from more than 2 sides at the same time ?
Here comes my opinon. the game always calculate biter movement, on some maps you can see biters are not spawning when you are not near a loaded chunk so on my maps i keep the map very clean without biters be seen much.
on his map its nearly impossible to clean that area maybe try kill them with a kill bash command could solve a smaller radius?

what about cpu temperature, amd always have problems with that too. but still its the games fault! you cannot do anything about this right now, wait for an update 0.15 is nearly out

still i have the same issues on my maps using roboports. thats why i started using Trains only
Thanks for taking the time to try this on some seriously upscaled hardware compared with my server. Your results are both valuable and worrying at the same time. At least I know now that throwing thousands of pounds at new hardware won't help, but being forced to play a certain way to stop it happening isn't very satisfactory.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: What causes our server lag?

Post by mrvn »

You list a high end server. But what about your desktop/laptop where you play on? Is that now the bottleneck or does the server max out at 100% CPU?

User avatar
DRY411S
Filter Inserter
Filter Inserter
Posts: 726
Joined: Sun Mar 13, 2016 9:48 am
Contact:

Re: What causes our server lag?

Post by DRY411S »

mrvn wrote:You list a high end server. But what about your desktop/laptop where you play on? Is that now the bottleneck or does the server max out at 100% CPU?
He lists his PC in line below his server
my Computer 3,2 ghz I7 .3770 16GBRam

noliVe
Filter Inserter
Filter Inserter
Posts: 327
Joined: Tue May 24, 2016 7:46 am
Contact:

Re: What causes our server lag?

Post by noliVe »

bottleneck? ;)

it doesnt matter what hardware you use. on a certain point in the game biteres rule the entire world and each of them is creating a waypoint to navigate. since your train has waypoints to but is restricted in the posibilitys ... biters have many option left right up down attack run avoid....those are causing the most lags. on active chunks near a player lag can ocure..

here its the games fault. build less radars and try kill all biters you see directly befor they walk over every centimeter. ;)

to test out your CPU speed start the savegame in singleplayer if the game realy cause a lag there your hardware is at fault.. my first sugguestion is ..
get more RAM!!!!!

dinodod
Long Handed Inserter
Long Handed Inserter
Posts: 84
Joined: Tue Mar 10, 2015 10:42 pm
Contact:

Re: What causes our server lag?

Post by dinodod »

This is a bug clearly and needs to be fixed, there should be no reason for biters to kill FPS if your not near them.

Post Reply

Return to “Multiplayer / Dedicated Server”