2 million connections in Phoenix, but default number of live processes is 262144

Hi!

It’s just a silly question, actually, but one I couldn’t reason my way out from documentation/code searching.

Everyone has heard of the road to 2 million websocket connections in Phoenix, which is awesome, I love that post.

But a question I have is: how is this possible, given that the maximum number of live processes in the EVM is 262144 by default?

My current understanding is that Channels are multiplexed onto Socket connections, so each websocket connection corresponds to a live Erlang process. So, in production, I would have to tune the number of live processes to a number much higher than the default.

Was this limit raised in production for this example? That would make sense, but it isn’t mentioned in the blog post.

1 Like

Yes :slight_smile:. Whether you should raise that limit in your production environment depends on how many anticipate.

3 Likes

Oh cool, thanks for the quick reply Ben :slight_smile: that makes perfect sense. I would also point out to not blindly do this, as it could mask a process leak in an application.

1 Like

That is exactly correct, and it’s why things like the process limit or atom limit are generally set pretty conservatively. Sounds like you’re on top of the trade offs!

4 Likes