Lags when a new player comes in

Post Reply
Astrobe
Member
Posts: 568
Joined: Sun Apr 01, 2018 10:46

Lags when a new player comes in

by Astrobe » Post

Hello,

I run a small server on a domestic ADSL connection (6Mb download 1Mb upload). Recently players started to report lags when a new player joins (but not when an existing player logs in).

I *believe* this is related to the fact that I've also recently added music to the game (15 tracks, total 7MB). It's not like it is a popular server though, so maybe the issue was there before that.

Before that I tried to tweak the connection parameters in the config file to try to optimize the upload bandwidth. Here are the (more or less) relevant parts:

Code: Select all

# you should edit this if you expect a lot of friends
max_users = 10
# should be at least max_users x 2
# max_packets_per_iteration = 256

# use 2 or 3 if you don't want data corruption in case of server crash.
# 1 is safe wrt to game crashes.
sqlite_synchronous = 1
# C55's settings for bad connections.
max_block_generate_distance = 8
max_block_send_distance = 6
server_map_save_interval = 15.3
player_transfer_distance = 3
server_side_occlusion_culling=true
block_send_optimize_distance = 5
max_objects_per_block=128

# try to save more bandwidth
map_compression_level_net=5

mesh_generation_interval=10

num_emerge_threads=1

debug_log_level=warning
debug_log_size_max=10

server_announce=true
### Redacted before posting to avoid sending unwanted traffic there. The actual thing is .org
remote_media = https://minetestmedia.foo-projects.com/

# next three determine the size of the "player bubble"
# where ABMs and tmers are active. This affects a lot of things in the game.
active_block_range = 3 
active_object_send_range_blocks=3
active_objecct_send_range_blocks=4
strict_protocol_version_checking=true
I don't expect miracles from my 1MB upstream, but is there anything more I can do with parameters to mitigate the issue?

User avatar
Festus1965
Member
Posts: 4181
Joined: Sun Jan 03, 2016 11:58
GitHub: Festus1965
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

Re: Lags when a new player comes in

by Festus1965 » Post

Believing is nice ...
but first false the music and check if it really IS the problem, and then look for settings, options ...
and as you are using media project ... this upload is not at you

and after that results it might be worth to think further
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

User avatar
Minix
Member
Posts: 144
Joined: Thu Nov 12, 2020 13:51
In-game: Minix

Re: Lags when a new player comes in

by Minix » Post

I do not know if there is a way to limit the download speed of clients downloading media from the server, but keep in mind that the remote media server you are using most likely does not have every mod your server has so your players will still have to download some files from your server. You can verify that by deleting your minetest cache and then with a program that monitors network connections in real time like iftop for example, take a look from which IP addresses your computer is downloading data while connecting to your server.

The setting max_packets_per_iteration limits the amount of packets sent on every server step globally, which means if a player downloading media exhausts the packet quota, the players on the server will experience lag because the server will not send them packets until the next server step. You should check your minetest logs and look for warnings related to packet quota, if you are getting a lot of those warnings then most likely your max_packets_per_iteration is set too low.

You could try increasing it to 1024 for a while and check if the warnings are gone, there is no harm in increasing that number other than you will get more network traffic but if you throttle the network you are slowing down your players.

Also remember to remove the hash sign before the setting so it gets uncommented.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests