?
Solved

poor performance of program when started from a service

Posted on 2009-02-18
14
Medium Priority
?
314 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?
0
Comment
  • 7
  • 7
14 Comments
 
LVL 26

Expert Comment

by:lnkevin
ID: 23774644
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
0
 
LVL 1

Author Comment

by:Friedhelm Feller-Przybyl
ID: 23774843
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

0
 
LVL 26

Expert Comment

by:lnkevin
ID: 23775072
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
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
LVL 1

Author Comment

by:Friedhelm Feller-Przybyl
ID: 23782081
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
0
 
LVL 26

Expert Comment

by:lnkevin
ID: 23783638
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
0
 
LVL 1

Author Comment

by:Friedhelm Feller-Przybyl
ID: 23783667
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
0
 
LVL 26

Expert Comment

by:lnkevin
ID: 23783714
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
0
 
LVL 26

Expert Comment

by:lnkevin
ID: 23783733
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
0
 
LVL 1

Author Comment

by:Friedhelm Feller-Przybyl
ID: 23783755
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
0
 
LVL 1

Author Comment

by:Friedhelm Feller-Przybyl
ID: 23783786
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
0
 
LVL 26

Expert Comment

by:lnkevin
ID: 23783997
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
0
 
LVL 1

Author Comment

by:Friedhelm Feller-Przybyl
ID: 23793090
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
0
 
LVL 1

Accepted Solution

by:
Friedhelm Feller-Przybyl earned 0 total points
ID: 23854976
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



0
 
LVL 26

Expert Comment

by:lnkevin
ID: 23856602
Thanks for the update. You can close it now.

K
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration, of the HP EVA 4400 SAN Storage. The name , IP and the WWN ID’s used here are not the real ones. ABOUT THE STORAGE For most of you reading this, you …
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question