1

i have an issue during a load test. i am trying to open 100k concurrent users, each user gets a thread and opens a java SockJsClient object for the connection. the problem occurs when i am reaching more than 32k connections. the test is not indicating any problem with new threads and i see 50k open threads. but on the service side i see only 32.2k open connections.

it is not a service issue bacause i can open this amount from multiple machines combined.

there is no resouce issue on my machine as i have 128GB of RAM and the used memory barely reaches 20% as well as the CPU. i am afraid there is some OS limitation on the number of open fd. the problem is that i run on windows 10 and can not find any documantation of open files limit per system or per proccess. is there anything i can do to increase the limit or even check what the limit is?

Dev93
  • 93
  • 2
  • 13
  • Are those connections using IPv4? (FWIW, I'm impressed that you're able to get that many connection going without running into issues.) – 500 - Internal Server Error May 14 '20 at 13:22
  • yes, the connections using IPv4 – Dev93 May 14 '20 at 13:26
  • 2
    Is it possible that you are running out of available ports? - a port is 16 bits, maybe it's limited to the signed range of that, it would fit the symptom you describe, but I admit I am just guessing here. – 500 - Internal Server Error May 14 '20 at 13:31
  • is there a way to configue windows to use IPv6? – Dev93 May 14 '20 at 13:37
  • It's enabled by default, but you have to write the socket code accordingly, both in the client and in the server. – Seva Alekseyev May 14 '20 at 13:55
  • i am not writing the low level sockets code like you are describing i am using spring objects. – Dev93 May 14 '20 at 14:14
  • 2
    Windows has [65.535 ports](https://stackoverflow.com/a/38141340/52598) of which you can (kind of) freely use ports above 1024. IPv6 does not change that. If you need 100k simultanious connections, you need (at least) two machines. – Lieven Keersmaekers May 14 '20 at 14:16
  • thanks, seems like exactly the issue, but somehow i was able to use just half of that amount – Dev93 May 14 '20 at 14:35
  • 1
    @Dev93 - Yes and that doesn't match with how I interpreted things. I would have assumed you could only use 16k ports. Doing a netstat on your server should at least tell you the port rang being used. I'm curious ;). [This](https://learn.microsoft.com/en-us/windows/client-management/troubleshoot-tcpip-port-exhaust) is also a good read – Lieven Keersmaekers May 14 '20 at 14:51

0 Answers0