0

I'm in a situation where I've got a TCP server and a websocket client, and I'm using websocat as a bridge between them. Everything works great until I get to about 60 concurrent connections, and then things seem to get dropped randomly. The error message websocat: Transport endpoint is not connected (os error 107) shows up. The server gives an error about Broken pipe errno=32.

What resource could be running out to cause this?

I've confirmed that

  • The problem doesn't happen if the connections are spaced out instead of concurrent
  • The problem doesn't happen if I connect directly to the server as TCP instead of through the bridge

The websocat command I'm running is:

websocat   -k -B 1024000 -E --binary wss-l:127.0.0.1:7878 --pkcs12-der=./output.pkcs12 ssl-connect:tcp:127.0.0.1:7979

I don't think the problem is file descriptors, since ulimit -n gives 65535. But could there be another socket or network-related limit that's being maxed out, or some kind of resource that's leaking from websocat, or leaking from my server because websocat isn't closing something properly?

Adding -vv to websocat gives a ton of output, but I don't know what I'm looking for in it.

The server is a Raspberry Pi 5 with raspberry pi OS (debian based), and it doesn't look to be a CPU or Memory issue. Other than increasing the file descriptor limit I haven't change the basic settings much.

0 Answers0