Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Save process priority and affinity

21 Dec 2012   #1

Windows 7 Home Premium x64
 
 
Save process priority and affinity

Hello,

I'm running a few gameservers myself on Windows Server 2008 R2 but I'm wondering if it's possible to make my system recognize that the process was ran earlier, and it'll apply the correct affinity and priority.

The problem is that I used to use ProcessLasso, but after 40 days of uptime (and then a restart) I'm not able to run the program without purchasing it.

My System SpecsSystem Spec
.

21 Dec 2012   #2

Windows 8.1 Pro (x64)
 
 

Purchase the program. Of find an alternative. I don't have one.
My System SpecsSystem Spec
22 Dec 2012   #3

Windows 7 Home Premium x64
 
 

Quote   Quote: Originally Posted by logicearth View Post
Purchase the program. Of find an alternative. I don't have one.
I didn't really create this thread to be told to purchase the program. It's $89 just because I'm using Windows Server 2008, otherwise it'd be $30, which isn't such a deal.
My System SpecsSystem Spec
.


22 Dec 2012   #4

Windows 7 Pro. 64/SP-1
 
 

If the program need purchased to play then that is what is needed. We are not going to tell you how to bypass the any copyright. Please read our rules. #4
Windows 7 Forums - Forum Rules
My System SpecsSystem Spec
22 Dec 2012   #5
Microsoft MVP

64-bit Windows 8.1 Enterprise
 
 

Hello Cyberuben,

If you wish to continue using ProcessLasso, then you'll just need to purchase it.


As an alternative, you could use the tutorials below to make setting CPU affinity and priority easier to do via the context menu.

"Run with Priority" - Add or Remove from Context Menu

and

Processor Affinity - Add Set Affinity to Context Menu

Hope this helps,
Shawn
My System SpecsSystem Spec
22 Dec 2012   #6

Windows 7 Home Premium x64
 
 

Is there a way to do this using batch? So I can just make a "start.bat" that makes it run with the correct affinity and priority? The problem is that I'm trying to run Source servers, which don't really work properly on multiple cores. So I'd like to run my servers each on a single core, unless they are like a 10 slot server.

Currently I work with a set of shortcuts. The shortcuts have the following "command":
Code:
C:\Servers\Public\Minigames\Deathrun\orangebox\srcds.exe -console -game garrysmod -port 27031 +map deathrun_marioworld_final -maxplayers 48 -ip 69.162.117.58
Is it possible to run the same "command" but with parameters that make it have the correct affinity and priority?
My System SpecsSystem Spec
22 Dec 2012   #7

Windows 7 Ultimate x64
 
 

Found a way. Instead of running that command directly, you need to run it though the "start" built-in command, it allows to set both the starting priority and affinity mask:

Code:
START /LOW /AFFINITY 1 C:\Servers\Public\Minigames\Deathrun\orangebox\srcds.exe -console -game garrysmod -port 27031 +map deathrun_marioworld_final -maxplayers 48 -ip 69.162.117.58
This one starts the server with the lowest possibly priority and running on CPU 0 only. Just adjust the first parameters to whatever you need in the command line from your shortcut and you're done.
My System SpecsSystem Spec
22 Dec 2012   #8

Windows 7 Home Premium x64
 
 

Quote   Quote: Originally Posted by Alejandro85 View Post
Found a way. Instead of running that command directly, you need to run it though the "start" built-in command, it allows to set both the starting priority and affinity mask:

Code:
START /LOW /AFFINITY 1 C:\Servers\Public\Minigames\Deathrun\orangebox\srcds.exe -console -game garrysmod -port 27031 +map deathrun_marioworld_final -maxplayers 48 -ip 69.162.117.58
This one starts the server with the lowest possibly priority and running on CPU 0 only. Just adjust the first parameters to whatever you need in the command line from your shortcut and you're done.
Thanks a ton!
My System SpecsSystem Spec
24 Dec 2012   #9

Windows 7 Home Premium x64
 
 

I found out the following:
CPU 0 = 1
CPU 1 = 2
CPU 3 = 4
CPU 4 = 8
CPU 5 = 16
CPU 6 = 32
CPU 7 = 64
CPU 8 = 128.

But when I use the start command with 128, it'll run core 3 and 5, which is 20. Strange.
My System SpecsSystem Spec
24 Dec 2012   #10

Windows 7 Ultimate x64
 
 

Apparently, the affinity mask seems to be an hex number, not decimal as we though. And 128 in hex equals 100101000 in binary, which enables CPU 3, 5 and 8. So, the actual table should be:

CPU 0=1
CPU 1=2
CPU 2=4
CPU 3=8
CPU 4=10
CPU 5=20
CPU 6=40
CPU 7=80

And add those values in any combination to enable more than one CPU. But add them in hexadecimal (Windows built-in calculator in programmer mode can do the math).
My System SpecsSystem Spec
Reply

 Save process priority and affinity




Thread Tools



Similar help and support threads for2: Save process priority and affinity
Thread Forum
Processor Affinity - Add Set Affinity to Context Menu Tutorials
Solved how to save my affinity setting in task manager Performance & Maintenance
How to set affinity for Media Center? Media Center
Set Priority (on Process) with Script? General Discussion
Using bat file to tweak process priority. Performance & Maintenance
Processor Affinity - Set for Applications Tutorials
Set affinity in task mgr as default Performance & Maintenance

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 06:44 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33