Why do Reverse Proxies (Nginx) often enable 'Proxy Buffering' when sitting in front of Application Servers (Node/Python)?
- A To utilize specialized, kernel-mode modules that can dynamically execute and optimize raw PHP or Python scripts before the resulting data is transmitted to the client.
- B To protect high-cost application threads from 'Slow Clients'; Nginx reads the full response from the app quickly and kemudian trickles it to the slow client at its own pace.
- C To proactively apply advanced lossy and lossless compression algorithms to all outgoing image and video assets to ensure the maximum possible physical bandwidth efficiency.
- D To ensure that every individual application-layer response is cached within the proxy's local high-speed persistent storage for an indefinite period of time.
Imagine a Python web server that has only 10 worker threads. If a user on a very slow mobile connection starts a download, that thread is 'stuck' waiting for the user to read the data, which might take minutes. If 10 slow users connect, your entire multi-million dollar app is 'down' because all its threads are busy doing nothing. Nginx is 'event-driven' and doesn't use threads like this. With buffering enabled, Nginx sucks the data out of the Python app in milliseconds (freeing the thread to help the next user) and then handles the slow trickle to the client itself. This 'buffer' acts as a shield, protecting your delicate application logic from the messy reality of the slow internet.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What is the downside of enabling 'Sticky Sessions' (Session Affinity) on a Load Balancer?
- In WebRTC (P2P Mesh), why is a STUN server required?
- What is the fundamental difference between a Network Switch and a Router?
- In Cloud Networking (AWS), what is the limitation of VPC Peering compared to a Transit Gateway?
- Which protocol is ideal for real-time multiplayer gaming positions or Voice over IP (VoIP), and why?
- What is the purpose of the 'Time To Live' (TTL) field in an IP packet?