Raised This Month: $ Target: $400
 0% 

Calculate Bandwidth Usage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
r4f4w
Member
Join Date: Jul 2019
Old 04-22-2020 , 11:20   Calculate Bandwidth Usage
Reply With Quote #1

I have 9 servers running with 128 tick. One of them is DM FFA with 16 players, and the rest is competitive and retakes.

I want to know how I can calculate each server bandwidth usage.

I have an average of 70~80 simultaneous players, but when all servers get full (~90 players), all the servers start to get loss. And I'm sure that the problem is the bandwidth.

The value it's unstable, it goes around 1% and 12%, sometimes it goes to 0%.

I have 100mbps download and 50mbps upload (12,5 mb/s and 6,25 mb/s , respectively).

I've alredy downloaded iftop and vnstat, but I can't understand the output of them.

NOTE: I DON'T want generic numbers ("a server with 10 players and 128 tick uses XXX of bandwidth"). I want to know how to calculate this for my server.
r4f4w is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-22-2020 , 12:53   Re: Calculate Bandwidth Usage
Reply With Quote #2

My lazy calculator http://ambaca.github.io/rate-calculator-2015/

anyway... it depends a game, game mode, map how well it have build, plugins, and many other things.

You see it better with net_graph 5,
in csgo you need remove restriction with sv_max_allowed_net_graph 5

In this pic, I have deathmatch with 10 bots. tickrate 64. And rates set high to avoid limitations.
At that moment when I take a picture, there where only 5 bots around, shooting.



You need guess and choose, what is biggest packet size (in:) player can get and not get choke.
I choose 1500 Bytes from picture.

Server is running tickrate 64, so max. updaterate is 64 packets / second.
1500 Bytes x updaterate 64 = 96000 B/s

Ok, I could restrict player rate to max. 96000
sv_maxrate 96000

Player is able to download updates maximum 96 KB/s
If server send bigger packet size than 1500 Bytes, it would split, give little choke to player.




Now then, in worst possible scenario, server try to send ALL 10 players maximum packets in same times, which should not be possible.
packet size 1500 Bytes x updaterate 64 packets / second x 10 players = 960000 Bytes per second (B/s)
~ 960 KB/s
Convert to network bandwidth, 960 KB/s * 8 = 7680 Kbps
~ 7.680 Mbps

-------------------------

Lets quickly guess your 128 tickrate server.

Lets assume max packet size 1500 Bytes again.
1500 Bytes x updaterate 128 = sv_maxrate 192000
192 KB/s x 16 players = 3072 KB/s
~ 3.072 MB/s
Convert to bandwidth X8:
~ 24.576 Mbps
One 16 players server, tickrate 128, sv_maxrate 192000

*And this is worst scenario what could happen in single srcds, sending maximum packets to ALL players.
__________________
Do not Private Message @me

Last edited by Bacardi; 04-22-2020 at 12:58.
Bacardi is offline
r4f4w
Member
Join Date: Jul 2019
Old 04-22-2020 , 13:53   Re: Calculate Bandwidth Usage
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
My lazy calculator http://ambaca.github.io/rate-calculator-2015/

anyway... it depends a game, game mode, map how well it have build, plugins, and many other things.

You see it better with net_graph 5,
in csgo you need remove restriction with sv_max_allowed_net_graph 5

In this pic, I have deathmatch with 10 bots. tickrate 64. And rates set high to avoid limitations.
At that moment when I take a picture, there where only 5 bots around, shooting.



You need guess and choose, what is biggest packet size (in:) player can get and not get choke.
I choose 1500 Bytes from picture.

Server is running tickrate 64, so max. updaterate is 64 packets / second.
1500 Bytes x updaterate 64 = 96000 B/s

Ok, I could restrict player rate to max. 96000
sv_maxrate 96000

Player is able to download updates maximum 96 KB/s
If server send bigger packet size than 1500 Bytes, it would split, give little choke to player.




Now then, in worst possible scenario, server try to send ALL 10 players maximum packets in same times, which should not be possible.
packet size 1500 Bytes x updaterate 64 packets / second x 10 players = 960000 Bytes per second (B/s)
~ 960 KB/s
Convert to network bandwidth, 960 KB/s * 8 = 7680 Kbps
~ [B]7.680 Mbps

-------------------------

Lets quickly guess your 128 tickrate server.

Lets assume max packet size 1500 Bytes again.
1500 Bytes x updaterate 128 = sv_maxrate 192000
192 KB/s x 16 players = 3072 KB/s
~ 3.072 MB/s
Convert to bandwidth X8:
~ 24.576 Mbps
One 16 players server, tickrate 128, sv_maxrate 192000

*And this is worst scenario what could happen in single srcds, sending maximum packets to ALL players.
First of all, thanks for the detailed and complete answer!!!

I just have one question:

The sv_min/maxrate cvar. I thought this command would control the maximum packet size that players would send. But you said:
Quote:
Now then, in worst possible scenario, server try to send ALL 10 players maximum packets in same times, which should not be possible.
packet size 1500 Bytes x updaterate 64 packets / second x 10 players = 960000 Bytes per second (B/s)
~ 960 KB/s
Convert to network bandwidth, 960 KB/s * 8 = 7680 Kbps
~ 7.680 Mbps
So the rate control isn't about just the player packet size upload, but the server too?

