I've spent the last few days trying to figure this out.
About every 5-15 seconds (it varies) the game will freeze for about half a second. Its enough to be incredibly annoying and screw up building placement, but the game is still playable.
I attached some of the time usage, a before and during the lag spike. I watched it for quite a while and the only noticeable thing is that each time a lag spike happens: Transport Lines explode. My understanding is this has something to do with belts. Typically it sits around 0.3, but whenever the lag spikes happen it jumps up as high as 10-20, and UPS/FPS drop significantly (recovering quite fast).
I am running linux, wayland. I'm aware this might be contributing to the issue but couldnt find any up to date info that was related. A lot of what already exists in discussion of lag spikes is to do with the GPU or CPU memory usage.
Dropping all graphics settings, texture atlas sizes, etc to the bare minimum has no impact. Toggling vsync has no impact. Running the game with steam overlay disabled has no impact.
Tracking GPU and CPU usage while factorio is running, it barely goes above 3% cpu usage (or 11% of a single core), and is only using about 3gb of memory out of 64 total. The computer is barely struggling. I've had a much larger space exploration megabase in the past, so my current base that is only a few days old definitely isnt a performance issue. Honestly its concerning how few resources factorio is using, maybe thats the issue?
I was fairly sure the lag spikes were introduced around about 0.13 or 0.14, nothing occured prior to that. It was at the release of 0.14 that I got to space though, and going back through old save files it seems that the lag spikes only begin once unlocking space (or maybe shortly before it, I dont have enough old save files), and have progressively gotten worse as the game went on. It became particularly bad once arriving on fulgora. I can load back to those old saves and there is no lag.
I am also using mods, though currently they are very minimal. Blueprint sandboxes, AII containers/warehouses, factory planner, and even distribution. None of these really stand out, and the lag spikes were happening prior to enabling blueprint sandboxes.
The only other information I can think to include is multiplayer. If a friend joins the game while I am hosting, they also get the lag spike
s. Maybe that's because they cant get ahead of me, the host, or maybe its a world thing and not system specific. EDIT: Got that friend to load the world in singleplayer, on their windows PC. they still get the lag spikes.
Hopefully thats a plenty detailed description. I'm really trying to figure out whats causing this, because it is quite annoying. I've seen a few other people discussing the issue in this discord and a few forum/reddit posts over the last few days, though none of them go into much detail.