We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

poor performance of program when started from a service

Medium Priority
324 Views
Last Modified: 2013-11-05
Hello,

we have a problem on one of our servers. We have a program which performs some word related tasks. When this program is started from the desktop everything is fine.
Instead we want to start this pogram from within a service (via shell). If we do that, the performance of the program is dramatically reduced.
When we put the routines which start the program in a console application the performance is also good. So it must have something to do with the fact that we use a service.

Does anybody have an idea? Do we need to configure something?
Comment
Watch Question

Top Expert 2009

Commented:
The reason people don't answer this question just because they are not quite sure what you are trying to approach. Answer my questions so I can understand your purpose, please:

- What are you trying to do? Why do you want to start the program in service?
- What is the program, and its functionality?
- Would you like to bring up the program in pre-windows environment?
- If the program is MS Word related, do you know that you need to be in Windows environment because Word does not work in shell?

K
Friedhelm Feller-PrzybylSoftware Engineer

Author

Commented:
Hi Inkevin,

thank you for your response. I will try to give more details and answer your questions:
We have a program XXX.exe which uses Word OLE-automation to create documents. The program runs fine in interactive mode. In parallel we use a service YYY which starts this program so that we are able to have a batch processing. The service recieves a message and creates a new process. I think shell was the wrong word for it. In c# we use System.Diagnostics.Process class (we also had an vb6 implementation of the service which used the VB6 command "shell" ).
The problems happen to be the same wether the service application is written in c# or in vb6.
When we use a console application for YYY instead of the service, the performance is good, when we
use a service for YYY the performance is decreased drammatically.
When the performance is bad the cpu usage is low, when we start the app XXX outside a service the cpu usage is high (as it is desired).
We also found out two things:
The problem does only occur on our (new) windows 2003 server, our old Windows 2000 system runs fast.
It must have something to do with the word automation; another program zzz.exe which does calculation tasks does not have a lower CPU-usage (peformance) when started from a service.
I hope I could answer your questions?
Thanky ou again for your assistance
kind regards
Friedhelm

Top Expert 2009

Commented:
So YYY service program is something like AutoExNT that set in services to start the program as windows boot?

Although I not a programmer at all, but I have written scripts. Did you ever think of delay timing is part of the issue? Should you put some wait time in your program so the Windows is ready when your script is attempting to run?

K
Friedhelm Feller-PrzybylSoftware Engineer

Author

Commented:
Not exactly, YYY is the service that starts program XXX whenever it recieves a message to do so.
So I don't knkow were the delaying could help
Top Expert 2009

Commented:
The difference between W2K and W2K03 is security set up. W2K03 has more advanced features in security that could be some obstacles for the application runner. Try to do this. Create a local administrator account in that server. On the YYY service, go to Properties then Logon tab. Specify your local admin account (for example: .\admin) and password. Hit Apply and OK then restart the service. You can try your test from there.

K
Friedhelm Feller-PrzybylSoftware Engineer

Author

Commented:
Hi, thank you again or our response.
Unfortunately the user-account of the  service is already member of the local administrators group...
Is it a problem that this user is also a domain-user?
kind regards
Friedhelm
Top Expert 2009

Commented:
Domain user is fine. As long as it's in local administrators group and it has to be specified in the service. Otherwise, the service will be running with the Local System Account by default. Take a snapshot picture of the Logon Tab and post it, please.

K
Top Expert 2009

Commented:
I just said domain user is fine, but I prefer the service account to be service user. Domain user get to change the password periodically, and sometime, the password that runs service account does not get updated.

K
Friedhelm Feller-PrzybylSoftware Engineer

Author

Commented:
Hi,


please find attached a screen shot. I had to scamble the domain name a bit, because the name of our domain is regarded as highly confidential - no offense meant.
kind regards
Friedhelm
Friedhelm Feller-PrzybylSoftware Engineer

Author

Commented:
Hi,

the pwd is not changed at all. Nevertheless I will try to create a new local admin user and run it with this account. I can do that only after business hrs. I will get back to you tomorrow.
kind regards
Friedhelm
Top Expert 2009

Commented:
OK. Let's talk on tomorrow. By the way, there is no attachment available. After you create local admin, I prefer you to browse it on the Log On Tab than type it.

K
Friedhelm Feller-PrzybylSoftware Engineer

Author

Commented:
Hi,

we did try it with the local user. There was no change. The performnce as well as CPU usage was the same.
kind regards
Friedhelm
Software Engineer
Commented:
Hi,

we found the reason and a solution!
For all  of you who are trying to run microsoft office in an unattended mode (e.g. without a user logged-on). The following information might help you.
You need to turn off the creation of the recent files list. A lot of shortcuts are normaly created at
C:\Documents and Settings\Default User\Application Data\Microsoft\Office\Recent
When word is used from a service (no user logged on). Not all files are deleted and thus you get a folder wiht thousands and thousands of shortcuts - which you will never ever need.
You can turn this off by adding a DWORD-Entriy NoRecentDocsHistory with the value 1 in
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
and
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

You can also delete the files the folder C:\Documents and Settings\Default User\Application Data\Microsoft\Office\Recent onm a regular basis.
kind regards
Friedhelm



Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Top Expert 2009

Commented:
Thanks for the update. You can close it now.

K
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.