Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring-boot tomcat is able to offer only lesser than 10,000 connections?

I am testing the server with spring-boot. However, I got some problems during doing test.

my test is How many memories server use with increasing the web socket sessions(the number of client).

1,000 clients(lesser than 9000 sessions) has no issues with doing the test. but, When I tried to test 10k connections, server made connections almost until 10,000.(sometimes creating sessions until 9990, sometimes 9988, 9996 like this, not the specific limit the number of socket) after that, it just stopped creating sessions, no errors just not responding.

If some clients get timeout and release the connection, other clients which were waiting to connect are able to get connections.

'environment' tomcat : 8.0.36 spring-boot : 1.3.3 java : 1.8

for solutions, I tried

  1. increasing heap size.

    • I increase jvm heap memory by 5GB. but heap memories which are used for connections are only 2GB. So, I think that it is not related to JVM memory.
  2. I set server.tomcat.max-thread = 20000 in application.porperties.

    • but it was failed, no difference before.

I am really curious about this issue. If you guys knows this problem and have ideas, let me know the reason. Thanks.

like image 670
Jason Avatar asked Feb 14 '17 06:02

Jason


1 Answers

There is a properties for spring boot, tomcat max-connection, which needs to be set in application.properties file

server.tomcat.max-connections= # Maximum number of connections that the server will accept and process at any given time.
like image 75
Monzurul Shimul Avatar answered Sep 28 '22 21:09

Monzurul Shimul