如果在machine.config中修改此项值,则对所有服务器的网站都起作用。因此需要在网站的global.asax的Application_Start 方法中进行设置:
int minWorker, minIOC;
// Get the current settings.
ThreadPool.GetMinThreads(out minWorker, out minIOC);
//服务器设置最小的进程中线程为240,因为是8核cpu。单核30,8核是:8*30
ThreadPool.SetMinThreads(30, minIOC);这里设置单核cpu的workerthreads为30,我的服务器是8核,默认此项为8.经过测试,此项设置不会影响到其他网站的默认线程配置

本文介绍如何在网站的global.asax文件中通过Application_Start方法设置线程池的最小线程数,以优化服务器性能。针对8核CPU服务器,将单核worker threads设置为30,总最小线程数为240,此设置不会影响其他网站的默认线程配置。

968

被折叠的 条评论
为什么被折叠?



