Page 1 of 1

Access to debug data via mod or any other way to get debug data on headless SERVER.

Posted: Tue Apr 29, 2025 12:55 pm
by danbka33
Is there any way to get debug data https://wiki.factorio.com/Debug_mode show-time-usage and show-entity-time-usage from a mod? The idea is simple, a mod that provides a command to get this data. There will be an exporter outside the server that collects data via RCON using this command. It will be possible to make a graph of what exactly is lagging on the server.
Now, as I understand it, there is no way to view the values ​​​​of show-time-usage and show-entity-time-usage for the server using standard tools...

Re: Access to debug data via mod or any other way to get debug data on headless SERVER.

Posted: Tue Apr 29, 2025 1:10 pm
by danbka33
Also, to get information about the real UPS on the headless server, you have to use the server logs.

We execute the command on the server
/c log (game.tick.." RealUPS")
wait a couple of seconds, execute a second time
/c log (game.tick.." RealUPS")
After that, we go to the server log, there is the time of the log recording, the game tick. Small calculations and we get the real UPS of the server.

All this is due to the fact that on the client all players see 60/60 UPS / FPS, but in reality the game speed is underestimated to 43-45 UPS. Also a proposal to add a command to calculate the current UPS for the headless server.

Re: Access to debug data via mod or any other way to get debug data on headless SERVER.

Posted: Tue Apr 29, 2025 1:16 pm
by boskid
All of those values are not part of game state, which means: depending on which game instance in MP your script would try to access those values you will get different values and if those values would be used for anything game state related, that would be an instant desync and as such those values will never be provided to scripts. Architecture of MP requires script instances running on each game instance to agree what changes should be done to game state.

Re: Access to debug data via mod or any other way to get debug data on headless SERVER.

Posted: Tue Apr 29, 2025 1:21 pm
by eugenekay
The Server and Clients must all calculate the Game data in the same manner to get the same resultant Gamestate. So you should get comparable Performance Data from a connected Client. The Server’s exact update-time Numbers will be higher across-the-board if it is the CPU bottleneck - but you can see the Relative difference between statistics to infer which Update time is the highest. Or you can download the Savefile and benchmark it locally by increasing the game.speed above what your PC can handle.

Overall, Factorio is very CPU (single thread) dependent, though some pieces are Parallelized to additional cores. Large factories tend to bottleneck at the Memory Bus - un/loading critical pieces of Entity data from the CPU’s L1/L2 caches to system DRAM 60 times per second.

Good Luck!

Re: Access to debug data via mod or any other way to get debug data on headless SERVER.

Posted: Tue May 06, 2025 7:15 pm
by danbka33
How about a way to find out the current UPS server? Without these hard calculations

I see that the CPU load on any core does not reach 100%, perhaps the issue is in the memory bandwidth.