Link to home
Start Free TrialLog in
Avatar of Sergy Stouk
Sergy StoukFlag for Canada

asked on

Start the service with low priority.

Does anyone came across a tip on how to start a service at a different priority than other services running on the same server?
I know that the START command can do it, however I have real services (not custom-developed cmd.exe batch processes) and I cannot use this command within the Registry entry of the service.

Thank you.
Avatar of shahrial
shahrial
Flag of Singapore image

try this.
1.) Run the service, go to Task Manager, find the service,
right click on the service - select Set Priority -> change it to low. ;)

Avatar of Sergy Stouk

ASKER

I need it to Start with the low priority, not to change it when it already started.
And by the way, it is "access denied" when attempting to change the priority from the Task Manager.
Avatar of Gareth Gudger
I dont even have an NT box to check anymore but have you checked in the Control Panel ==> Services

Avatar of ahmedbahgat
ahmedbahgat

Set priority is used for currently running processes which will affect only the cpu gain regarding that process, it is not recommended to change the priority of running processes as recomended by MS, you wonder why they put there from the first place, possibly for troubleshooting, as far as i know there is no such thing for services

the cpu will try to start the services in a multi tasking manner ie some services will start together and some services will start other services before it start as a requiremnt

why you want to do that? possibly there is an alternative way to achieve your requirement

cheers
The reason being is that I need to lower the priority of some services when they start and increase the priority of other services when they start, if that makes any sense.
There is a START command which can do it, but for the applications. I am looking for a similar way to start services.
Thank you for your attention to this question.

ok you can start any service by using

NET START MyService Name

possibly you can create a batch file that include the the above command, and run it by putting it in the Startup folder, this may put cause it to start after other services has started

cheers
The question was  how to start the service and specify its priority.
I can start any service either with "net.exe START Servicename" or by just starting it through the GUI interface within the Service namager, that is not the question.

ahmedbahgat, you are confusing the START option of  cmd.exe  with START option for net.exe executables.

net.exe START 'Service Name'  - does not have an option to change the service priority.

cmd.exe START 'command' -  does have this option, but cannot be used with the Service (unless the service is registered with the regsvc.exe and is a regular executable file).

I could use:
cmd.exe START /LOW "mycommand.exe" to start the application "mycommand.exe" with low priority.
Again,
How to Start the Service Like this?

Noone has provided yet even a slightest clue here for a simply phrased and straightforward question.
I cannot say that the question is that simple, it is difficult, because it might not be even possible to do this, but if this is not possible, can anyone prove it?
Answering "Not Possible"  with some proof or a reference to some microsoft or any other general source would be considered a valid answer as well.






hey mate there is something I'm sure about, which is I'm not confused with the service start button in the GUI and the net start command

I know that they are identical and the only difference is the GUI, however what I was trying to do is a workaround, to try to delay the service to start, in another way making it low priority

and because when the OS starts, it start the services listed in the services applette automatically and slightly in any order unless a service is dependant on another and in this case, if we try to start the service in a batch file that will be executed when the user login ONLY  and not before that, however the other services will not wait for the user to logon to start,

ie we are trying to isolate the service you want to delay in a batch file command and ONLY be executed when the user logon and this can be done by putting this file in the startup folder


cheers
I found an MS article on how to delay a service start, this may be the solution for yo:

http://support.microsoft.com/default.aspx?scid=kb;en-us;193888

cheers
ok maybe your request is not what I understand, if you meant by priority is the CPU gain after the service starts, then I'm wrong, if you meant just to delay its start untill other services has started, then the link above is the way to go

cheers
Oh, I see now.
That was the reason....
In the question I mean priority of the service, not order of when it starts.
'Priority' is a thread priority, one Service should have more CPU time than the other.
As I explained, similar to the 'START' option when initialing an application from the batch file.
"cmd.exe START /LOW myapp.exe"
The above command will start myapp.exe with a LOW priority.
How to do it with the Service?
sstouk, I had an extensive look at all the registry settings regarding a few servies I have on my machine, and could not find in settings that will set the cpu priority

I'm thinking of one possibilty, some services use an exe file, which can run on its own without being a service for example this file "PervasicveSQL.exe"  is an executable file to run the Pervasive SQL Desktop Edition that Accpac accounting software use

every time we have a power failure, the UPS shuts the machine down and when power comes it turns it on again, however the computer will only boot to the screen "Press CTR ALT DELETE to logon"

this was absolutly no good because, the PervasicveSQL.exe was not running as service, the file was in the Startup folder, ie it will only run when I logon to the server, the side effect will be the accounts software will not run untill I logon, and if i'm not there "I'm the whole IT department"  no one can use Accpac

contacted the accpac company and asked why I can not run PervasicveSQL.exe as service, they said that I need to buy the full server edition and not the desktop edition, a high cost was associated so I declined

went back and search the internet and managed to find an article on how to run PervasicveSQL.exe desktop edition as a service, pestro, it worked great

from the work I did regarding PervasicveSQL.exe to run as a service i found that there is a lot of things to do and not just running the exe file on its own

so I'm thinking of reversing the operation if this service you want to control is an exe file, and I meant by reversing the operation is to try to run that exe as an exe and not as a service, then we can use the CMD command with the required option as you suggested to control the cpu priority

I do  not know how yet but I will keep searching, possibly you may need to check out what exe file is associated with this service if any as frankly I found many services do not use an executable file at all

cheers

You can use this registry entry that is not present by default to change a process (service) default thread priority. This is an example for the server service.


Key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\ Services\LanmanServer\Parameters\
Data type: REG_DWORD
Values: 0 | 1 | 2 | 15
Default: not present in Registry.
Description: This entry controls the priority increase of the Server service threads.

Gabriel
pay attention that 15 value is Real Time that could block your system ...
ASKER CERTIFIED SOLUTION
Avatar of gabit25
gabit25

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That was exactly what I was asking for.
Thank You.
...but using HKEY_LOCAL_MACHINE\System\CurrentControlSet\ Services\<YourServer>\Parameters\
 does not work for an ARBITRARY service, right? i tried it e.g. with WinVNC4 and it did not work.

i would like a service to be started by windows, be running without being logged in and running at a custom priority.