473,756 Members | 5,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows Service - Suggestions for Installing Multiple Instances



I currently have a Windows Service that runs Transactions that are very
Processor/Memory Intensive. I have a requirement to deploy multiple
instances of the Web service on the Same server. Each Instance needs to
run in its own process.

My current approach to this is to put all the logic into a separate
"Worker" assembly and install it into the GAC. I'm then going to create
Multiple Windows Services (i.e. MyService1, MyService2 etc..) that each
instantiate "Worker" . I will then have a separate install program for
each Windows Service. (Not exactly elegant)

Any suggestions on this approach?

Is there any Way to have one "codebase" for the Windows Services rather
than having a project for "MyService1 ", "MYService2 " etc..?

Does having the "Worker" assembly in the GAC affect performance at all?

Is there an easy way to install Multiple versions of the same Windows
Service on the Same server (I can't seem to find one)
Thanks in advance !!!

Feb 15 '06 #1
10 4983
John,

See inline:
I currently have a Windows Service that runs Transactions that are very
Processor/Memory Intensive. I have a requirement to deploy multiple
instances of the Web service on the Same server. Each Instance needs to
run in its own process.
If you are exposing web services, why aren't you hosting them in
different applications in IIS?
My current approach to this is to put all the logic into a separate
"Worker" assembly and install it into the GAC. I'm then going to create
Multiple Windows Services (i.e. MyService1, MyService2 etc..) that each
instantiate "Worker" . I will then have a separate install program for
each Windows Service. (Not exactly elegant)

Any suggestions on this approach?
I would look into creating a serviced component and then installing in
COM+. You can opt to have your components run as a service (I believe on
Windows XP and Windows Server 2003), so you wouldn't have to create a new
shell for each instance. You just have to install your component as a
separate COM+ application and let it fly.
Does having the "Worker" assembly in the GAC affect performance at all?


No.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
Feb 15 '06 #2
John,
You could have the same "Codebase" as you describe it provided the
ServiceName property of each is loaded from the app.Config file in an
appSettings Section. This must be different for each service. However, I am
wondering why you really need multiple instances of the same service.
Wouldn't you be able to use one service and have it use some sort of metadata
or a Hashtable of "rules" and multiple threads to perform the different
functions all from one service?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"John" wrote:


I currently have a Windows Service that runs Transactions that are very
Processor/Memory Intensive. I have a requirement to deploy multiple
instances of the Web service on the Same server. Each Instance needs to
run in its own process.

My current approach to this is to put all the logic into a separate
"Worker" assembly and install it into the GAC. I'm then going to create
Multiple Windows Services (i.e. MyService1, MyService2 etc..) that each
instantiate "Worker" . I will then have a separate install program for
each Windows Service. (Not exactly elegant)

Any suggestions on this approach?

Is there any Way to have one "codebase" for the Windows Services rather
than having a project for "MyService1 ", "MYService2 " etc..?

Does having the "Worker" assembly in the GAC affect performance at all?

Is there an easy way to install Multiple versions of the same Windows
Service on the Same server (I can't seem to find one)
Thanks in advance !!!

Feb 15 '06 #3
Sorry Nicholas I meant multiple instances of the same WINDOWS SERVICE
not WEB SERVICE.
There is no WEB / IIS component to my application. Would this change
your recommendation? Also the Application is highly multi-threaded.

I've not worked with "ServicedCompon ent"s before. Is the reason you
recommend this to avoid the Multiple Windows Service code bases &
Install Programs? Or is there another benefit?

Could introducing COM+ application adversely affect performance?

This is an Enterprise wide application that runs 1000's of transactions
daily. Which is why I'm so concerned about performance

Feb 15 '06 #4
Peter,
The reason for Multiple instances of the same service is for
performance and throughput. Each instance of the Windows service will
run exactly the same set of Transactions/functions. The services pick
up requests that come in through a Message Queue and process them. The
current version of the Windows service is Multithreaded and handles
multiple requests "simultaneously ". One problem with the current
version (one Windows Service) is that we are limited to the number of
threads that can run because we run out of addressable memory (each
thread loads many Instances of Excel Emulators etc...) .The thought is
that multiple process will allow us to run more Instances
simultaneously

Thanks For your help!

Feb 15 '06 #5
John,
Ok, well that sounds logical on its face, but I question whether in practice
it would help. After all, you have a fixed amount of addressable memory space
on the machine. If you run more processes as a workaround, would that not
actually take up even more memory from the get-go?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"John" wrote:
Peter,
The reason for Multiple instances of the same service is for
performance and throughput. Each instance of the Windows service will
run exactly the same set of Transactions/functions. The services pick
up requests that come in through a Message Queue and process them. The
current version of the Windows service is Multithreaded and handles
multiple requests "simultaneously ". One problem with the current
version (one Windows Service) is that we are limited to the number of
threads that can run because we run out of addressable memory (each
thread loads many Instances of Excel Emulators etc...) .The thought is
that multiple process will allow us to run more Instances
simultaneously

Thanks For your help!

Feb 15 '06 #6
I was told that each process would have its own address space and this
would help us avoid the OutOfMemoryExce ption we receive when running
to many threads. If that is not the case then we have less incentive
to have multiple processes running.

Thanks!

Feb 15 '06 #7
I am no expert in this area. There is some useful info on MSDN here:

http://msdn.microsoft.com/library/de...ram_tuning.asp

Also, 64-bit machines / OS are getting pretty cheap these days - and that
can make a big difference, even for 32-bit apps.

Best of luck.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"John" wrote:
I was told that each process would have its own address space and this
would help us avoid the OutOfMemoryExce ption we receive when running
to many threads. If that is not the case then we have less incentive
to have multiple processes running.

Thanks!

Feb 15 '06 #8

"John" <19*****@gmail. com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
|I was told that each process would have its own address space and this
| would help us avoid the OutOfMemoryExce ption we receive when running
| to many threads. If that is not the case then we have less incentive
| to have multiple processes running.
|
| Thanks!
|

Running 5 separate processes with each 10 threads or running a single
process with 50 threads will take at least the same amount of physical RAM.
But your problem does not relate to physical memory, it relates to virtual
memory and this will always be a problem if you don't "manage your memory"
consumption. That means that you have to restrict the number of threads,
each thread takes 1MB of stack space, each service runs at least 5 threads
before you even create a thread of your own.
Also don't think that more threads means higher performance, most of the
time it's the inverse.
For IO bound processes you can have some more threads running than for
compute bound process. A golden rule is to have at most 2 compute bound
threads per CPU, and up to 20 IO bound threads per CPU. When your threads
are mixed IO/compute, the number may vary between 2 and 20, depending on the
time spend waiting for IO completion. Note that the above figures are not
carved in stone, they are just an indication based on experience, you should
always measure your throughput/performance.
Another question, did you ever profile your memory consumption, are you sure
you dispose your instances and release all unmanaged resources when done
with them?
What version of the framework and OS are you running, and what's your memory
consumption (managed/unmanaged), do you create large objects? and finally
how many threads do you create?
Willy.

Feb 15 '06 #9
John,

Like all things, anything can adversely affect performance if you don't
use it correctly. COM+ is no different. You can't just say "oh, it's going
to affect performance if you use it".

And yes, I recommended them because you can set them up to run as
services.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"John" <19*****@gmail. com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Sorry Nicholas I meant multiple instances of the same WINDOWS SERVICE
not WEB SERVICE.
There is no WEB / IIS component to my application. Would this change
your recommendation? Also the Application is highly multi-threaded.

I've not worked with "ServicedCompon ent"s before. Is the reason you
recommend this to avoid the Multiple Windows Service code bases &
Install Programs? Or is there another benefit?

Could introducing COM+ application adversely affect performance?

This is an Enterprise wide application that runs 1000's of transactions
daily. Which is why I'm so concerned about performance

Feb 15 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
412
by: Nigel | last post by:
Has anyone got any links to sites, articles etc or can help with how to write a Windows service that supports multiple instances in the way that MS SQL does? (I have an existing service and just need to make it support multiple instances) TIA
0
1117
by: Jay Warmack | last post by:
Is it possible to install multiple instances of windows service application on a single server? I have been searching for any option I can find in the process installer class and in the Install setup project etc. to find some way to allow my service application to be installed more than once. So far I can find no way to install the service more than once (i.e. into a seperate app domain). Any suggestions on this? Also is there a better...
3
2610
by: MW | last post by:
Hi all, I have written a windows service application and setup project to install/deinstall my service. There is a requirement to run one more instance of the same service with different set of configurations and connecting to a different database. Both the services will run on the same box. Is it possible to do that? Someone suggested that there are entries in the windows registry that can be
1
6002
by: Vlad | last post by:
Is there any way to install multiple instances of the same windows service designed with VS.NET 2003? I tried copying the binaries into a separate folder and then copying registry entries for the original service under a new name but the SCM complains that the executable does not have this service implemented. Please note that I need to have distinct instances of executables installed not merely multiple windows services defined within...
1
2456
by: BuddyWork | last post by:
Hello, I want to know what is the best way to automate the installation of multiple instances of a windows service. For examlpe I want service name Test01 and Test02 installed but the executable and path is identical. Thanks,
0
1608
by: Sunil Pandita | last post by:
Hi all, I have created a windows service that is working well. Now i want to create the multiple instances of this service on the same box. How could it be possible?. One way that I thought was to create a contructor in the service class that will take the service name as the parameter and that may work but every time i have to recompile the program to add more instances.
1
2231
by: mikelujan | last post by:
Hi, Our application starts an external application using System.Diagnostics.Process class and the Start() method, as per code snippet below. This application run as a Windows service, and must start several instances of the same application, like multiple Windows Calculators for instance. We are experiencing difficulties starting applications after a certain number have been started. We changed our app to work as a Console...
0
1606
by: jigsmshah | last post by:
I have a windows service developed in C#.I am reading the connection string from an ini file and also i am reading 3 image file from the bin directory. now the new requirement is that there will be multiple instances of the same windows service running. My concern is that will there be any problem when multiple instances will be reading those above mentioned file.I am not writing to any files in the service. If i try to use lock() when...
3
1181
by: =?Utf-8?B?dGFzbGVlbQ==?= | last post by:
hi all, i have made windows service and its working fine. but i want that multiple instaces of that application should run. The problem is that each windows service will have its own configuration file,supplied by the front end of service. i have tried to make the seperate installers of that application/service but it removes the previous version before installing the new version, i have changed names of service, its executable etc it...
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10040
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.