开发者

Performance Improvement using multiple instances of an application

开发者 https://www.devze.com 2023-01-19 13:10 出处:网络
I am having a performance sensitive .net application. It is capable of doing parallel threading upto 32 threads. We have need of improving it even further. Increasing the thread may not really help s

I am having a performance sensitive .net application.

It is capable of doing parallel threading upto 32 threads. We have need of improving it even further. Increasing the thread may not really help since the number of failure attempts to process increases as we increase the number of threads.

My question here is,

  1. What are the options leftover to improve the performance?

  2. Would there be any possible improvement if I do run two instances of the same application each running 32 threads in parellel? Its jus开发者_如何学JAVAt a wild idea considering that each application is going to be run in different AppDomains.


Your best bet is to measure performance rigorously and identify bottleneck(s) before you make any more change. Throwing extra threads or processes at the problem is unlikely to result in the best solution. Start here for extensive .Net profiler information.

Why is 32 threads a magic number? Does that give you better throughput than 31/30/29 etc?

What are those threads doing when they are not working? No more threads can be active at any given time than the number of processor cores in your system. If you are CPU-bound then adding more threads is counter-productive.

How much context switching overhead is involved?

What are your external bottleneck candidates - direct I/O, network, database? You have not yet said very much about what the app actually does.

Do your threads share resources? A single shared data item can be a significant bottleneck and again, adding threads does not help in this case. Replace shared data by thread-local if possible.

0

精彩评论

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