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
Cyberuben

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
logicearth

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
Cyberuben

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
Layback Bear

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
Brink
Microsoft MVP

64-bit Windows 10 build 10130
 
 

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
Cyberuben

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
Alejandro85

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
Cyberuben

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
Cyberuben

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
Alejandro85

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
Thread Forum
unable to set realtime priority to a process
every time I right click a process and try to set priority and select realtime, I get the following message "Unable to set Realtime priority. The priority was set to High instead" Any ideas how to fix it ?
Performance & Maintenance
Processor Affinity - Add Set Affinity to Context Menu
How to Add or Remove "Run with CPU Affinity" to the Context Menu By default, Vista, Windows 7, and Windows 8 runs an application on all available cores of the processor. If you have a multi-core processor, then this will show you how to add or remove Run with CPU Affinity from all...
Tutorials
how to save my affinity setting in task manager
hello all i want to change my affinity settings in task manager but when i restart the pc it change as it was before so is their anything i can do to save the affinity like program or something ? my pc is windows 7 64 bit thank you all
Performance & Maintenance
Set Priority (on Process) with Script?
Is there a way to set the priority of a process with a vbscript? If so, how? Say I want to set ProcessA to High and ProcessB to low.
General Discussion
Using bat file to tweak process priority.
Hey everyone, I am at school in a photoshop class and instead of spending 5-10 minutes changing the priority status of some useless programs that run in the background I wanna just use a bat file to do it all for me. Basicly the processes I am turning down are like the dell default programs that...
Performance & Maintenance
Set affinity in task mgr as default
I run a screen magnifier/reader that I want to use both my cpu's but at the moment it is set to only use one.I can change it manually to two but it reverts back to one after reboot. I do that in task manager. How can I change it to both cpu's 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 04:38.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App