Jump to content
astrell

How to set CPU affinity on startup?

Recommended Posts

Hi mates!

I´m trying to change the CPU Affinity of the arma3server.exe on startup automatically.

The "normal" way for applications would be ...

cmd.exe /c start "arma3server" /affinity 2 "E:\server\arma3server.exe"

But i dont know where to with all my arguments like -profile -mods and so on, even experimenting with the Syntax isn´t working and i dont find any valuable examples ... May someone give me some hints?

Using Windows Server 2008 R2

Share this post


Link to post
Share on other sites

How many cores does your CPU have?

For example, an i7 has 4 cores 8 threads which are set up as 01234567. You always set this in binary and then convert it to hex.

If you want to use all threads you use /affinity FF

01234567 cores

11111111 binary

FF hex

If you want to use only the even numbered cores its like this

01234567 cores

10101010 binary

AA hex

You can use your built in calculator on program mode to do this.

If you want to only use the uneven numbered cores its like this

01234567 cores

01010101 binary

55 hex

Share this post


Link to post
Share on other sites

Great information LouD Thanks.

Is there the same possibility to launch with specific priority too (real time preferably)?

Share this post


Link to post
Share on other sites

LouD, if you know more about this please read my question again, the problem is after the "arma3server executive -mod=(...) -Profile=dude" all the stuff after the *.exe isn't working and I'm getting error message.

Share this post


Link to post
Share on other sites
LouD, if you know more about this please read my question again, the problem is after the "arma3server executive -mod=(...) -Profile=dude" all the stuff after the *.exe isn't working and I'm getting error message.

According to this doc, you need to put the parameters after the executable, not inside the quotes. So:

cmd.exe /c start "arma3server" /affinity 2 "E:\server\arma3server.exe" -profile=dude -etc.....

@sebj: also according to the aforementioned doc, you can also put /realtime in the start parameters along with /affinity.

EDIT: /affinity 2 only uses one core/thread btw. Not sure if that's intentional.

EDIT 2: I just tested the above with a simple script and it does work.

Example, if you want to run two different servers with real time priority, each mapped to two different cores:

cmd.exe /c start "Arma3 Server 1" /realtime /affinity 3 "E:\server\arma3server.exe" -profile=dude1 "-mod=someMod;someMod2;someMod3"
cmd.exe /c start "Arma3 Server 2" /realtime /affinity c "E:\server\arma3server.exe" "-profile=Dude2" -mod=someOtherMod

Note that if you need/want to use quotes around parameters, you should put them around each individual parameter, not around all of them. :)

Edited by MadDogX

Share this post


Link to post
Share on other sites

"E:\SteamLibrary\steamapps\common\Arma 3 Server\arma3server_x64.exe"  /HIGH /affinity FF  any mistake?

 

 

i have  intel xeon x5650  6 core          24 gb ram

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

×