Real Time Updates medium
A single Linux server crashes after accepting exactly 1024 WebSocket connections, despite having plenty of RAM. What is the most likely limit hit?
- A Bandwidth saturation.
- B CPU overheating.
- C Database connection limit.
- D The 'Open File Descriptors' (ulimit) limit, as Linux treats every socket as a file.
Answer: D. The 'Open File Descriptors' (ulimit) limit, as Linux treats every socket as a file.
Everything in Unix is a file. The default limit for open files is often 1024. For a C10K server, you must tune `ulimit -n` to allow thousands of concurrent sockets.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- When a mobile app is closed/backgrounded, it cannot keep a WebSocket open. How does it receive real-time alerts (like 'New Message')?
- For a human user, what is generally considered the maximum acceptable latency for an interaction to feel 'Real-Time' (e.g., typing in a Google Doc)?
- If you want to update a news feed on a website every time a new article is published, what is the simplest (but least efficient) 'Real-Time' technique?
- In a persistent real-time connection, what is the purpose of a 'Heartbeat' or 'Ping/Pong' message?
- Why is Short Polling considered 'Chatty'?
- Server-Sent Events (SSE) are ideal for which type of real-time application?