Server upload choke

matsomatso Master of Patches Join Date: 2002-11-05 Member: 7000Members, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Shadow, NS2 Community Developer
edited August 2014 in Server Discussion
I had a discussion with ATF about clients getting yellow plugs even though the server was seemingly doing fine. He believed that the yellow plugs mostly happened to clients connecting last to the server. And it had gotten worse, not better when the bwlimit was increased.

It turned out that the server had a 10Mbit upload limit, which on the face of it sounds fine - 20 players at 25kb/sec gives a peak bandwidth use of 500kb/sec which is less than half the max.

However ... it turns out that you need to analyze this on the ms level, not the second level.

At the ms level, a 10Mbit connection is (rougly) 1Mbyte/sec = 1kb/ms.

This means that if the server for some reason needs to send a large update to all players at the same time you might be looking at each player getting a 2-3kb packet each.

And the server will loop through players from top to bottom... with 24 players and each player adding 2-3ms delay to everyone coming later, you can easily look at > 50ms upload choke latency added to the last few players.

Which means that they will receive the packet after > 100ms, ie an interp buffer overrun - teleporting and rubberbanding galore.

Even worse, trying to push 50-100kb of data in 1ms may well cause packet loss in the upload link, so late players may not be getting their packets AT ALL.

Now, a non-loaded server tries to service the clients every 5ms or so which spreads out the load a bit.

Unfortunately, if a server starts getting loaded, it will prioritize processing player moves... which means that if a server has < max ticks, it will only service the network once every tick... and if the ticks drops below the sendrate, it means that every network service will have ALL players updated at the same time.

And this usually happens just when there is a lot of things going on.. so you get smacked with large network updates to ALL players at once.

This should not be a problem for 100Mbit up connections, but if you are running a server on a 10Mbit upload, you might want to keep that in mind when you scale and configure the server.

Peak bandwidth use scales roughly with the square of the players, so a 24 player server requires 4 times the bandwidth of a 12 player server. This also means that dropping just a few players may well fix any bandwidth limit problems.

Apart from dropping playercount, decreasing sendcount and increasing interp is also possible - increasing interp to 150ms allows you to decrease sendrate to 13, which should result in about 30% less bandwidth use.

This came up after the 268 codefreeze, but for 269 I'm hoping to add server peak bandwidth use to the ServerPerformanceData. Might also be possible to make the server aware of the upload bandwidth limitation and spread out the pain among the players a bit.

Comments

  • METROIDMETROID Join Date: 2012-10-31 Member: 165171Members, Reinforced - Supporter
    @matso, how about commanders? What update priority do they have and what bandwidth rate they consume? Because, there is a server with 20 slots on 100Mbit channel. All players are fine, but commanders sometimes experiencing yellow/red plugs of doom and lags (sometimes up to 5 sec). That is started after 268 build. Is it somehow relates to your post? Or you need more info on that (video/logs)?
  • matsomatso Master of Patches Join Date: 2002-11-05 Member: 7000Members, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Shadow, NS2 Community Developer
    Hmm.. commanders are a pure Lua level thing ... so they are not treated any differently than other players by the engine.

    They do consume more bandwidth in general because they jump around the map a lot - when they do, the new entities need a full state update rather than the much smaller delta update (same thing happens when you go through a PG).

    But it should obviously not be that bad.
  • IronHorseIronHorse Developer, QA Manager, Technical Support & contributor Join Date: 2010-05-08 Member: 71669Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Subnautica Playtester, Subnautica PT Lead, Pistachionauts
    I would presume spectators are some of the worst offenders, clicking back and forth between players constantly?
    If a server wanted to increase the bandwidth limitation without increasing interpolation (which trades rubber banding for delays) could they just modify their bwlimit variable to a higher value?
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited August 2014
    IronHorse wrote: »
    I would presume spectators are some of the worst offenders, clicking back and forth between players constantly?
    If a server wanted to increase the bandwidth limitation without increasing interpolation (which trades rubber banding for delays) could they just modify their bwlimit variable to a higher value?

    Interpolation has nothing really to do with the bwlimit beside that by increasing the sendrate your server will send more packets per second and therefore uses more bandwidth and the other way around ;)

    Overall increasing the bwlimit is kind of a nobrainer to do as long as the server has enought total bandwidth.

    Imho the default value of bwlimit should be increased to 50 kb/s (or even better 100 kb/s) just to avoid any kind of choke but that would mean 1,2 MB/s max upload is needed for 24 slots, so for hosting a server it would be requiered to have at least a connection of 10 Mbit/s.

    So the real issue at woozas server is not having enought bandwidth avaible overall but that's not a real suprise for me.
  • Cannon_FodderAUSCannon_FodderAUS Brisbane, AU Join Date: 2013-06-23 Member: 185664Members, Squad Five Blue, Squad Five Silver, Reinforced - Shadow
    Would this explain why I get a red plug, but can hear everyone talking fine, my upload is basically zero, but download is ok. Eventually, the game would just freeze. This generally happen to me when I play on high ping servers (300 ping+). I am connecting from Australia to East Coast NA or EU.
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited August 2014
    Would this explain why I get a red plug, but can hear everyone talking fine, my upload is basically zero, but download is ok. Eventually, the game would just freeze. This generally happen to me when I play on high ping servers (300 ping+). I am connecting from Australia to East Coast NA or EU.

    The bwlimit has nothing to do with the client it's a server only config param.

    But yeah could explain your issue as voice chat packets are handled abit different afaik. Beside that maybe the server packets just get lost due to the latency you have.

    Seems like the server you are playing on runs into chokes. Just use net_stats and watch the choke field (should stay at 0%) :D
  • Cannon_FodderAUSCannon_FodderAUS Brisbane, AU Join Date: 2013-06-23 Member: 185664Members, Squad Five Blue, Squad Five Silver, Reinforced - Shadow
    @GhoulofGSG9‌ Thanks. But its so nice to play in EU and seeing all the familiar names (forum regs) :(. I didn't realize some of you had accents (so cool to have @MuckyMcFly‌ as comm - didn't realize he had a radio announcer accent). So cool.
  • ATFATF Join Date: 2014-05-09 Member: 195944Members
    While the bandwidth calculations are factually correct, it's undeniable that the moment 267 was released, the server became unplayable (with default settings). I'd like to see this discussed.
    Why doesn't it run as before with bwlimit 25?

    There's disappointment in the ranks of our valuable remaining players. Not an ideal situation if you want to avoid people stop playing NS2.
  • lifesfunlifesfun Join Date: 2011-02-24 Member: 83302Members, Reinforced - Shadow
    I am having red plug/yellow/interpolation without crashing as well. I noticed pregame plus seemed to increase the problem drastically.

    ( Pregameplus 10+ a game ) vs. ( 1-2 without pregameplus )

    Of course what was interesting is that I noticed no tickrate drop, no choke, no errors, and not every player would red plug sometimes. Even after 10 seconds plus the connection would come back.

    Another thing that helped was increasing interpolation buffer to 150 however I am still having problems. I run a 18 slot server and I was hoping to have increased rates or non standard like 20 sr 20 mr or 25/25 or my goal was 30/30. sigh... well I hope to see some new tools :D I feel lost when I do not have errors.

    I made a query to my provider to see my networking limits. I think this is the cause due to reading this. I find it odd that mods I have used for a long time seem to be causing problems now.
Sign In or Register to comment.