GameServerManagers / LinuxGSM

The command-line tool for quick, simple deployment and management of Linux dedicated game servers.
https://linuxgsm.com
MIT License
4.3k stars 820 forks source link

[arma3server] Best Pratice Configuration Options #270

Closed AlienXAXS closed 8 years ago

AlienXAXS commented 9 years ago

Hey, Thanks for making the linux arma3server installer, however it is missing a few things and I thought that I would bring these configuration files to your attention.

Just as an idea about me, I have hosted very popular DayZ servers and ArmA3 Wasteland servers, as well as coded for both of them, I have many years experience of running ArmA servers.

Unfortunately BI does not make it very clear most of the time what config files are required to run an ArmA3 server correctly, I will list them here:

Startup Params Currently the startup params are not quite complete, here are mine: parms="-netlog -ip=${ip} -config=/home/arma3server/profile/${servercfg} -profiles=/home/arma3server/profile -noPause -cpuCount=4 -mod=@extDB -name=arma3server -cfg=/home/arma3server/profile/arma3server/a3server.cfg"

I will go through them and why they are as they are:

Why should the profiles be outside of the serverfiles directory? There was (and possibly still is) a massive battleye exploit which allows a hacker to download any file that resides in the same directory (and its sub folders) as the server binary, this means that the hacker can download your arma3server.cfg file, putting these files outside of the server binary prevents this.

Folder Structure + Extra Files Currently my folder structure is so: profile ├── (RPT and Console Logs reside here) ├── arma3-server.cfg - (The config file loaded with -config startup param) ├── battleye - (This is a copy of the battleye folder inside ./serverfiles, befilters and beserver.cfg reside here - NOT inside ./serverfiles/battleye) │   ├── beserver.cfg - (Config file for battleye) │   ├── beserver.so - Binary │   ├── eula.txt - Text Doc │   └── (be filter files reside here (createvehicle.txt/publicvariable.txt etc)) └── users └── arma3server - (the user specified with the -name param) ├── a3server.cfg - (this is also known as basic.cfg) ├── arma3server.Arma3Profile - (arma3profile for difficuilty settings) └── arma3server.vars.Arma3Profile - (variables stored by custom SQF scripts and some missions)

Extra Files -arma3server.arma3profile can be found here: https://community.bistudio.com/wiki/server.armaprofile -- Use the arma2 profile example, it's the same for arma3.

-a3server.cfg can be found here: https://community.bistudio.com/wiki/basic.cfg -- As said before this file is extremely important for arma3server configuration

-beserver.cfg is simply this: -- RConPassword password -- MaxPing (250 is a good start)

If you need me to go over anything else please let me know.

dgibbs64 commented 9 years ago

Wow this is very extensive. This is the sort of thing we need! Because we don't run all of the servers personally we have to work things out from documentation (or lack of). I will have to commit some time to looking though this and making changes. I will have a look when I have a few hours to work with this. Also with your extensive knowledge I recommend working on the bistudio wiki to make the documentation much better as its untidy and could be greatly improved. Thank you for the infomation :D

AlienXAXS commented 9 years ago

Hey, No problem :)

One problem I have found with the above is that the "Users" directory should be called "home" plus the profile name should reside under this like so (at least, that's what the log files say it's trying to write too): /home/arma3server/profile/home/arma3server/

This would cause a small change in the startup params for -cfg

AlienXAXS commented 9 years ago

Here is an updated tree: https://www.agngaming.com/github/arma3tree.PNG

AlienXAXS commented 9 years ago

Update: Yet again another BI "I wont document this so you have to find out for yourself" problem.

I noticed that the RPT file (where script errors and other very useful things get written too) is not written in the profile directory as it is with Windows.

Apparently the linux dedi server outputs the rpt log to stdout/stderr, so in order to log an RPT we would need that outputted (if not already). Example:

./arma3server -port=$port -pid=ServerRunning -cfg=basicServer.cpp -config=server.cpp "${mods}" >>log.${pid}.txt 2>&1

AlienXAXS commented 9 years ago

