IIS app pools, worker processes, app domains

Copy from  http://stackoverflow.com/questions/14105345/iis-app-pools-worker-processes-app-domains

I try to say them with other words.

In a server you can have many asp.net sites that runs together. Each one site is an app domain.

You must assign to each of them one application pool. Many application domains (sites) can have the same application pool, and because they have the same application pool they run under the same processes, and under the same account - and they have the same settings of the pool. If this pool restarts, then all sites under that pools restarts.

Now each pool can have one or more worker process. Each worker process is a different program that‘s run your site, have their alone static variables, they different start stop calls etc. Different worker process are not communicate together, and the only way to exchange data is from common files or a common database. If you have more than one worker process and one of them make long time calculations, then the other can take care to handle the internet calls and show content.

When you assign many worker process to a single pool then you make the called web garden and your site is like to be run from more than one computer if a computer is one processing machine.

Each worker process can have many threads.

How the more worker process affect you:
When you have one worker process everything is more simple, among your application all static variables are the same, and you use the lock to synchronize them.
When you assign more than one worker process then you still continue to use the lock for static variables, static variables are not different among the many runs of your site, and if you have some common resource (e.g. the creation of a thumbnail on the disk) then you need to synchronize your worker process with Mutex.

One more note. Its sounds that when you make more worker process then you may have more smooth asynchronous page loads. There is a small issue with the session handler of asp.net that is lock the entire process for a page load - that is good and not good depend if you know it and handle it - or change it.

So let talk about one site only with many worker process. Here you face the issue that you need to synchronize your common resource change with Mutex. But the pages/handlers that use session they are not asynchronous because the session locks them. This is good for start because you avoid to make this synchronization of many points your self.

Some questions on this topic:
Web app blocked while processing another web app on sharing same session
jQuery Ajax calls to web service seem to be synchronous
ASP.NET Server does not process pages asynchronously
Replacing ASP.Net‘s session entirely

Now this session lock is not affect different sites.

Among different sites the more worked process can help to not the one site block the other with long running process.
Also among different sites the more pools also can help, because each pool have at least one worked process, but remember and see by your self using the process explorer, each working process takes more memory of your computer, and one big server with 16G memory and one SQL server can not have too many different worked process - for example on a server with 100 shared sites, you can not have 100 different pools.

时间: 2024-10-25 15:25:26

IIS app pools, worker processes, app domains的相关文章

wp8人人监督app开发历程 - (前期调研 > app策划 > 代码编写 >测试 > 上架到商店)

前言 一直想为社会做一点事情,却一直都不知道做什么,策划已久的"人人监督"app终于做了一小半了. 开发了好几款app了,一直没写博文记录在开发app中遇到的问题和技术,这次"人人监督"不能在错过了,一定要坚持把整个开发历程写下来,同大家分享在代码世界中的快乐. "人人监督" 是一款供民众投诉.检举.监督的一款app,其目的是人人监督以营造和谐的社会! 项目技术 开发环境:Windows8  + Visual Studio 2012 + SQl

如何用一个app操作另外一个app.比如微信群控那样的

如何实现一个app.控制另外的app,比如市面上群控微信的,是用测试工具的原理?还是什么模拟点击的原理? 如何用一个app操作另外一个app.比如微信群控那样的 >> android 这个答案描述的挺清楚的:http://www.goodpm.net/postreply/android/1010000007186891/如何用一个app操作另外一个app比如微信群控那样的.html

app.listen(3000)与app是不一样的

前者是server代码如下 Server { domain: null, _events: { request: { [Function] domain: undefined, _events: [Object], _maxListeners: undefined, setMaxListeners: [Function: setMaxListeners], getMaxListeners: [Function: getMaxListeners], emit: [Function: emit],

[ app运营 ] APP运营思考:APP上线前,我们该做些什么?

一.产品部分:想一想APP的承载够不够,是否要做压力测试?上架后,会迎来第一波用户,如何保证你APP的正常运行?将会出现哪些意外情况?我们遇到一个真实的案例,某游戏APP上架后,第一天就有3万次真实激活,但就在当天晚些,出现几百个差评,几乎都是说:“登陆慢.运行慢.垃圾游戏”这样的评论,第二天只好主动下架调整. 移动互联网,特别是APP store的世界,天天都在上演着一夜成名的故事,如果你不想在第一天就倒下的话,花点时间做压力测试吧. 二.市场部分:1. 想一下如何收集用户反馈,以及如何处理.

Hybrid App(一)App开发选型

1.几种app开发模式概述 Native App 即传统的原生APP开发模式,Android基于Java语言,底层调用Google的 API;iOS基于OC或者Swift语言,底层调用App官方提供的API.体验最好. Web App 即移动端的网站,将页面部署在服务器上,然后用户使用各大浏览器访问.一般泛指 SPA(Single Page Application)模式开发出的网站.体验最差. Hybrid App 即混合开发,由Native通过JSBridge等方法提供统一的API,然后用Ht

Native App开发 与Web App开发(原生与web开发优缺点)

Native App开发 Native App开发即我们所称的传统APP开发模式(原生APP开发模式),该开发针对IOS.Android等不同的手机操作系统要采用不同的语言和框架进行开发,该模式通常是由“云服务器数据+APP应用客户端”两部份构成,APP应用所有的UI元素.数据内容.逻辑框架均安装在手机终端上. Web App开发 Web App开发即是一种框架型APP开发模式(HTML5  APP 框架开发模式),该开发具有跨平台的优势,该模式通常由“HTML5云网站+APP应用客户端”两部份

安卓App应用加固、App安全保护!

据最新消息,Android 应用数量已成功超越苹果,并将率先突破100万大关.而在众多多的应用之中,却潜伏着太多"不速之客".由于利益驱使以及相关法律的缺失,不法分子将病毒.木马内置于手机App中进行传播,导致手机死机.个人信息泄露.收取短信彩信进行扣费等情况发生,严重影响手机用户的正常使用. 很多用户都认为手机病毒.木马离自己很远,其实则不然,这些携带病毒.木马或恶意广告的App就广泛存在于应用市场之中.据艾媒咨询最新发布的报告显示,在中国手机病毒和恶意软件主要传播途径方面,应用商店

原生APP与移动Web App的比较

中国手机网民已超4.5亿,智能机用户超过3.8亿,中国移动互联网市场产值已超过712.5亿元,手机营销是未来必然趋势,而App恰恰是这个趋势下的一个强有力的营销工具: App已有两个主要的方向:原生App 以及 移动Web App.那么今天我们就来比较一下两者的区别供大家参考.   原生App 与 移动Web App : 定义   什么叫做原生App? 原生App是专门针对某一类移动设备而生的,它们都是被直接安装到设备里,而用户一般也是通过网络商店或者卖场来获取例如    The App Sto

Android 如何将一个app 设置为持久app, 不被low memory kill 关闭

前言 欢迎大家我分享和推荐好用的代码段~~ 声明 欢迎转载,但请保留文章原始出处: CSDN:http://www.csdn.net 雨季o莫忧离:http://blog.csdn.net/luckkof 正文 [Description] 如何将一个app 设置为常住app, 不被low memory kill 关闭 [Keyword] app 持久 persistent [Solution] 1. 将app 的manifest.xml 中的 application 中添加属性 android: