Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Following from my prior question (yep, should have been a Q against original message - apologies):</p> <p>Why do you feel that creating 12 threads for each processor core in your machine will in some way speed-up your server's ability to create worker threads? All you're doing is slowing your server down! </p> <p>As per MSDN do</p> <blockquote> <p>As per the MSDN docs: "You can use the SetMinThreads method to increase the minimum number of threads. <b>However, unnecessarily increasing these values can cause performance problems.</b> If too many tasks start at the same time, all of them might appear to be slow. In most cases, the thread pool will perform better with its own algorith for allocating threads. Reducing the minimum to less than the number of processors can also hurt performance.".</p> </blockquote> <p>Issues like this are usually caused by bumping into limits or contention on a shared resource.</p> <p>In your case, I am guessing that your last task(s) is/are blocking while they wait for a connection to the DB server to come available or for the DB to respond. Remember - if your invocation kicks off 5-6 other tasks then your machine is going to have to create and open numerous DB connections and is going to kick the DB with, potentially, a lot of work. If your WCF server and/or your DB server are cold, then your first few invocations are going to be slower until the machine's caches etc., are populated. </p> <p>Have you tried adding a little tracing/logging using the stopwatch to time how long it takes for your tasks to connect to the DB server and then execute their operations? </p> <p>You may find that reducing the number of concurrent tasks you kick off actually speeds things up. Try spawning 3 tasks at a time, waiting for them to complete and then spawn the next 3.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload