News:

Simutrans Forum Archive
A complete record of the old Simutrans Forum.

Server disconnects

Started by pkm, July 08, 2013, 07:41:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pkm

Hi
I'm playing a large simutrans map on a server. unfortunately in late game i get more and more disconnects and I'm not sure why.

server
FreeBSD 9
simutrans 112.3 r6520
Pak128 2.3.0


Build Config
COLOUR_DEPTH = 0
OSTYPE = freebsd
DEBUG = 3
OPTIMISE = 1
WITH_REVISION = 1
PNG_CONFIG = pkg-config libpng


config/simuconf.tab
seperate_halt_capacities = 1
no_tree = 1
saveformat = bzip2
autosaveformat = zipped
autosave = 0
server_frames_ahead = 5
#server_frames_between_checks = 256
server_frames_between_checks = 128 # changed for testing


pak128/config/simuconf.tab
nothing special

map

  • 1024x1024
  • 4 Unternehmen
  • 83 Städte
  • 539.900 Einwohner
  • 256 Fabriken
  • 567 Fahrzeuge
  • 568 Haltestellen

server log

Message: packet_t::send: sent 74 bytes to socket[6]; id=8, size=74
Message: nwc_tool_t::do_command: steps 8346214 wkz 4114 work
Message: nwc_tool_t::do_command: id=18 init=0 defpar=standard_catenary flag=0
Message: two_click_werkzeug_t::work: Position 839,178,0 valid=2
Message: two_click_werkzeug_t::work: Setting end to 839,178,0
Message: wkz_wayobj_t::work(): route search returned 1
Message: aircraft_t::find_route_to_stop_position(): no free prosition found!
Message: aircraft_t::find_route_to_stop_position(): no free prosition found!
Message: aircraft_t::find_route_to_stop_position(): no free prosition found!
Message: aircraft_t::find_route_to_stop_position(): no free prosition found!
Message: route_t::calc_route(): No route from 81,896 to 323,608 found
Message: aircraft_t::calc_route(): search runway start near (323,608,0)
Message: route_t::append_straight_route(): start from (332,605) to (83,908)
Message: route_t::append_straight_route(): to (83,908) found.
Message: route_t::append_straight_route(): start from (83,908) to (83,898)
Message: route_t::append_straight_route(): to (83,898) found.
Message: aircraft_t::find_route_to_stop_position(): no free prosition found!
Message: aircraft_t::find_route_to_stop_position(): no free prosition found!
Message: aircraft_t::find_route_to_stop_position(): no free prosition found!
Message: aircraft_t::find_route_to_stop_position(): no free prosition found!
Message: aircraft_t::find_route_to_stop_position(): no free prosition found!
Message: network_command_t::rdwr: read packet_id=8, client_id=3
Warning: nwc_tool_t::rdwr: rdwr id=8 client=0 plnr=2 pos=839,178,0 wkzid=4097 defpar=(null) init=0 flags=0
Warning: network_check_activity(): received cmd id=8 nwc_tool_t from socket[6]
Warning: nwc_tool_t::clone: send sync_steps=2086586  wkz=4097 work
Message: network_command_t::rdwr: write packet_id=8, client_id=0
Warning: nwc_tool_t::rdwr: rdwr id=8 client=3 plnr=2 pos=839,178,0 wkzid=4097 defpar=(null) init=0 flags=0
Message: nwc_tool_t::pre_execute: append sync_step=8346349 wkz=4097 work
Message: network_world_command_t::execute: do_command 8 at sync_step 8346349 world now at 8346348
Message: packet_t::send: sent 51 bytes to socket[6]; id=8, size=51
Message: nwc_tool_t::do_command: steps 8346349 wkz 4097 work
Message: nwc_tool_t::do_command: id=1 init=0 defpar=(null) flag=0
Message: wkz_remover(): at 839,178
Message: wkz_remover_intern(): at (839,178,0)
Message: wkz_remover(): removing roadsign at (839,178,0)
Message: aircraft_t::find_route_to_stop_position(): no free prosition found!
Warning: network_receive_data: connection [6] already closed
Message: socket_list_t::remove_client: remove client socket[6]
^C


client log

