title: Creating multiples instances in Google App Engine JAVA
body: <p>I am testing Google App Engine using JAVA and I want to test to run multiples instances in parallel. However, I don't know how to activate multiples instances.</p>
  
  <p>I tried running this Servlet in different browser (also I tried running concurrent calls in a different machine - with different IP)</p>
  
  <pre><code>import java.io.IOException;
  import javax.servlet.*;
  import javax.servlet.http.*;
  import java.math.*;
  public class SimpleServlet extends HttpServlet
  {
    //A variable that is NOT thread-safe!
  
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException
    {
      doPost(req, resp);
    }
    public void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException
    {
       int counter = 0;
      resp.getWriter().println("&lt;HTML&gt;&lt;BODY&gt;");
      resp.getWriter().println(this + ": &lt;br&gt;");
      for (int c = 0; c &lt; 10; c++)
      {
        resp.getWriter().println("Counter = " + counter + "&lt;BR&gt;");
        try
        {
          //Thread.currentThread().sleep( 500);
            for (int e=0;e&lt;9999;e++) {
            }
          Thread.sleep(500);
  
          counter++;
        }
        catch (InterruptedException exc) {
          resp.getWriter().println("I can't sleep&lt;BR&gt;");
        }
      }
      resp.getWriter().println("&lt;/BODY&gt;&lt;/HTML&gt;");
    }
  }
  </code></pre>
  
  <p>Every Servlet took 5 seconds to process but the requests are pooled in a single instance, for example if I run 10 times this servlet then it took 50 seconds to process the last one.</p>
  
  <p>I tried using:</p>
  
  <pre><code>&lt;threadsafe&gt;true&lt;/threadsafe&gt;
  </code></pre>
  
  <p>but it do nothing.</p>
  
  <p>I tried changing the settings</p>
  
  <p><img src="https://i.stack.imgur.com/HmLS3.jpg" alt="settings"></p>
  
  <p>without luck.</p>
  
  <p><img src="https://i.stack.imgur.com/A4ZbG.jpg" alt="enter image description here"></p>
  
  <p>So, what can I do?</p>