I’m working on a stress test script that creates WebSockets.
I don’t know why, but the creation of the web sockets breaks after around 7,600 calls to this function.
If I run the script in a docker container, I can accumulate the number of web sockets created up to 90 000, so it seems to be a host-related issue.
Regarding the resources, it’s working pretty well on each docker instance, so I’m thinking about a configuration of the compiler but I don’t know much about the capabilities yet (I’m currently digging into it)
I know that the maximum number of web socket creations is limited by the number of ports available (client-side) but I’m far from this limit it should be around 64,500.
I’ve ran pprof to get insight into some numbers maybe to correlate with some compiler values. This are the numbers for 7,500 connections (just before it breaks):
FROM golang:1.21-alpine3.17 AS builder
...
FROM scratch AS final
...
ENTRYPOINT ["/app/bin/stress-test"]
I just changed the Dockerfile so the image is based on the Golang/Alpine image: FROM golang:1.21-alpine3.17 AS final
$ ulimit -n
30000
Now it is working, I just have this tls handshake error, but it’s happening randomly after 18 000 to 22 000 connections despite this TLSConfig that is set to ignore some security verifications … but it’s another story.
tls: handshake message of length 2243106 bytes exceeds maximum of 65536 bytes