Tomcat is unresponsive and throwing 504 intermittently. But there is not much CPU usage. We suspected it could happen we receive many number of requests and made tomcat unresponsive. We gave 400 as maxThreads in server.xml and the only lead we have is below error in the log.
Maximum number of threads (400) created for connector with address null and port 8090
We use AWS and checked the ELB, It is just 299 requests at that time. So it confusing for us that when we see maximum number of threads in the error and how can ELB shows less that that.