Page 1 of 1

What causes our server lag?

Posted: Fri Jan 13, 2017 10:40 am
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?

Re: What causes our server lag?

Posted: Thu Jan 19, 2017 8:34 pm
by noliVe
can you upload the map for testing please?

Re: What causes our server lag?

Posted: Fri Jan 20, 2017 7:26 am
by DRY411S
noliVe wrote:can you upload the map for testing please?
To where?

Re: What causes our server lag?

Posted: Sun Jan 22, 2017 5:00 pm
by noliVe
here... below you have "UPLOAD ATTACHMENT"

right next to "OPTIONS"

Re: What causes our server lag?

Posted: Sun Jan 22, 2017 9:11 pm
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.

Re: What causes our server lag?

Posted: Sun Jan 22, 2017 10:25 pm
by noliVe
first i want confirm what version you play on?

the map seams to be 14.21 ? correct?

Re: What causes our server lag?

Posted: Sun Jan 22, 2017 10:35 pm
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

Re: What causes our server lag?

Posted: Sun Jan 22, 2017 11:17 pm
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,

Re: What causes our server lag?

Posted: Mon Jan 23, 2017 9:00 am
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.

Re: What causes our server lag?

Posted: Mon Jan 23, 2017 10:24 am
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?

Re: What causes our server lag?

Posted: Mon Jan 23, 2017 10:47 am
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.

Re: What causes our server lag?

Posted: Mon Jan 23, 2017 10:53 am
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.

Re: What causes our server lag?

Posted: Mon Jan 23, 2017 10:57 am
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?

Re: What causes our server lag?

Posted: Mon Jan 23, 2017 2:31 pm
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.

Re: What causes our server lag?

Posted: Tue Jan 24, 2017 2:59 am
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

Re: What causes our server lag?

Posted: Tue Jan 24, 2017 7:54 am
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.

Re: What causes our server lag?

Posted: Tue Jan 24, 2017 9:46 am
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?

Re: What causes our server lag?

Posted: Tue Jan 24, 2017 10:36 am
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

Re: What causes our server lag?

Posted: Tue Jan 24, 2017 6:55 pm
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!!!!!

Re: What causes our server lag?

Posted: Thu Aug 17, 2017 2:20 pm
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.