Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring TCP Client Server max connections

Trying to build a TCP server using Spring Integration in which keeps connections may run into thousands at any point in time. Key concerns are regarding

  1. Max no. of concurrent client connections that can be managed as session would be live for a long period of time.
  2. What is advise in case connections exceed limit specified in (1).

Something along the lines of a cluster of servers would be helpful.

like image 234
Shadab Avatar asked Mar 15 '26 12:03

Shadab


1 Answers

There's no mechanism to limit the number of connections allowed. You can, however, limit the workload by using fixed thread pools. You could also use an ApplicationListener to get TcpConnectionOpenEvents and immediately close the socket if your limit is exceeded (perhaps sending some error to the client first).

Of course you can have a cluster, together with some kind of load balancer.

like image 148
Gary Russell Avatar answered Mar 18 '26 01:03

Gary Russell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!