《ASP.NET本质论》 ASP.NET 中线程池设置
来源:互联网 发布:淘宝女装店名起名大全 编辑:程序博客网 时间:2024/05/22 17:15
在ASP.NET的服务处理中,每当服务器收到一个请求,HttpRuntiome将从HttpApplication池中获取一个HttpApplication对象处理此请求,请求的处理过程将被排入线程池中,对于ASP.NET来说,在 machine.config 文件的processModel部分 可以设置线程池的参数,常用哦参数设置如下:
参数
配置
autoConfig
基于服务器的配置自动设置以下配置参数:
1)maxWorkerThreads
2)maxIoThreads
3)httpRuntime元素的minFreeThreads属性
4)httpRuntime元素的minLocalRequestFreeThreads属性
5)connectionManagement元素的maxConnection属性
默认设置为True
maxWorkerThreads
设置每个CPU的最大工作线程数量,可以设置的范围为5~100,默认为20,建议设置为100
minWorkerThreads
设置每个CPU的最少工作线程数量,默认为1
maxIoThreads
配置每个CPU的最大I/O线程数量,可以设置的范围为5~100,默认为20,建议设置为100
minIoThreads
配置每个CPUT的最少I/O线程数量,默认为1
参数
配置
minFreeThreads
处理新请求保留的最少自由线程数量,默认值为8.建议每CPU设置为88个
minLocalRequestFreeThreads
为本地主机请求保留的最少自由线程数量,默认值为4。建议每CPU设置为76个
appRequestQueueLimit
在ASP.NET没有足够的线程来处理请求的时候,将会把这些请求排入一个请求队列中等待处理,appRequestQueueLimit用来设置这个队列的长度,当请求队列的长度超出这个参数的时候,服务器返回“503-Server Too Busy”
默认为5000,在ASP.NET 1.1 中,默认为100
查看本机配置:
protected void Page_Load(object sender, EventArgs e) { string path = this.Request.ApplicationPath; Configuration config = WebConfigurationManager.OpenWebConfiguration( null ); ProcessModelSection proecssModeSection = config.GetSection("system.web/processModel") as ProcessModelSection; Response.Write( string.Format("MaxWorkerThreads: {0}", proecssModeSection.MaxWorkerThreads)); Response.Write(string.Format("MinWorkerThreads: {0}", proecssModeSection.MinWorkerThreads)); Response.Write( string.Format("MaxIOThreads: {0}", proecssModeSection.MaxIOThreads)); Response.Write( string.Format("MinIOThreads: {0}", proecssModeSection.MinIOThreads)); HttpRuntimeSection httpRuntimeSection = config.GetSection("system.web/httpRuntime") as HttpRuntimeSection; Response.Write( string.Format("MinFreeThreads: {0}", httpRuntimeSection.MinFreeThreads)); Response.Write(string.Format("MinLocalRequestFreeThreads: {0}", httpRuntimeSection.MinLocalRequestFreeThreads)); Response.Write(string.Format("AppRequestQueueLimit: {0}", httpRuntimeSection.AppRequestQueueLimit)); }
- 《ASP.NET本质论》 ASP.NET 中线程池设置
- 《ASP.NET本质论》 线程基础
- ASP.NET本质论
- ASP.NET本质论
- asp.net本质论
- ASP.NET本质论 前言
- 《ASP.NET本质论》Base64
- 《ASP.NET本质论》 反射
- 《ASP.NET本质论》 MVC
- ASP.NET本质论开篇
- asp.net控件本质
- asp.net控件本质
- asp.net控件本质
- asp.net控件本质
- asp.net控件本质
- ASP.NET中 SessionID的本质
- 《ASP.NET本质论》 ASP.NET中的加密与解密
- asp.net中使用线程
- Linux各种性能参数监控过程详解
- [Audio] Android深入浅出之Audio
- 再谈Code Review
- 文摘
- JSTL-Core标签库
- 《ASP.NET本质论》 ASP.NET 中线程池设置
- 2011-8-7 14:25:51
- 2011-8-7 17:27:44
- 访问图像元素(imagedata widthstep)
- 2011-8-7 17:52:56
- 2011-8-7 18:06:30
- 关闭整个FRAMESET窗口的问题
- android设置Activity背景色为透明的2种方法
- hdu 1166 树状数组 线段树