Basic Server Config File – Arma 2

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 71: Line 71:
     MinBandwidth = 768000;
     MinBandwidth = 768000;
While connected to the dedicated server, you can use the [[Multiplayer Server Commands|admin command]] <code>#monitor</code> to monitor server resource usage. (You have to be logged in as or voted as game admin to do this.) The server never runs at more than 50 fps. When running slower, it always uses all available CPU processing power to maintain the smoothest possible gameplay. When running at less than 15 fps, you can consider the server overloaded – the mission currently played is probably too complex for given server. If you see the server is not using bandwidth that it could use, you can try increasing values MaxMsgSend and MinBandwidth.
While connected to the dedicated server, you can use the [[Multiplayer Server Commands|admin command]] <code>#monitor</code> to monitor server resource usage. (You have to be logged in as or voted as game admin to do this.) The server never runs at more than 50 fps. When running slower, it always uses all available CPU processing power to maintain the smoothest possible gameplay. When running at less than 15 fps, you can consider the server overloaded – the mission currently played is probably too complex for given server. If you see the server is not using bandwidth that it could use, you can try increasing values MaxMsgSend and MinBandwidth.
==Calculating maximum bandwidth usage==
When optimizing the settings for maximum bandwidth usage, the '''MaxMsgSend''', '''MaxSizeGuaranteed''' and '''MaxSizeNongarantueed''' values are important. The following formula applies:
MaxMsgSend * MaxPacketSize * FPS = max bytes per second
*FPS = server framerate
*MaxPacketSize = MaxSizeGuaranteed or MaxSizeNonguaranteed (whichever is higher)
Note that the MaxMsgSend setting specifies the maximum number of messages that can be sent ''per frame'', not per second, so the server framerate must be taken into account. Since the dedicated server runs at a maximum of 50fps, a MaxMsgSend value of 128 will result in a theoretical maximum of 6400 messages per second (50 x 128). Now the maximum size of the messages becomes important. If you set MaxSizeGuaranteed and MaxSizeNonguaranteed to 1400, you can simply calculate 6400 messages * 1400 bytes = 8960000 bytes per second - approximately 8.55 MB/sec, or just over 68 Mbits. This is adequate for a 100Mbit server, but some more optimization is possible.
Even good dedicated servers are hardly ever able to maintain 50fps under load in an average mission, so it can make sense to optimize the settings against a lower target framerate. Depending on the expected mission load, a maximum of 40 or 30 fps can be expected. This allows you to increase the MaxMsgSend value accordingly.
For example, assuming that the server will not be expected to achieve more than 30fps, you can raise MaxMsgSend to 256. With MaxSize values of 1400 bytes, you will see a maximum bandwidth of:
256 * 30 * 1400 = 1,0752,000 bytes/sec = '''~10.25 MB/sec'''
Well within the 100Mbit margin.


==Example Configuration File==
==Example Configuration File==

Revision as of 15:33, 30 January 2012

Introduction

This article deals with the basic.cfg, the name means nothing, and can be called anything. The real name is determined by the -cfg command line option when launching the dedicated server or the game executable - in other words it also works for clients. When you do not provide a name, a default .cfg file is loaded with a name depending on a product, located in the Documents area of the OS user profile. (For Arrowhead the name is ArmA2OA.cfg, for ArmA 2 it is arma2.cfg).

In this configuration file you should configure your server's connectivity, mainly for performance tuning.

Performance Tuning Options

There are also some parameters that can be used to fine-tune network performance. You can add following entries to arma.cfg (the main Armed Assault configuration file)

MaxMsgSend=<limit>; 
   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.
   Default: 128

MaxSizeGuaranteed=<limit>; 
   Maximum size (payload) of guaranteed packet in bytes (without headers).
   Small messages are packed to larger packets (aggregate messages).
   Guaranteed packets (aggregate messages) are used for non-repetitive events like shooting.
   Default: 512

