title: 502 server error in Google App Engine Flexible when load testing with JMeter
body: <p>I have deployed a simple Spring boot app in Google App Engine Flexible. The app. has two APIs, one to add the user data into the DB (xxx.appspot.com/add) the other to get all the user data from the DB (xxx.appspot.com/all).</p>
  
  <p>I wanted to see how GAE scales for the load, hence used JMeter to create a load with 100 user concurrency ramped up in 10 seconds and calls these two APIs in half a second delay, forever. While it runs fine for sometime (with just one instance), it starts to fail after 30 seconds or so with a "java.net.SocketException" or "The server responded with a status of 502".</p>
  
  <p>After this error, when I try to access the same API from the browser, it displays, </p>
  
  <blockquote>
    <p>Error: Server Error</p>
    
    <p>The server encountered a temporary error and could not complete your
    request. Please try again in 30 seconds.</p>
  </blockquote>
  
  <p>The service is back to normal after 30 mins or so, and whenever the load test happens it repeats the same behavior as mentioned above. I expect GAE to auto-scale based on the load coming in to handle it without any down time (using multiple instances), instead it just crashes or blocks the service (without any information in the log). My app.yaml configuration is,</p>
  
  <pre><code>runtime: java
  env: flex
  service: hello-service
  automatic_scaling:
    min_num_instances: 1
    max_num_instances: 10
  </code></pre>
  
  <p>I am a bit stuck with this one, Any help would be greatly appreciated. Thanks in advance.</p>