0

I using ELB load 2 EC2 run tomcat 8 server.

I using AB for test

ab -n 7000 -c 7000 -k -H "Accept-Encoding: gzip, deflate" http://mywebsite.com

I check log ELB right with 7000 requests sending (some request 503)

But, I check in log access tomcat only 5600 requests access.

=> Tomcat service temporarily unavailable

How I can fix that?

minamino
  • 115
  • 1
  • 13

1 Answers1

0

Add acceptCount in Connector server.xml

Wesley Sun
  • 11
  • 3
  • This is my config. It is good? – minamino Feb 02 '16 at 09:41
  • It don't working right. I think that may be due to server overload => tomcat temporary unavailable => response is 503. I guess that. – minamino Feb 03 '16 at 02:17
  • The connector acceptCount is point serversocketchannel backlog, tomcat default count is 100. So I think if the accept count increase, the accept connection queue will be increase. Here is the java api abstract ServerSocketChannel bind(SocketAddress local, int backlog) Binds the channel's socket to a local address and configures the socket to listen for connections. – Wesley Sun Feb 03 '16 at 02:35
  • I using maxConnections="-1" I think don't have limit connection – minamino Feb 03 '16 at 02:38
  • If you read the tomcat source code, you will know maxConnections and acceptCount are two different things, lol. But i still confuse why acceptCount did not work for you this time. If i have time i will simulate same environment as your's to identify this issue. – Wesley Sun Feb 03 '16 at 03:22
  • I using AWS EC2 1 CPC 3.7GB RAM, with 2 server you think we can process 7000 concurrency? Reason is if I set acceptCount="7000" but may be resource server I have is not enough. – minamino Feb 03 '16 at 03:28
  • Yes, you are right, we don't know the resource server(your hardware) if can support so many TCP/IP requests in the socket queue. So we need test. I saw a article before who set the acceptCount=8192 in their server – Wesley Sun Feb 03 '16 at 04:02
  • When I check in VisualVM CPU 50%, JVM 30%. But I test with AB have 3000 request failed. You think why? – minamino Feb 03 '16 at 06:36
  • Can you check this file value in you VM? /proc/sys/net/ipv4/tcp_max_syn_backlog – Wesley Sun Feb 03 '16 at 09:37