0

I am running a Java multi threaded network application on my server and when I increase the thread count to more than 2000, I start seeing exceptions that it can not connect to an external server. "Connection refused" error. This is from the client side, I do not get errors when I do 1000 threads on different servers

Is there anyway to increase this limit?

8
  • 1
    2000 threads... Mama mia Commented Feb 5, 2017 at 15:43
  • The limit is probably enforced on the server side, and in that case you can't do anything to increase it from the client side. Commented Feb 5, 2017 at 15:44
  • @Andremoniy It's running on a server with 20 cores with more than 80GB ram. The hardware can handle it Commented Feb 5, 2017 at 15:45
  • @abl it connects to a postgresql server. The server can handle many many more connections. Commented Feb 5, 2017 at 15:45
  • By default no. 2000 is toooo much Commented Feb 5, 2017 at 15:46

2 Answers 2

1

No doubts: each server has limit of incoming connections. On occupying all of them DOS attacks are based.

Sign up to request clarification or add additional context in comments.

2 Comments

It is also worth to mention that 2000 connections doesn't make sense for client either.
@rkosegi as I said in my commentary above it is *Mamma mia..." :-)
0

Using 'thread per connection' in Java is a bad idea when you are using 2000 connections. You might want to refer to Java NIO

1 Comment

This will address client side IO pressure, not fact that server rejects new connections.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.