As: player send 1500 Bytes packet => server recevied => server process information => server send back a 1500 Bytes packet

Last edited by r4f4w; 04-22-2020 at 13:59. Reason: sended incomplete awnser
r4f4w is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 04-22-2020 , 14:16   Re: Calculate Bandwidth Usage
Reply With Quote #4

Have you ever used this: https://www.reece-eu.net/drekrates.php ?
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-22-2020 , 14:45   Re: Calculate Bandwidth Usage
Reply With Quote #5

You can restrict, how high rates players can use on your server.
sv_maxrate

Max updaterate and cmdrate follow -tickrate, in csgo.
Other games can use
sv_maxupdaterate
sv_maxcmdrate

You can also set minium rates what player can use.
sv_minrate
sv_minupdaterate
sv_mincmdrate

Then players can set own rates but you have set limits.
Code:
] rate 250000
] rate
"rate" = "192000" ( def. "196608" ) archive user                                 - Max bytes/sec the host can receive data
] sv_maxrate 
"sv_maxrate" = "192000" ( def. "0" ) min. 0.000000 max. 786432.000000 replicated - Max bandwidth rate allowed on server, 0 == unlimited

That above posts, calculations was just about server UPLOAD bandwidth, how much players can download information.

Players send much less data to server. CMD rate.
All I see 10KB/s. Around 80 Kbps per player.

CMD packet size (out:) goes around 150 Bytes, peak is 350 Bytes.
So 128 cmdrate x 150 Bytes = 19200 B/s
~ 153 Kbps per player.
~ 16 players = 2.448 Mbps.
*edit Around 1.280 Mbps - 2.488 Mbps, 16 players


*edit
apologize, I had fps_max set to 60, so my CMD rate didn't go any higher. That's why I see only 10KB/s.
With cmdrate 128 with no fps limit, I could reach 21KB/s. Around 168 Kbps per player.
~ 128 tick with 16 players = 2,688 Mbps
__________________
Do not Private Message @me

Last edited by Bacardi; 04-22-2020 at 15:15.
Bacardi is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-22-2020 , 18:05   Re: Calculate Bandwidth Usage
Reply With Quote #6

Quote:
Originally Posted by DruGzOG View Post
Have you ever used this: https://www.reece-eu.net/drekrates.php ?
I have to say, famous drekrates.php is out dated...

PHP Code:
    const    HLDS_MIN_DATA_RATE            4096;
    const    
HLDS_MIN_UPDATE_RATE        4;
    const    
HLDS_MAX_DATA_RATE            100000;
    const    
HLDS_MAX_UPDATE_RATE        100;

    const    
SVENDS_MIN_DATA_RATE        4096;
    const    
SVENDS_MIN_UPDATE_RATE        4;
    const    
SVENDS_MAX_DATA_RATE        100000;
    const    
SVENDS_MAX_UPDATE_RATE        100;

    const    
SRCDS_MIN_DATA_RATE            6144;
    const    
SRCDS_MIN_UPDATE_RATE        10;
    const    
SRCDS_MAX_DATA_RATE            30000;
    const    
SRCDS_MAX_UPDATE_RATE        100
__________________
Do not Private Message @me
Bacardi is offline
r4f4w
Member
Join Date: Jul 2019
Old 04-28-2020 , 09:29   Re: Calculate Bandwidth Usage
Reply With Quote #7

Quote:
Originally Posted by Bacardi View Post
You can restrict, how high rates players can use on your server.
sv_maxrate

Max updaterate and cmdrate follow -tickrate, in csgo.
Other games can use
sv_maxupdaterate
sv_maxcmdrate

You can also set minium rates what player can use.
sv_minrate
sv_minupdaterate
sv_mincmdrate

Then players can set own rates but you have set limits.
Code:
] rate 250000
] rate
"rate" = "192000" ( def. "196608" ) archive user                                 - Max bytes/sec the host can receive data
] sv_maxrate 
"sv_maxrate" = "192000" ( def. "0" ) min. 0.000000 max. 786432.000000 replicated - Max bandwidth rate allowed on server, 0 == unlimited

That above posts, calculations was just about server UPLOAD bandwidth, how much players can download information.

Players send much less data to server. CMD rate.
All I see 10KB/s. Around 80 Kbps per player.

CMD packet size (out goes around 150 Bytes, peak is 350 Bytes.
So 128 cmdrate x 150 Bytes = 19200 B/s
~ 153 Kbps per player.
~ 16 players = 2.448 Mbps.
*edit Around 1.280 Mbps - 2.488 Mbps, 16 players


*edit
apologize, I had fps_max set to 60, so my CMD rate didn't go any higher. That's why I see only 10KB/s.
With cmdrate 128 with no fps limit, I could reach 21KB/s. Around 168 Kbps per player.
~ 128 tick with 16 players = 2,688 Mbps
Now I'm not sure if the problem is my server bandwidth.

I reinstalled Debian on my server (for a new clean fresh install), and my loss went down! So i'm guessing that the problem is something else, but I don't know what!!!
r4f4w is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-28-2020 , 10:13   Re: Calculate Bandwidth Usage
Reply With Quote #8

Maybe bad driver? Firewall?
__________________
Do not Private Message @me
Bacardi is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode