运行自己的进程与共享进程的 Windows 服务之间的区别 [英] Diffrence between windows services running own processes vs shared process

查看:20
本文介绍了运行自己的进程与共享进程的 Windows 服务之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理的项目中,我们决定将后台任务(网络、CPU 和 IO 密集型)拆分为三个 Windows 服务.

I am working on project where we have decided to split our background tasks (network, CPU and IO intensive) into three windows services.

现在的问题是,我们是应该将所有三个服务都托管到一个进程中,还是应该创建三个具有自己进程的独立服务.

Now the question is, whether we should host all three services into a single process or create three independent services with their own processes.

Windows 服务项目模板允许创建多个服务,安装后它们将在服务控制管理器 (SCM) 中创建单独的条目并且可以独立控制.这里的好处是更好的代码管理和代码重用.

Windows Service project template allows multiple services to be created, when installed they'll create separate entries in Service Control Manager (SCM) and can be controlled independently. The benefit here is better code management and code reuse.

但是,如果有任何性能缺陷,这是我们首先拥有多项服务的主要原因,我宁愿放弃这个好处.

However, if there is any performance drawback, which is the primary reason why we're having multiple services in the first place, I'd rather let go this benefit.

请指教.

推荐答案

我的建议是使用使用 topshelf 或其他技术创建的 Seperarte windows 服务,因此它们独立于 paltform

My suggestion is to go for Seperarte windows services created using topshelf or other technology hence they are independent of paltform

可扩展性可根据需要轻松扩展,如果一项服务的使用量多于其他服务,则可以通过运行多个相同的实例来扩展该服务.

Scalability easly scalable as per need ,if one service is being used more then other, then that one service can be scale up by running multiple instance of same.

并行处理,因为服务是独立的,它们可以并行工作,从而提高了性能.

parallel processing as services are independent they can work in prallel hence performance improved.

这篇关于运行自己的进程与共享进程的 Windows 服务之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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