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

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

danbka33
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Sep 03, 2016 7:56 pm
Contact:

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

Post 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...
danbka33
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Sep 03, 2016 7:56 pm
Contact:

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

Post 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.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4059
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

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

Post 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.
eugenekay
Filter Inserter
Filter Inserter
Posts: 614
Joined: Tue May 15, 2018 2:14 am
Contact:

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

Post 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!
danbka33
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Sep 03, 2016 7:56 pm
Contact:

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

Post 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.
Post Reply

Return to “Ideas and Suggestions”