views:

51

answers:

3

What might cause an executing process from windows service to run slower than running from command line? When I execute a process(another exe) from teh command line with admin rights, it is four times faster than when a windows service executes the same process. What could be causing this. Permissions on directories and files are okay for the account. It runs successfully, just 4x slower. Need ideas on what to investigate to figure out the problem.

We have been using sysinternals processexplorer and not seeing anything.

Where is the advances tab with the ability to modify the "priority" to see if that is causing the problem?

+2  A: 

In Windows background services may be given less priority, and that is configurable in the advanced tab of computer properties.

Otávio Décio
On the computer management dialog:Services and Applications:Services I right click a service and select properties, there is no advanced tab on this UI, where do I find the advanced tab?
javelinBCD
System Properties -> Advanced -> Performance -> Settings -> Advanced Adjust for better performance of -> choose "Background services" which is the default for servers but not for workstations.
Otávio Décio
+2  A: 

Assuming the priority of both applications is the same, you need to profile the app and see which calls are taking the most time. That should at least give you enough detailed information to come back and ask "why is this specific call running slowly" instead of "why is my app running slowly".

Rex M
+1  A: 

Download the sysinternals process monitor tool from www.sysinternals.com and then start tracing the application, that will show you what the process is doing in terms of registry / file access and will potentially show up what to look at when the delays are occuring.

If you have the debug symbols it can also give you the function call name in the dll / app that is being called, but even knowing what is occuring when a delay occurs and what dlls are in use, user mode or kernal gives you a good indication where to start.

Andrew