Yet another Linux difference between windows (i'm finding them all at the moment! haha).

Battleye within Windows will be defaulted to wherever the -profile switch is, so if u have the profile at c:\arma\profile, then battleye will default to c:\arma\profile\battleye - this is not the case for linux.

In linux, you also need the -bepath switch, for example: -bepath=/home/arma3server/profile/battleye

To know for sure if the correct battleye folder is being picked up, upon server launch the beserver.cfg should be renamed to something random like beserver_active_6agd2402.cfg

chriy-de commented 9 years ago

So in order to make the difficulty settings work, I have to create tree like you showed. What do I have to alter in the startup params for -cfg?

AlienXAXS commented 9 years ago

In order for it to load the profile you really only need the -profiles switch and the -name. Instead of doing it via /home/arma3server/ etc etc, i noticed you should be able to do the below:

If your profile is stored as mine was (in the same directory as the arma3server script that dgibbs wrote) then the following startup line should work: parms="-netlog -ip=${ip} -config=./../profile/${servercfg} -profiles=./../profile -noPause -cpuCount=4 -name=arma3server -cfg=./../profile/arma3server/a3server.cfg"

If you have any problems please feel free to get in touch :)

chriy-de commented 9 years ago

Thank you for the reply! You wrote if it is in the same directory where dgibbs script ist located.. You mean RIGhT in the same folder als the script, or in the serverfiles folder? Or inside the profiles folder (which is inside the serverfiles folder)? Thank you for your help:)

Gesendet mit meinem HTC

----- Reply message ----- Von: "AlienXAXS" notifications@github.com An: "dgibbs64/linuxgameservers" linuxgameservers@noreply.github.com Cc: "tranqu91" christoph@konetschny.org Betreff: [linuxgameservers] [arma3server] Best Pratice Configuration Options (#270) Datum: Do., Jan. 29, 2015 11:27

In order for it to load the profile you really only need the -profiles switch and the -name.

Instead of doing it via /home/arma3server/ etc etc, i noticed you should be able to do the below:

If your profile is stored as mine was (in the same directory as the arma3server script that dgibbs wrote) then the following startup line should work:

parms="-netlog -ip=${ip} -config=./../profile/${servercfg} -profiles=./../profile -noPause -cpuCount=4 -name=arma3server -cfg=./../profile/arma3server/a3server.cfg"

If you have any problems please feel free to get in touch :)

— Reply to this email directly or view it on GitHub.

AlienXAXS commented 9 years ago

Please review the tree output here: (only outputs directories) https://www.agngaming.com/github/arma3tree_2.PNG

The tree is taken from the root of the arma3server users home directory (/home/arma3server/).

Please ensure that you have your profiles switch as so: -profiles=./../profile and -name=arma3server. Create a directory called 'profile' within the root of your users home directory (which is ~/, or /home/arma3server), ensure that this 'profile' folder follows the tree structure in the picture given above.

If you want to see what files should reside in there, here is another image: https://www.agngaming.com/github/arma3tree_3.PNG

I hope this makes sense.

dgibbs64 commented 9 years ago

@AlienXAXS thanks for being helpful to the Arma 3 admins :+1:

AlienXAXS commented 9 years ago

To anyone reading this, there is currently a bug in build 500757 which causes PhysX errors to be printed to log files constantly.

To "bandage" this issue please ensure that 'CameraShake=0' is set inside your ArmA3Profile under the difficulty setting you are using - if your log files get too much then please add -noLogs as an extra param to the end of your params string.

@dgibbs64 - Anytime :)

chriy-de commented 9 years ago

Thank you @AlienXAXS for your help, I got it working now, and can set up the servers difficulty whichever way I want! Thank you very much!

And sorry for opening a new Issue before checking thoroughly, I should have searched better first. Thank you to you Daniel and Alien:)

rickt commented 9 years ago

many thanks to everyone above for the detailed explanations of the various parameters! i was able to solve a longstanding problem with my existing arma3 servers thanks to everyone's detailed notes!

