开发者

What are useful tips for making multi-core optimised ASP.NET MVC applications?

开发者 https://www.devze.com 2022-12-08 11:09 出处:网络
I see a lot of the mu开发者_JAVA技巧lti-core information on the web applied to desktop applications - but I am interested: what tips and pointers would be useful for ASP.NET MVC web developers buildin

I see a lot of the mu开发者_JAVA技巧lti-core information on the web applied to desktop applications - but I am interested: what tips and pointers would be useful for ASP.NET MVC web developers building applications that make the most of multiple cores/processors?


Leave it to the web server

I wouldn't mess with it in a web application unless it does some sort of processor heavy processing. Make sure your application performs well and leave processor(s) utilization to the web server to serve requests with all cores in the system.


If you have multiple long running processes per request, you could parallelize them. But generally it's not worth the coding effort and bugs that could show up.

In practice, just make each request lean, and then you can handle more requests at one time.


I don't think a web app gets as much value from multi-core/multi-threading as a desktop app, because ultimately each HTTP request is synchronous (except for AJAX, but each AJAX request is still an HTTP request). Certainly a server with multi-core is a good thing, and can probably handle requests faster, but I don't think there's much (in general) you can do with a multi-threading app that ultimately renders an HTML document.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号