title: Prevent overload on remote system when using Parallel.ForEach()
body: <p>We've built this app that needs to have some calculations done on a remote machine (actually a MatLab server). We're using web services to connect to the MatLab server and perform the calculations. </p>
  
  <p>In order to speed things up, we've used <code>Parallel.ForEach()</code> in order to have multiple service calls going at the same time. If we're very conservative in setting <code>ParallelOptions.MaxDegreeOfParallelism</code> (DOP) to 4 or something, everything works fine and well.
  However, if we let the framework decide on the DOP it will spawn so many threads that it forces the remote machine on its knees and timeouts start occurring ( > 10 minutes ). </p>
  
  <p>How can we solve this issue? What I would LOVE to be able to do is use the response time to throttle the calls. If response time is less than 30 sec, keep adding threads, as soon as it's over 30 sec, use less. Any suggestions?</p>
  
  <p>N.B. Related to the response in this question: <a href="https://stackoverflow.com/a/20192692/896697">https://stackoverflow.com/a/20192692/896697</a> </p>