Bandwidth Fix

Discuss and provide feedback on Maps.
Post Reply
User avatar
captainsnarf
Posts: 2714
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Bandwidth Fix

Post by captainsnarf »

Anonymous was saying the lag issues on the server are from bandwidth restrictions. After looking into it it seems there is code in the engine to limit the outbound data from server to client at 10000 when MaxPlayers > 16. This is regardless of client netspeed settings. The client will send more data to the server with higher netspeed setting, but the server will only trickle it to the clients at 10000 max.

This is a mutator that works around the issue.

Download here - BandwidthFix.zip

Usage - Set your MaxPlayers in game settings on the server to 16 or less, then set the real max player settings using this mutator. This works around the bandwidth restriction. MaxPlayers=16 must be set in the ut2004.ini file under [Engine.GameInfo] section.

Also included are three more options

bSetClientNetSpeed - if true, sets the client's netspeed when the map loads (default is true)
ClientNetSpeed - the netspeed value to set the client (default is 20000)
bPersistClientNetSpeed - if true, saves the client's netspeed to their User.ini file.

Code: Select all


[BandwidthFix.MutBandwidthFix]
MaxPlayers=32
ClientNetSpeed=20000
bSetClientNetSpeed=true
bPersistClientNetSpeed=false

User avatar
Anonymous.
Posts: 372
Joined: Sat Jun 12, 2021 10:54 pm

Re: Bandwidth Fix

Post by Anonymous. »

Really looking forward to seeing this on the server. you can probably raise the tick rate to at least 40 (ideally factors of 1000) now without issue, the limit being the client's netspeed.
User avatar
pooty
Posts: 4537
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Bandwidth Fix

Post by pooty »

So right now we are set at 13200 (I think it was 13600 typo). Which I set based on this: https://www.utzone.de/forum/showthread.php?t=4326

Part of that was we did see increased CPU when netspeed was 15000/20000 prior. Now maybe that was from the forced restriction (waitstates).

So Netspeed 20,000 is 20kbytes/s upload. 32*20 = 640 kbytes/sec bandwidth needed if I am reading that right, which in the days 96008N1 was a big deal. Now Most of us are on 20 Mb or more which is 2500 kbytes/sec!

So should we set it to be 20000 straight away?
Do we want to persist the ClientNetSpeed or just make every one 20000?
User avatar
Anonymous.
Posts: 372
Joined: Sat Jun 12, 2021 10:54 pm

Re: Bandwidth Fix

Post by Anonymous. »

pooty wrote: Fri Mar 31, 2023 8:33 am So right now we are set at 13200 (I think it was 13600 typo). Which I set based on this: https://www.utzone.de/forum/showthread.php?t=4326

Part of that was we did see increased CPU when netspeed was 15000/20000 prior. Now maybe that was from the forced restriction (waitstates).

So Netspeed 20,000 is 20kbytes/s upload. 32*20 = 640 kbytes/sec bandwidth needed if I am reading that right, which in the days 96008N1 was a big deal. Now Most of us are on 20 Mb or more which is 2500 kbytes/sec!

So should we set it to be 20000 straight away?
Do we want to persist the ClientNetSpeed or just make every one 20000?
This mutator is meant to unlock the "In:" value in stat net, which is currently 10000 because MaxPlayers>16. When I was running my test server, I was frequently seeing over 20kB albeit at 50+ tick (up to 80kB @ 125 tick with 31 bots). The client FPS values depend on the "Out:" value, which is the 13600 you're talking about. If the client isn't running high FPS, they won't upload a lot of data to the server, so it can just be set to 20000 and forgotten. A modern game like Overwatch typically runs at around 25kB in, 10kB out/sec, which is @ 10 players. I have my server's MaxInternetClientRate=100000 so that my NetSpeed is the limiting factor, not the server. If I set my NetSpeed to 10001, both In and Out were capped around ~10001, but I was experiencing some lag like delayed pickups, kills/deaths etc. due to the limited In, and rubber banding due to the limited Out (unable to sustain my 250 FPS).

https://streamable.com/syn95w
In this video I'm running at ~500 FPS on my test server, and depending on whether I'm stationary or not the Out changes (stationary is much higher). Even at 500 FPS I'm not really pushing that much data, but of course this is without mods/real players etc. Also notice the In is quite high due to 125 tick rate and all the mayhem going on, but if you look above, ucc isn't really making my CPU sweat at all (12.5% would mean it's saturating an entire core out of my 8) which is why I don't believe it's a CPU bottleneck at all. But this requires live testing.
User avatar
captainsnarf
Posts: 2714
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: Bandwidth Fix

Post by captainsnarf »

So UTCompOmni also has some settings around netspeed.

MinNetSpeed and MaxNetSpeed are UTComp server settings.

Setting these

Code: Select all

ClientNetSpeed=20000
bSetClientNetSpeed=true
You could do the same thing with UTComp by setting MinNetSpeed=20000 and MaxNetSpeed greater or equal to that.

The persist option is a little different. It writes the value to the user.ini file but only if it's larger than the player's value. It might be useful to turn this on for a few days and then turn it off after most players have joined the server. It will upgrade them to the higher value, but if they don't like it they could turn it back down once you turned it off a few days later.

And yes, we could probably increase the tick rate if this works.
User avatar
pooty
Posts: 4537
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Bandwidth Fix

Post by pooty »

On Server:
[UTComp]
MaxNetSpeed=20000

[IpDrv.TcpNetDriver]
;MaxInternetClientRate=13200
MaxInternetClientRate=20000

[BandwidthFix.MutBandwidthFix]
MaxPlayers=32
ClientNetSpeed=20000
bSetClientNetSpeed=true
bPersistClientNetSpeed=false

[Engine.GameInfo]
;MaxPlayers=16
; Real max set in BandwidthFix

Then we can see if we need to persist, but wouldn't this set netspeed 20000 anyway?
User avatar
pooty
Posts: 4537
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Bandwidth Fix

Post by pooty »

So its on there, but it sets/caps my netspeed at 15000 which I am not sure why as 15000 doesn't appear anywhere in the .ini files?

Haven't changed tickrate though.
User avatar
captainsnarf
Posts: 2714
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: Bandwidth Fix

Post by captainsnarf »

pooty wrote: Fri Mar 31, 2023 11:31 am So its on there, but it sets/caps my netspeed at 15000 which I am not sure why as 15000 doesn't appear anywhere in the .ini files?

Haven't changed tickrate though.
It's probably UTComp doing that. What is your ConfiguredInternetSpeed in User.ini file? I'm guessing it's 15000. When UTComp runs, if your ConfiguredInternetSpeed is > 10000 it sets your netspeed to your ConfiguredInternetSpeed. This happens after BandwidthFix sets it.

Using the persist option would fix that. We could also update UTComp to not do that now that we have a separate mutator for it.
User avatar
pooty
Posts: 4537
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Bandwidth Fix

Post by pooty »

Code: Select all

ConfiguredInternetSpeed=20000
Even if I go on the server and do netspeed 20000 it maxes it at 15000?
User avatar
pooty
Posts: 4537
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: Bandwidth Fix

Post by pooty »

Reuploaded the .ini files and restarted. Got 20000 now.

Strange thing is if I do a
get IpDrv.TcpNetDriver MaxInternetClientRate from the console it shows 200000 instead of 20000 (but might be a side effect of the mutator?). Either way can't increase netspeed past 20000 so I think its good now.
Post Reply