0

I am running a benchmark(Java) where I open 10K connections. I am hitting a limit where I cannot open more than ~8000 tcp connections to a server. Connecting to two servers, the limit seems to be somewhere between 8000 and 10000 connections. So I am fairly certain the problem has to be on the client side.

I tried the following settings on the client:

  • setting the ephemeral ports:net.ipv4.ip_local_port_range = 32768 60999
  • Setting the ulimit to 65535

But still my Java application can't open more than 8K outgoing connections.

Some experimenting showed that:

  • Doing a little less than 8K in rapid succession is fine.
  • Doing 8.1K requests causes a 30 delay before it continues with only little bursts.
  • During the tests the machine never runs out of CPU or memory. During the delay it goes back to running at an idle 1-2%.
  • No error or exception is being thrown.

How can I increase the limit to have more open connections?

New contributor
davidto is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
7
  • What happens when the Java client tries to open more connections than that? Does the connect call succeed, or fail with some error code, or block? Commented Nov 28 at 13:49
  • @grawity It uses virtual threads. VisualVM shows all the carrier threads as being parked. Looking at the server logs the first 8000 appear instantly followed by 30sec of nothing and next 2000 requests come in very slowly. Commented Nov 28 at 14:15
  • What does ulimit -n say for the user running the program? Commented Nov 28 at 16:46
  • ping - are you stil interested? Commented yesterday
  • @tink sorry, the result is 65535 Commented yesterday

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.