Warning: network_check_activity(): received cmd id=8 nwc_tool_t from socket[536]
Message: nwc_tool_t::pre_execute: append sync_step=8345753 wkz=4110 work
Message: network_command_t::rdwr: write packet_id=8, client_id=3
Warning: nwc_tool_t::rdwr: rdwr id=8 client=0 plnr=2 pos=839,178,0 wkzid=4110 defpar=Rail_Track_240 init=0 flags=0
Message: packet_t::send: sent 71 bytes to socket[536]; id=8, size=71
Message: network_command_t::rdwr: read packet_id=8, client_id=0
Warning: nwc_tool_t::rdwr: rdwr id=8 client=3 plnr=2 pos=839,178,0 wkzid=4110 defpar=Rail_Track_240 init=0 flags=0
Warning: network_check_activity(): received cmd id=8 nwc_tool_t from socket[536]
Message: nwc_tool_t::pre_execute: append sync_step=8345848 wkz=4110 work
Message: network_command_t::rdwr: read packet_id=9, client_id=0
Warning: network_check_activity(): received cmd id=9 nwc_check_t from socket[536]
Message: NWC_CHECK: time difference to server 7
Warning: karte_t::interactive: sync_step=8345856  server=[rand=2415022381 halt=1 line=1 cnvy=1] client=[rand=2415022381 halt=1 line=1 cnvy=1]
Message: network_command_t::rdwr: read packet_id=9, client_id=0
Warning: network_check_activity(): received cmd id=9 nwc_check_t from socket[536]
Message: NWC_CHECK: time difference to server 2
Warning: karte_t::interactive: sync_step=8346112  server=[rand=3244851256 halt=1 line=1 cnvy=1] client=[rand=3244851256 halt=1 line=1 cnvy=1]
Message: network_command_t::rdwr: write packet_id=8, client_id=3
Warning: nwc_tool_t::rdwr: rdwr id=8 client=0 plnr=2 pos=839,178,0 wkzid=4114 defpar=standard_catenary init=0 flags=0
Message: packet_t::send: sent 74 bytes to socket[536]; id=8, size=74
Message: network_command_t::rdwr: read packet_id=8, client_id=0
Warning: nwc_tool_t::rdwr: rdwr id=8 client=3 plnr=2 pos=839,178,0 wkzid=4114 defpar=standard_catenary init=0 flags=0
Warning: network_check_activity(): received cmd id=8 nwc_tool_t from socket[536]
Message: nwc_tool_t::pre_execute: append sync_step=8346214 wkz=4114 work
Message: network_command_t::rdwr: write packet_id=8, client_id=3
Warning: nwc_tool_t::rdwr: rdwr id=8 client=0 plnr=2 pos=839,178,0 wkzid=4097 defpar=(null) init=0 flags=0
Message: packet_t::send: sent 51 bytes to socket[536]; id=8, size=51
Message: network_command_t::rdwr: read packet_id=8, client_id=0
Warning: nwc_tool_t::rdwr: rdwr id=8 client=3 plnr=2 pos=839,178,0 wkzid=4097 defpar=(null) init=0 flags=0
Warning: network_check_activity(): received cmd id=8 nwc_tool_t from socket[536]
Message: nwc_tool_t::pre_execute: append sync_step=8346349 wkz=4097 work
Warning: network_world_command_t::execute: wanted to execute(8) in the past
Warning: karte_t::network_disconnect(): Lost synchronisation with server.
World finished ...
Show banner ...



The message Warning: network_world_command_t::execute:   wanted to execute(8) in the past lets me think that the client is not fast/strong enough, but I'm not sure...

Would changing server_frames_between_checks help. More syncs but less load...
Are there any other options that i can change to optimise the gameplay?

the servers bandwith shouldn't be a problem...

any help is welcome

tia

TurfIt

The execute in past disconnect actually means the client ran faster than the server.

Reducing server_frames_between_checks can help the client maintain sync by giving it an idea of where the server is at more often. Allows the client to run at the same speed as the server.  256 is a very conservative setting IMHO. If bandwidth is not an issue, I'd be tempted to set this for a check every 2 secs at max.

More important that outright bandwidth is stable latency between the server and all clients. Unless the server is on a known jittery link, the server_frames_ahead can remain fixed. Each client then needs to set additional_client_frames_behind to compensate for the quality of their link (Using the server setting forces extra game delay onto all clients, even those that don't need it).

What fps are you running at? The frames_per_second setting on the server determines the rate for everybody. Typically online games have been set for 10 fps. If running faster, the frames_ahead/behind should be adjusted upwards from the defaults proportionately. These settings should really be in seconds rather than frames...  The sum of the ahead/behind settings need to be greater than the worst case transmission time from the server to the client (plus margin for other effects).

I don't know if anybody has used FreeBSD for a server before. I presume you're compiling yourself; Make sure the "#warning TCP_NODELAY not defined. Expect multiplayer problems." isn't present in the make output.

prissi

The first server ever was on a BSD machine, so BSD is not the problem. The workload is, especially route search of ships can lead to strong fluctuations in frame rate. As written, first try to lower the frame rate to 15 fps or 10 fps if not already done so. Othewise you could disable pedestrians at stops and in cities, this will also imrpove performance a little.

pkm

Hi TurfIt and prissi,

Thx for your fast response  :D

Quote from: TurfIt on July 08, 2013, 08:23:20 PM
Reducing server_frames_between_checks can help the client maintain sync by giving it an idea of where the server is at more often. Allows the client to run at the same speed as the server.  256 is a very conservative setting IMHO. If bandwidth is not an issue, I'd be tempted to set this for a check every 2 secs at max.

My settings are 25fps. This would result in something like 40-50 server_frames_between_checks?
I guess this is a server setting an not savegame dependent.

Quote
More important that outright bandwidth is stable latency between the server and all clients. Unless the server is on a known jittery link, the server_frames_ahead can remain fixed. Each client then needs to set additional_client_frames_behind to compensate for the quality of their link (Using the server setting forces extra game delay onto all clients, even those that don't need it).

Minimum = 23ms, Maximum = 85ms, Average = 35ms
I cannot tell about the other clients. but I have less disconnects when i'm the only one online :)

Quote
What fps are you running at? The frames_per_second setting on the server determines the rate for everybody. Typically online games have been set for 10 fps. If running faster, the frames_ahead/behind should be adjusted upwards from the defaults proportionately. These settings should really be in seconds rather than frames...  The sum of the ahead/behind settings need to be greater than the worst case transmission time from the server to the client (plus margin for other effects).

10fps? wow. i think this is where i start to "optimise"

Quote
I don't know if anybody has used FreeBSD for a server before. I presume you're compiling yourself; Make sure the "#warning TCP_NODELAY not defined. Expect multiplayer problems." isn't present in the make output.

Nope can't find a reverence to TCP_NODELAY but
> grep #warning simubuild.log
simmain.cc:2:2: warning: #warning "Simutrans is preferably compiled as 32 bit binary!"


I will try it with the frame rate and report back

thanks