with that said, i would like to migrate my own arma3 servers (currently managed by supervisord and my own crappy startup scripts) to Daniel's armaserver, because it's way better. but i can't figure out how to add multiple mods to the startup parameters.

because i need to add a parameter something like -mod=@cba_a3;@task_force_radio; that presents a problem as ; is interpreted by bash as EOL (etc). so i've tried escaping the semicolon using backslash. i've tried single quotes within the existing parameter double quotes, i've tried more double quotes (obviously escaping them). but nothing has worked. all my usual unix-y tricks have failed me. i've performed an exhaustive search of the project and came up with naught.

does anyone know how to add multiple mods to the startup parameters? thank you in advance, and i apologise for adding a comment to an already-closed issue.

edit: i should add that i've also tried using the -par= parameter, and adding the necessary -mod= magic in there, to no avail. :(

BlackhatEspeed commented 9 years ago

AlienXAXS,

I was wondering about cloud servers and their ability to successfully operate the engine now that we've moved far past the alpha I actually have a six core cloud server that is running the scripts here and I would like to modify them so they utilize all the cores. The processors being used in this cloud cluster configuration are worth around $1600 with 25M of cache. It is using the modified glibc on CentOS 6.7 Cloud Linux. That being said I have set the affinity that being said I have set the affinity manual on the taskset command but I don't think that is enough. What are your thoughts on Cloud Servers and their performance issues? My server runs pretty stable, but will actually adding the CPU count to the start script actually increase performance? What amount of RAM do I need? Thanks for your input.

Thanks for all your useful information on the configuration files.

AlienXAXS commented 9 years ago

Hey,

No worries ref the configuration file help :)

The ArmA engine is not well optimised at all, while there is a threads command line you are really only limited to a max of three threads.

  1. The first thread deals with all game logic, scripts, players etc.
  2. The second thread can deal with loading of models and terrain, which is pretty useless once the map has finished loading.
  3. The third and final thread I believe deals with audio, which is pointless as of course a dedicated server has none!

You will not benefit from any more cores while running a single arma instance as everything is packed on a single thread that is logic, better off getting the best performing CPU in regards to speed per core.

The only reason that more cores would be useful is if you wish to host multiple arma instances on the same unit setting the affinity so that they are manually load balanced.

As per cloud hosting, not too sure if I'm honest. I have never hosted in the cloud as the costs are normally insane, epically when you host a server like this which is always performing logic, thus using cpu cycles adding to the cost.

Does this help?

Sent by Outlook for Android

On Sat, Aug 29, 2015 at 6:16 PM -0700, "BlackhatEspeed" notifications@github.com wrote:

AlienXAXS,

I was wondering about cloud servers and their ability to successfully operate the engine now that we've moved far past the alpha I actually have a six core cloud server that is running the scripts here and I would like to modify them so they utilize all the cores. The processors being used in this cloud cluster configuration are worth around $1600 with 25M of cache. It is using the modified glibc on CentOS 6.7 Cloud Linux. That being said I have set the affinity that being said I have set the affinity manual on the taskset command but I don't think that is enough. What are your thoughts on Cloud Servers and their performance issues? My server runs pretty stable, but will actually adding the CPU count to the start script actually increase performance? What amount of RAM do I need? Thanks for your input.

Thanks for all your useful information on the configuration files.

— Reply to this email directly or view it on GitHub.

This email was Virus checked by AGN Gaming's Unified Threat Management Suite.

dgibbs64 commented 9 years ago

I am working on a repo called gameserver-configs that is designed as a starting point for server admins and vanilla servers. Im finding Arma 3 quite difficult as I don't run a server myself and its just generally complicated.

I could really do with a skeleton archive of the configs and locations that are ideal for vanilla servers. This way I can add it to the repo and alter arma3server to be easier to setup. I can see the file structure but I need the vanilla config files.

If possible could someone put this together in to a zip file and post it. then I could look at better integrating it with LGSM.

https://github.com/dgibbs64/gameserver-configs

dgibbs64 commented 8 years ago

I am closing this as we have a pretty good config file setup now.

lock[bot] commented 6 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.