Solved WebSocket and kernel.ipc.somaxconn

We are developing an application that will make heavy use of WebSocket. Every user will have a continuous websocket connection to the server as long as they browse the website.

My understanding is that when serving regular static web pages, even a low kernel.ipc.somaxconn is not that much of an issue since the connection is closed within milliseconds once the content is served. However WebSocket connections are said to be permanent so I wonder what the implications are in terms of tuning kernel.ipc.somaxconn. Especially since apparently, the max value of somaxconn is about 65k which would limit the scalability of our application on a single server. So my specific questions are:
  1. Will a WebSocket connection indeed use a somaxconn-related connection, or will the connections somehow be pooled?
  2. Is there a way to increase the max value of somaxconn without building a custom kernel? (I heard that WhatsApp managed to set it to 2 million but it looks like they built a custom kernel)
  3. And as an aside, is there a risk of crashing the OS at boot time if somaxconn is set to a value being too high? (this warning is made for some settings in the tuning man page).
Any insight would be greatly appreciated!
 
somaxconn is the queue depth liked passed to listen(2) not the number of connected sockets
Oh this is insightful thanks! So which kernel setting would I need to tune to see and increase the max number of sockets that the server can handle?
 
Back
Top