title: AWS API Gateway read: connection reset by peer error
body: <p>We have deployed few of our micro services into AWS kubernetes cluster. The high level message flow of the application architecture is as follows.</p>
  
  <p>Client Application -> AWS API Gateway -> Istio Proxy -> Micro Service</p>
  
  <p>While doing some performance testing from a client application(Written in GoLang) with concurrent load of around 20 requests per seconds for different micro services(All micro services have same host and different path like <a href="https://aws-api-gateway.com/service1" rel="nofollow noreferrer">https://aws-api-gateway.com/service1</a>,  <a href="https://aws-api-gateway.com/service2" rel="nofollow noreferrer">https://aws-api-gateway.com/service2</a>) we are intermittently encountering the following error in client application.</p>
  
  <pre><code>Error while signing Post "https://aws-api-gateway/service1/v1/client/payload/sign": read tcp 192.168.1.77:51734-&gt;54.xxx.xxx.xx:443: read: connection reset by peer
  </code></pre>
  
  <p>When error occurs, it occurs in groups, like we see around 10 request are rejected by "read: connection reset by peer".</p>
  
  <p>The client application have the http connection pool with MaxIdleConns=100 and MaxConnsPerHost=100</p>
  
  <p>We have confirmed that endpoints doesn't have any rate limiting setup(If the rate limiting is exceeded, the error will be http response code)</p>
  
  <p>What would be the possible root cause of this error.</p>