3 ms·
I’ve been trying out many reverse proxies for stateful, low-traffic websocket connections, but unfortunately they all eat so much ram. Even nginx, with tuning,
by klabb3 4y ago
I’ve been trying out many reverse proxies for stateful, low-traffic websocket connections, but unfortunately they all eat so much ram. Even nginx, with tuning, use at least 10x ram/conn of a well tuned naked uWebSocket deployment with TLS.
Traefik was much more ram hungry than nginx, and iirc Caddy as well (at least 2 goroutines per conn). It’s probably fine (and worth it) for the vast majority of request-response web apps, but all of these extra layers have a cost. And that’s still nothing compared to the overhead of say k8s with all bells and whistles.
Anyway, as someone who’s been out of the loop on backend for many years, I am quite shocked at the level of resource waste, even among the projects with a strong reputation. You always hear the complaints about frontend bloat, but these days backend seem to have caught up.
- hardwaresofton 4y agoYeah I’m personally of the opinion that the performance loss for regular web services is worth it 99% of the time. RAM is cheap, human time is not. That said I definitely believe your characterization of resource hunger between nginx and traefik. You are the second person to mention using websockets for requests in as many days… How do you deal with scale out? Sticky cookie routing seems like almost a requirement if you don’t want to deploy a redis-alike. Also just out of curiosity, do you use hyper-express[0]? [0]: https://github.com/kartikk221/hyper-express https://github.com/kartikk221/hyper-express