Jump to content
Sign in to follow this  
terox

All about MaxMsgSend

Recommended Posts

All about MaxMsgSend

Important... If you see information within this post that is innacurate, please let me know ASAP so I can edit it

This thread is part of a much wider discussion on server bandwidth optimisation Tutorial: Server Bandwidth & Optimisation

Useful Links

BIS WIKI: basic.cfgFurther reading
A post by Suma

What the BIKI states

Maximum number of packets (aggregate messages) that can be sent in one simulation cycle ("frame").

Increasing this value can decrease lag on high upload bandwidth servers.

What we known

Default value: 128 Messages\Client

Maxmessagesend = maximum amount of messages that can be sent per simulation cycle per client

The maximum number of simulation cycles per second is 50

This however will not be the typically actual number of simulation cycles when the mission is running which will be more likely in the region of 25 to 30

To best achieve the correct value, you will first need to obtain your actual transfer rates

How best to achieve this?

This is the best information i could find http://forum.ovh.co.uk/showthread.php?t=1897

It basically states not to use Online speed testing sites because they use web browsers and that has a definte effect on the values you will get

It basically states to download a large file from somewhere and monitor the transfer rate on your backend

What I assume

(Something is wrong here)

So......

if MaxMsgSend=128 and the server FPS is at 30, the server will send out a maximum 30*128=3840 messages per second per client

Using the MaxPacketSize default of 1400 bytes, this will equate to a data transfer rate of 3840*1400=5376000 bytes\second or 5.126953125MBps (Per client ?)

Compare this to your servers connectivity, typical example being a 100MBit connection, with a data transfer rate theoretically available as

  • 100 Mbit connection: = 12.5 Megabytes\second = 13107200 bytes\second

You have enough bandwidth left for 1 more player(If only running 1 A3 server on the box) (This has got to be wrong ?)

  • 7831200 Bytes\second
  • 7.3 Megabytes per second

What we need to know:

  1. What value if any, does it default too, if the entered value is unacceptable?
  2. Would this value vary dependant on the number Virtual A3 servers you are running
  3. Would this value vary for PVP and CooP servers
  4. Would this value vary depending on the number of players the server supports
  5. How would you stress test or test this in a Benchmark mission scenario?
  6. What else ?

Calculation Formulae

(Not yet defined)

Edited by Terox

Share this post


Link to post
Share on other sites

hoping to get some data from BIS or who ever wrote the netcode, cheers

Edited by johnsm

Share this post


Link to post
Share on other sites

I can highly recommend taking a look at this thread (starting on page 3), where we did a lot of research+testing on the subject and even got some answers from the lead developer himself. :)

Lots of info in there.

Share this post


Link to post
Share on other sites

Thanks for the Links MaddogX

They however raise some questions....

As Suma states MaxMsgSend is the maximum number of messages sent to a client on each Simulation cycle

Assuming default values of

  • MaxmessgeSend: 128
  • MaxPacketsize: 1400 bytes
  • Server connectivity 100Mbit (12.5 Megabytes\second or 13107200 bytes\second)
  • Server Simulations per second : 30 (Referred to as Server FPS)

Does this mean that the bandwidth useage per client is going to be

MaxmessageSend * MaxPacketSize * Server FPS

128 * 1400 * 30

This equates too

5376000 bytes\second or 5.126953125MBps

However if the server is say on a typical 100Mbit connection. Its theoretical available bandwidth limit is

100 Mbit connection: = 12.5 Megabytes\second = 13107200 bytes\second

Yet I know :confused: that the server can support way more than 2 players

Something must be wrong with my interpretation of the information

So What am I missing ?

Does the engine reduce the amount of packets or packetsizes to accomodate more players ?

Edited by Terox

Share this post


Link to post
Share on other sites

So What am I missing ?

Does the engine reduce the amount of packets or packetsizes to accomodate more players ?

Terox, you perhaps overlook one important point:

MaxMsgSend is a upper limit for the number of packets allowed to be send per simulation frame and per client

(it does not mean, that our server has actually to send that much packets to each client and each of this packets could be smaller then MaxPacketSize )

So, there is no reservation of bandwidth for each connected client by MaxMsgSend.

BTW: thanks for you effort, to make a useful documentation for this important values

Edited by Fred41

Share this post


Link to post
Share on other sites

Well ok

So assuming my maths is correct, it will be impossible for a 100mbit connected server to send 128 full messages of 1400 bytes each to 30 clients on every cycle

So why have such a ridiculously high number of messages\cycle\client

Some more maths

Using a typical 100mbit server, with theoretical speed of 12.5Mbytes\sec

What would be a typical actual throughput be , maybe 11 Mbytes\sec

So reverse the maths

30 players on a server with a throughput of 11MBps and an FPS of 30 will allow each client (if bandwidth allocation was always equal) of 399216 bytes\second each (0.38MBps)

To achieve that, the Maxmessagesend (If sending maximum sized packets to all clients equally) could be a maximum of 9 messages (9.5 without rounding down)

Where am I going with this.... well

