Save process priority and affinity


  1. Posts : 20
    Windows 7 Home Premium x64
       #1

    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 Computer


  2. Posts : 5,642
    Windows 10 Pro (x64)
       #2

    Purchase the program. Of find an alternative. I don't have one.
      My Computer


  3. Posts : 20
    Windows 7 Home Premium x64
    Thread Starter
       #3

    logicearth said:
    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 Computer


  4. Posts : 25,847
    Windows 10 Pro. 64/ version 1709 Windows 7 Pro/64
       #4

    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 Computer


  5. Posts : 71,977
    64-bit Windows 11 Pro for Workstations
       #5

    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 Computer


  6. Posts : 20
    Windows 7 Home Premium x64
    Thread Starter
       #6

    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 Computer


  7. Posts : 2,465
    Windows 7 Ultimate x64
       #7

    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 Computer


  8. Posts : 20
    Windows 7 Home Premium x64
    Thread Starter
       #8

    Alejandro85 said:
    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 Computer


  9. Posts : 20
    Windows 7 Home Premium x64
    Thread Starter
       #9

    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 Computer


  10. Posts : 2,465
    Windows 7 Ultimate x64
       #10

    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 Computer


 

  Related Discussions
Our Sites
Site Links
About 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:37.
Find Us