MaxSizeNonguaranteed=<limit>; 
   Maximum size (payload) of non-guaranteed packet in bytes (without headers).
   Small messages are packed to larger packets (aggregate messages).
   Non-guaranteed packets (aggregate messages) are used  for repetitive updates like soldier or vehicle position.
   Increasing this value may improve bandwidth requirement, but it may increase lag.
   Default: 256

MinBandwidth=<bottom_limit>;
   Bandwidth the server is guaranteed to have (in bps).
   This value helps server to estimate bandwidth available.
   Increasing it to too optimistic values can increase lag and CPU load, as too many messages will be sent but discarded.
   Default: 131072

MaxBandwidth=<top_limit>;
   Bandwidth the server is guaranteed to never have (in bps).
   This value helps the server to estimate bandwidth available.

MinErrorToSend=<limit>;
   Minimal error to send updates across network.
   Using a smaller value can make units  observed by binoculars or sniper rifle to move smoother.
   Default: 0.001 (Template:Background color)

MinErrorToSendNear=<limit>;
   Minimal error to send updates across network for near units.
   Using larger value can reduce traffic sent for near units. Used to control client to server traffic as well.
   Introduced in ArmA 2 1.60, Default: 0.01

Networking Tuning Options

class sockets{maxPacketSize = <limit>;};
   Maximal size of packet sent over network. 
   This can be set for both client-to-server AND server-to-client(s) independently!
   see client(arma2.cfg#Generic_config or arma2oa.cfg#Generic_config, ) 
   Default: 1400
   Template:Background color
   Desync might happen if used MaxSizeGuaranteed/MaxSizeNonguaranteed values over the maxPacketSize. 
   maxPacketSize default reduced from 1490 to 1400, thus MaxSize... values over 1300 could be affected negatively.

Other Tuning Options

NOTE: See the talk page for some more background info by Suma.
MaxCustomFileSize=<size_in_bits>;
   Users with custom face or custom sound larger than this size are kicked when trying to connect.
Note
The greatest level of optimization can be achieved by setting the MaxMsgSend
and MinBandwidth parameters. For a server with 1024 kbps we recommend the
following values:
   MaxMsgSend = 256;
   MinBandwidth = 768000;

While connected to the dedicated server, you can use the admin command #monitor to monitor server resource usage. (You have to be logged in as or voted as game admin to do this.) The server never runs at more than 50 fps. When running slower, it always uses all available CPU processing power to maintain the smoothest possible gameplay. When running at less than 15 fps, you can consider the server overloaded – the mission currently played is probably too complex for given server. If you see the server is not using bandwidth that it could use, you can try increasing values MaxMsgSend and MinBandwidth.

Example Configuration File

// These options are created by default
language="English";
adapter=-1;
3D_Performance=1.000000;
Resolution_W=800;
Resolution_H=600;
Resolution_Bpp=32;


// These options are important for performance tuning

MinBandwidth = 320000;			//* Bandwidth the server is guaranteed to have (in bps). This value helps server to estimate bandwidth available. Increasing it to too optimistic values can increase lag and CPU load, as too many messages will be sent but discarded. Default: 131072
MaxBandwidth = 10000000000;		//Bandwidth the server is guaranteed to never have. This value helps the server to estimate bandwidth available.

MaxMsgSend = 256;			//* Maximum number of messages that can be sent in one simulation cycle. Increasing this value can decrease lag on high upload bandwidth servers. Default: 128
MaxSizeGuaranteed = 1024;		//Maximum size of guaranteed packet in bytes (without headers). Small messages are packed to larger frames. Guaranteed messages are used for non-repetitive events like shooting. Default: 512
MaxSizeNonguaranteed = 64;		//Maximum size of non-guaranteed packet in bytes (without headers). Non-guaranteed messages are used for repetitive updates like soldier or vehicle position. Increasing this value may improve bandwidth requirement, but it may increase lag. Default: 256

MinErrorToSend = 0.005;			//Minimal error to send updates across network. Using a smaller value can make units observed by binoculars or sniper rifle to move smoother. Default: 0.01

MaxCustomFileSize = 1600000;		//Users with custom face or custom sound larger than this size are kicked when trying to connect.

See Also