的ASP.NET Web花园 - 有多少工作进程我需要? [英] ASP.NET Web Garden - How Many Worker Processes Do I Need?

查看:137
本文介绍了的ASP.NET Web花园 - 有多少工作进程我需要?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是决定工人多少进程,以便为ASP.NET Web应用程序的最佳实践?

What is the best practice for deciding how many worker processes to allow for an ASP.NET web application?

在一台服务器我管理,创建一个新的程序池默认为10(最大)的工作进程。其他人认为,正常的设置就是其中之一。

On one server I manage, creating a new AppPool defaults to 10 (maximum) worker processes. Other people suggest that the normal setting is one.

不多个工作进程解决什么问题,什么是决定技术多少?

What problem does multiple worker processes solve and what are the techniques for deciding on how many?

推荐答案

工作进程分割你的网站在多个exe文件的执行的一种方式。你一对夫妇的原因做到这一点,如果一个工人得到由它不走别人走过的运行时间问题重挫。例如,如果一个HTML请求进入,导致流掉成没有那么只有正在由一名工人处理器处理被杀其他请求的处理。另一个例子是,一个请求可能导致阻塞抵抗由同一工人处理的其他线程

Worker processes are a way of segmenting the execution of your website across multiple exe's. You do this for a couple of reasons, one if one of the workers gets clobbered by run time issues it doesn't take the others down. For example, if a html request comes in that causes the process to run off into nothing then only the other requests that are being handled by that one worker processor get killed. Another example is that one request could cause blocking against the other threads handled by the same worker.

至于你需要多少,做一些负载测试。打硬的应用程序,看到只有一个会发生什么。再加入一些更给它,并再次打它。在某些时候,你会达到饱和,真正的机器网络,磁盘,CPU和RAM的一个点。这时候,你知道你有正确的平衡的。

As far as how many you need, do some load testing. Hit the app hard and see what happens with only one. Then add some more to it and hit it again. At some point you'll reach a point of truly saturating the machines network, disk, cpu, and ram. That's when you know you have the right balance.

顺便说一句,你可以控制通过machine.config文件每个工人的过程中使用的线程数。我认为关键是maxWorkerThreads。

Incidentally, you can control the number of threads used per worker process via the machine.config file. I believe the key is maxWorkerThreads.

现在,要小心,如果你使用会话,会话状态不工作进程间共享。我一般建议避免会话反正但它是值得考虑的。

Now, beware, if you use session, Session state is not shared between worker processes. I generally recommend avoiding session anyway but it is something to consider.

对于所有意图和目的,因为它是自己单独的Web服务器可以考虑每个工作进程。除非他们在同一机器上运行。

For all intents and purposes you might consider each worker process as it's own separate web server. Except they are running on the same box.

这篇关于的ASP.NET Web花园 - 有多少工作进程我需要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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