Chris, Thanks for your patience!
Your explanation is quite clearly. Now I know what i'm going to do. Thanks again! jingych From: Christopher Schultz Date: 2015-07-09 03:50 To: Tomcat Users List Subject: Re: Questions about the HTTP connector config -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 jingych, On 7/8/15 4:09 AM, jingych wrote: > I desire for using tomcat as the websocket server. But I'm now > wondering about the tomcat performance. Does anyone know the max > connections that tomcat could held? the concurrent number > requests? You'll definitely want to use the NIO or NIO2 connectors. For both of those, the default maximum number of total (and thus concurrent) connections is 10000. You may want to raise that if you expect lots of long-running Websocket conversations. The number of concurrent threads you think you can handle is more related to your hardware and your application than anything else. > And I don't quite understand the configurations: acceptCount & > maxConnections & maxThreads acceptCount = TCP backlog (c.f. Google) maxConnections = maximum number of connections Tomcat will maintain at once maxThreads = maximum number of threads Tomcat will use to process incoming data I wouldn't change acceptCount unless you have a very good reason. The only thing you are likely to accomplish by increasing the acceptCount is causing more connections to time out and masking any underlying problems -- like that you are trying to accept more traffic than you can reasonably service. Tomcat can handle 10k connections with many fewer threads (the default is 200) as long as those 10k connections aren't trying to all talk at once. If they are all trying to communicate at once, the 200 threads are unlikely to be able to keep up with them, and your users will experience slow performance or possibly read/write timeouts. > There must be some relationship between the three params. > > if I set [ accpetCount=200, maxConnections=10000, maxThreads=100] > dose it means: 1, the max connections that tomcat maintain with the > client is 10000. and if the 10001 client's connect request is > coming, the client will timeout. No, the 10001 client's request will go into the TCP backlog queue. When it comes out depends upon when one of the other 10000 connections disconnects and so Tomcat will call accept() on the socket for another connection. > 2, the max request is 200, and the 201 request will be refused. There is no maximum number of requests. > 3, the max concurrent request is 100. This is pretty much correct. If your transactions are short, then 100 threads can probably comfortably service 10k connections. The best thing for you to do is work-up a realistic load test and run it against Tomcat in various configurations with your actual application doing actual work. - -chris -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJVnX8iAAoJEBzwKT+lPKRYqSgQAMhVHWGi4QdBi6aw/5Wy826+ LTqolp9UGAbyzWKaJBaMlFS11arw8nFjy2Q9m6OWFGxKqmEXbc0qUVVrlHTf9mQd /KIb2WEfy5eUT2TbNhiuq3VM7yDYT8m9xI9KCPWsnKXr31tvYLLttyzKm9p930a6 UR1gAx8kKwrbE00KuNNklGj1OsRW8cTwGnSGnQP5Yq0fmhwJrt2bCp44FvwicILk 2JyCL3Oq4EK0hB+pB6c9WG+CYNjrXywmmHIzdI0kKzzCEu5NmHlt1zmOF7ZcPYm7 GYZcm3QtRNWK/rqMmjaSHn8YUo6pUOicabJr7fkgR9AcqxF2R9u8gkI1G1dUbTK4 Dzp1EPLDsnADvIQdOuWf+FUABT12oHHwPOMId2QMfHiM4LA9V99CNMz9R7VzsD4f T72fPy2d3jSQ+ZsWOudqAWBGC/l1S+tRI9dePJehy3wIiHSaB4SPz1MWWhYbAAQt PnjWQAhK4BOTDpsyfUE1jIkYMeTWqRQfvnTnvwAPDCo7WgUUzrh7OJMuIGSacbux vOrIACUKt1YA0QfMdQ53oUc1UrAFWefV3OyZdqC2IQ5d+xPRogMJ+GWzsDDEPI5K Kggt8D7V25vMW5PXTH/s862WmUeY+WE/ytsRGBSlBRSdz8Gri1MLYl4lyXMNZqwe CtxyYXJ7nfbGLfZIAF+7 =LEfa -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. ---------------------------------------------------------------------------------------------------