Reducing the maximum number of messages (when packet size remains the same) should theoretically increase the FPS and reduce CPU useage (less messages to compile and send)

According to Visceroy His post

This is exactly what happend when he tested it

The conclusion would therefore be that

Editing the Maxmessagesend value is likely to have no effect when increasing the number but have some effect when decreasing it, especially when you get down to numbers like 32

100Mbit (30FPS * Maxpacket 1400 * 32 messages = 1344000 bytes (1.28Mbytes\second

How would I be able to measure the number of packets and the size of those packets being sent every second ?

Share this post


Link to post
Share on other sites
So assuming my maths is correct, it will be impossible for a 100mbit connected server to send 128 full messages of 1400 bytes each to 30 clients on every cycle

correct (if you assume 30FPS like before)

How would I be able to measure the number of packets and the size of those packets being sent every second ?

Wireshark is very helpful for almost all network related analyses.

I think this value, MaxMsgSend, is not suitable for network performance tuning.

It could be used to cut bandwidth peaks per client, to prevent monopolizing of bandwidth.

Edited by Fred41

Share this post


Link to post
Share on other sites

It could be used to cut bandwidth peaks per client, to prevent monopolizing of bandwidth.

Thx so far...

Another set of questions then

When I view the Player list in the briefing the bandwidth that each player has can be vastly different

I recently checked and had variances of 150 to 6000

1) reference the bandwidth, is it the case that the higher value is from a player with a greater download speed than lower bandwidth value player

2) Are these values in bytes\second

3) Am I correct in assuming then, that the Maxmessagesend can be set so, as in the above example the 6000 bandwidth player would be choked down to a lower level ?

Edited by Terox

Share this post


Link to post
Share on other sites
Thx so far...

Another set of questions then

When I view the Player list in the briefing the bandwidth that each player has can be vastly different

I recently checked and had variances of 150 to 6000

1) reference the bandwidth, is it the case that the higher value is from a player with a greater download speed than lower bandwidth value player

2) Are these values in bytes\second

3) Am I correct in assuming then, that the Maxmessagesend can be set so, as in the above example the 6000 bandwidth player would be choked down to a lower level ?

I really dont know what this values in the player list mean (could be sent, receive or the sum of both?), so i cant help answering the 3 open questions.

But maybe i have an interesting hint, did you tried this:

#login password

#debug 0.1 // updates each 100ms

#debug userSent username

It shows the following values: sent [bpsec], receive [bpsec] and MsgPerSec in both directions, for the specified user.

It will show how dynamical the bandwith consumption per client in real is. Or, by using larger time intervals it shows very precise average results.

I think this way offers a better imagination, how MaxMsgSend very likely work.

This tool is required to monitor the output:

http://technet.microsoft.com/en-us/sysinternals/bb896647

Edited by Fred41

Share this post


Link to post
Share on other sites

Depending on the mission,you need to choose whther you want to save client's FPS and tolerate a certain amount of lag/desync or sacrify the clients FPS by pushing the server to synchronize everyone ....

MaxMsgSend is the first value you should play with,the more packets you send the more people will be synced with the server and therefore, their FPS will converge towards the server fps (doesn't mean it will be equal to it ) ... imagine now your maxmsgsend is 128 and the mission is so heavy and a lot of things are happening on the map,the server needs to send more than 128 messages ,let's say 192, but it can't so it will need to wait for the next simulation cycle to send what's left of the 192 and the new messages in that next simulation cycle ===> desync !

The other case is having too high maxmsgsend,which may go beyond the server bandwidth capabilities !

Well,it's related to the mission itself ,for example Warfare BE with 50 players connected ,but few action will require less maxmsgsend than the same mission with a lot of action on the map and people using AI and triggering many towns !

Be aware that maxmsgsend is related to the maxsize values,since you can reduce the number of packets sent,by increasing the size of the packet !

Share this post


Link to post
Share on other sites

that's all in your imagination.

I see absolutely no difference in how many packets server sends to each client when changing maxmessages sent from 256 to 1024 using NetworkMonitor

with 30 people on Bennys warfare

Id like to see more DEVELOPER POSTS in here demit, tired of guessing

Share this post


Link to post
Share on other sites

changed this value from 1024 to default 128 no more network message pending in RTP

Current config

language="English";

adapter=-1;

3D_Performance=93750;

Resolution_Bpp=32;

Windowed=0;

MaxCustomFileSize=0;

MinBandwidth=50000000;

MaxBandwidth=100000000;

MinErrorToSend=0.0040000002;

30+ people on Bennys map

Share this post


Link to post
Share on other sites

Twin Xeon X5570's

40 players in a coop

1GB line

Running with Maxmessage at 420 I got a server FPS at mid twenties

Dropping to default, (128) I saw a drop to 4fps

and then switching back, shot up to mid twenties again

Edited by Terox

Share this post


Link to post
Share on other sites

Best post, as easy as that :cool:

Share this post


Link to post
Share on other sites

i don't get any difference in fps from changing that, the only thing that drops FPS is minerrortosend

even if u have 6 xeon x5570 arma will only use 2 cores rofl

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×