News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

Simutrans-Experimental - Pak128.Britain-Ex 0.8.4 server perfomance

Started by wlindley, December 13, 2012, 02:19:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wlindley

Playing with my 2.8 GHz Pentium D on a 1.5Mbps DSL line or my dad's 2.8 GHz Pentium D on a 7 Mbps cable connection, the game takes five to ten minutes to respond to simple commands.  I can't understand why commands cannot be carried out in milliseconds instead of minutes, regardless of synch issues.  This has gotten pretty well unplayable, it has taken me all week to start four canal boats without being interrupted by "Saving game... loading game..."

ӔO

I think the command is carried out, but because the client runs behind the server, to the client it appears to take a few seconds to minutes.


Maybe the server should slow down the game speed when slower computers are connected?
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

TurfIt

The command *is* being carried out in milliseconds - on the Server. When you do something on your client, it sends a request to the server. The server then issues the actual command to all clients telling them to execute the command at game time T=1234. For clients that are maintaining pace with the server, there's minimal lag (communication delay + some margin). On your client, the game time is laging behind, hence several real-time minutes pass before you reach game time 1234 and you finally see the result.

A Pentium D 2.8 is far too slow to run this savegame (about half the required speed). About 1200 is needed on this list: http://www.cpubenchmark.net/singleThread.html  (Bare minimum based on me seeing ~55% usage on one core of a 3.8GHz Ivy I7)

asaphxiix

I have a score of 1067 there, and I can run the game mostly ok on 50% CPU (100% of core), with all processes closed, including windows explorer. Every hour or two it goes lagged and I need to rejoin.

I'm considering today buying a new board, CPU and memoire.
Was thinking of the i5 3570K there, seems like best value for a single thread at least. Do you think a standard 1777mhz RAM will do? I understand memory bandwidth is also important.

Also what would you say is a good combination between single core performance and overall performance, in regards to choosing a CPU?

ӔO

i5-3570k can do both, actually.
Turbo mode gives it quite an impressive overhead in single threaded applications.

I am using it and it works just fine.

For memory, DDR3-1600Mhz is plenty.
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

prissi

Simutrans experimental should rather be optimized, as I really wonder what is the hog. I highly suspect the acceleration code.

However the game could be run with 15 fps (which is the default setting I use for standard network games). This take a lot of load from the clients compared with 25 fps, since acceleration and moving has to be done each frame. (This can be only changed on the server, best with -fps 15 switch on command line.)

Unlike counter strike 15 fps will not result in very different movement as vehicles in simutrans anyway have to move two pixels when driving on a straight way.

wlindley

15fps should be plenty.  ...If a dual-core processor each capable of over 5.6 billion instructions per second can't keep up, there's something seriously wrong somewhere.

TurfIt

Quote from: asaphxiix on December 13, 2012, 03:22:24 PM
Was thinking of the i5 3570K there, seems like best value for a single thread at least. Do you think a standard 1777mhz RAM will do? I understand memory bandwidth is also important.
Also what would you say is a good combination between single core performance and overall performance, in regards to choosing a CPU?
3570 would be good. It's with AMDs current offerings that are lacking in single threaded performance, Intel is fine there.
Simutrans likes memory bandwidth far more than typical programs/games. Most online CPU reviews show very little gain when using faster memory. However for Simutrans, with the current online experimental game, and my default ram setting @2400, I see ~45% 1 core usage. Dropping ram to 1600 results in ~55% usage. Quite significant...


Quote from: prissi on December 13, 2012, 05:18:50 PM
Simutrans experimental should rather be optimized, as I really wonder what is the hog. I highly suspect the acceleration code.
1.8M passengers to route, 12500+ convois with many solid streams of boats with their expensive pathfinding. I'm sure game of this magnitude would be loading Simutrans standard down a fair bit too.


Quote from: prissi on December 13, 2012, 05:18:50 PM
However the game could be run with 15 fps (which is the default setting I use for standard network games). This take a lot of load from the clients compared with 25 fps, since acceleration and moving has to be done each frame. (This can be only changed on the server, best with -fps 15 switch on command line.)

Unlike counter strike 15 fps will not result in very different movement as vehicles in simutrans anyway have to move two pixels when driving on a straight way.
It's already running @13-15fps! I presume the server CPU is overloaded too given the variance.
Low FPS in simutrans really shows up in the UI. Dragging windows around at 15fps vs 30 is quite choppy.

prissi

In a server game, the fps is fixed. If the server is overloaded, then clients would immediately run ahead and wupps desync. The server does not adjust the fps, it says to the clients at which fps to run. At least this I read from the code.

The ship patchfinding occurs only when a ship starts, and then indeed the game may freeze for a split second or so and then to try to catch up. The number of passengers should be less a concern in experimental, as those are using predefined routing tables (however their recalculation takes time).

However, the shear number on convois would put many computer to its limit. I rather wonder how the VPS handles this at all. They seem to have a clever scheduler at his provider. Or all other VPS on the same cores where put elsewhere ;)

TurfIt

I think we're hijacking this... perhaps a mod could split off the performance discussion.

The server sets a target FPS, doesn't mean it can actually achieve it. Clients do have a rudimentary adjustment mechanism:

sint64 const difftime = (sint64)next_step_time - dr_time() + ((sint64)nwcheck->server_sync_step - sync_steps - settings.get_server_frames_ahead() - umgebung_t::additional_client_frames_behind) * fix_ratio_frame_time;

but this doesn't account for variable network latency or differences in the two systems. i.e. 15FPS on server != 15FPS on client - might be 14.99 or 15.01 - different oscillators...
Also, at 15FPS, the NWC_CHECK packets aren't sent often enough by default IMHO. every 256 frames... hard for clients adjust with this low frequency input. I'd guess you want timing checks at least every 5 secs given the highly fluctuating CPU loading that Simutrans causes.


While the ship pathfinding is only when a ship starts, the sheer number of ships present has quite a few starts per second. For passenger numbers, given an equal number of passengers in transit, experimental has far more ware packets due to tracking the origin than standard. Definitely a performance drain that.


I don't think the VPS is handling it. Seems the server is hitting 100% CPU. At least my client keeps running ahead and getting choked back by the above difftime adjustment(could be network latency instead but I'm seeing a steady 101ms to the server). i.e. It doesn't look like the server is achieving its target FPS. And of course one is very susceptible to disconnects when running ahead - a single other client sending a command and you're done. Why it's vital a server never maxes out.


jamespetts

Prissi, thank you for splitting this. Most helpful. For reference, my last reply on the other thread (here) dealt with some of these performance issues and replies to some of these points.

TurfIt - my FPS value on the server is set to 14. Ought I change the server_frames_between_checks value in simuconf.tab to a lower number as a result of this? As noted in the other thread, my server is reporting 40.9% CPU usage from the Simutrans-Experimental process. The output of ps uww -A shows that no other process is using any CPU power, even Apache.

Players are not reporting frequent desyncs, and I don't generally experience desyncs when I connect (except very occasionally). The issue that players are reporting is generally that they get a very high latency, probably due to the client running behind, rather than ahead of, the server.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

greenling

Jamespetts
Can a Server support a Game with 10 fps per seconds?
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

Dwachs

Quote from: jamespetts on December 14, 2012, 01:52:08 AM
Ought I change the server_frames_between_checks value in simuconf.tab to a lower number as a result of this?
Yes, then the clients will receive more check-commands and then can adjust their timings better.  You could set it to 16 (instead of the default 256).
Parsley, sage, rosemary, and maggikraut.

jamespetts

Dwachs - thank you very much for that. That is most helpful. I have modified the value in simuconf.tab, which should take effect the next time that I restart the server.

Greenling - yes, in theory, a server could be set to run at only 10fps.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

greenling

jamespetts
Quote from: greenling on December 14, 2012, 02:03:34 PM
Can a Server support a Game with 10 fps per seconds?
I have that be ask because i notice that simutransgames with more than 20fps my cpu from laptop full use.
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

jamespetts

The current server is set to run with 14fps, so that should suffice for your laptop, hopefully.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

greenling

Jamespetts
I do that test next weekend and then can i view how my CPU in the laptop in the using it.
Next week have i from Monday until Wednesday not enough  freetime.
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

jamespetts

The switch from bzip2 to gzip for compression of saved games has made a big (positive) difference to the loading/saving time.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.