Windows服务 - 安装多个实例的建议 [英] Windows Service - Suggestions for Installing Multiple Instances

查看:94
本文介绍了Windows服务 - 安装多个实例的建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我目前有一个Windows服务,运行非常好的处理器/内存密集型交易。我需要在同一台服务器上部署多个Web服务的
实例。每个实例都需要在自己的流程中运行



我目前的做法是将所有逻辑单独放入

工人组装并将其安装到GAC中。然后我要创建

多个Windows服务(即MyService1,MyService2等等),每个服务实例化工作人员。 。然后,我将为每个Windows服务提供单独的安装程序

。 (不完全优雅)


有关这种方法的任何建议吗?


有没有办法让一个代码库?对于Windows服务,而不是具有MyService1,MYService2和MYService2项目的项目。等等。?


是否有工人 GAC中的汇编会影响性能吗?


是否有一种简单的方法可以在同一台服务器上安装同一Windows的多个版本

服务(我可以好像找不到一个)

提前致谢!!!



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 !!!

推荐答案

John,


请参阅内联:
John,

See inline:
我目前有一个Windows服务,它运行处理器/内存密集型的事务。我需要在同一台服务器上部署多个Web服务实例。每个实例都需要在自己的进程中运行。


如果您正在公开网络服务,为什么不在IIS中使用

不同的应用程序托管它们?

我的目前的做法是将所有逻辑放入一个单独的工人中。组装并将其安装到GAC中。然后,我将创建多个Windows服务(即MyService1,MyService2等),每个服务实例化工作者。 。然后,我将为每个Windows服务提供单独的安装程序。 (不完全优雅)

有关此方法的任何建议吗?


我会考虑创建一个服务组件,然后安装在

COM +中。您可以选择让您的组件作为服务运行(我相信

Windows XP和Windows Server 2003),因此您不必创建新的

每个实例的shell。你只需要将你的组件作为一个单独的COM +应用程序安装,然后让它飞起来。

是否有工人 GAC中的汇编会影响性能吗?
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.


希望这会有所帮助。

-

- Nicholas Paldino [.NET / C#MVP]

- mv *@spam.guard.caspershouse.com


John,

你可以拥有相同的Codebase如你所描述的那样,每个

ServiceName属性都是从

appSettings部分的app.Config文件中加载的。每项服务必须有所不同。但是,我是

想知道为什么你真的需要同一服务的多个实例。

你不能使用一个服务并让它使用某种服务元数据

或Hashtable ofrules和多个线程一起执行不同的

功能?

彼得


-

联合创始人,Eggheadcafe.com开发者门户网站:
http://www.eggheadcafe。 com

UnBlog:
http:// petesbloggerama .blogspot.com


" John"写道:
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:


我目前有一个运行非常处理器/内存密集型事务的Windows服务。我需要在同一台服务器上部署多个Web服务实例。每个实例都需要在自己的流程中运行。

我目前的方法是将所有逻辑放入一个单独的工作人员中。组装并将其安装到GAC中。然后,我将创建多个Windows服务(即MyService1,MyService2等),每个服务实例化工作者。 。然后,我将为每个Windows服务提供单独的安装程序。 (不完全优雅)

有关这种方法的任何建议吗?

有没有办法让一个代码库?对于Windows服务,而不是具有MyService1,MYService2的项目。等等。?

有工人吗? GAC中的汇编会影响性能吗?

是否有一种简单的方法可以在同一台服务器上安装同一Windows服务的多个版本(我似乎无法找到)

提前致谢!!!


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 !!!



对不起尼古拉斯我的意思是同一个WINDOWS服务的多个实例

不是WEB服务。

我的应用程序没有WEB / IIS组件。这会改变你的建议吗?此应用程序也是高度多线程的。


之前我没有使用过ServicedComponent。你的原因是什么?b $ b推荐这个以避免多个Windows服务代码库&

安装程序?或者还有其他好处吗?


引入COM +应用程序会对性能产生负面影响吗?


这是一个运行1000'的企业级应用程序交易

每日。这就是为什么我如此关注性能

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 "ServicedComponent"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


这篇关于Windows服务 - 安装多个实例的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