title: Concurrent connection limit when using RestClient in Spring Boot
body: <p>I have a test micro-service application built using Spring boot which I am load testing. In doing so, I seem to be running into blocking issues around RestClient calls between services. I have not made any configuration changes so thread pool etc are all using defaults. All of my testing is on AWS micro instances and using loader.io to do the initial client requesting.</p>
  
  <p>The application has two services running on different servers</p>
  
  <ol>
  <li>Service that returns a list of recent user posts (response with no load is 340ms)</li>
  <li>Service that takes a list of userId's and returns profile information (response with no load is (80ms)</li>
  </ol>
  
  <p>During the execution of service #1, there is a call made to service #2 to embellish detail about the posting users including if I follow them etc.</p>
  
  <p>Caching is in place within the services an even under load the profile service is able to respond in around 50ms. If I remove the internal request from the post service to the profile service, it remains pretty constant at around 400ms.</p>
  
  <p>What I am observing though is that the round trip time calling between those services under load increases linearly as the number of concurrent requests increases. Under the same load conditions (80tps) the response times from the call between the services is up to around 4s.</p>
  
  <p>The code is using a simple RestTemplate to call between the services, for example:</p>
  
  <pre><code>        RestTemplate restTemplate = new RestTemplate();
          HttpHeaders headers = new HttpHeaders();
          HttpEntity&lt;String&gt; httpEntity = new HttpEntity&lt;String&gt;(headers);
          responseVal = restTemplate.exchange(url, HttpMethod.GET, httpEntity,String.class);
  </code></pre>
  
  <p>Is there an arbitrary limit on the number of concurrent requests that can be made between services in Spring and if so, how can that be increased?</p>