0

I have Tomcat 7 running on a baremetal server with lots of RAM under CentOS 7. The max RAM for the Tomcat instance has been set to 4 GB.

I have deployed a trivial servlet that performs a thread sleep of 5 seconds on every call. I then ran some load tests (500 requests on the servlet through an HTTP connector).

Here's the problem: the first 6 requests are processed, and the following ones are queued until one of the previous 6 has finished processing.

Here's my code:

@ResponseBody
@RequestMapping(value = "test.do", method = RequestMethod.POST)
public String test( HttpServletRequest request, HttpServletResponse response) throws FileNotFoundException, IOException {       
    System.out.println("start process !");
    try {
       Thread.sleep(5000);                 
    } catch(InterruptedException ex) {
       Thread.currentThread().interrupt();
    }
    return "ok";        
}

maxThreads is set to 300.

I tried to put to maxConnections -1

Zero Piraeus
  • 56,143
  • 27
  • 150
  • 160
Elyes
  • 1
  • 1
  • 3

0 Answers0