Bird
0
0

Given a Node.js app using a cluster with 2 workers and a reverse proxy in front, what happens if one worker crashes?

medium📝 component behavior Q4 of 15
Node.js - Cluster Module
Given a Node.js app using a cluster with 2 workers and a reverse proxy in front, what happens if one worker crashes?
AThe cluster master automatically restarts the crashed worker.
BThe reverse proxy stops routing requests to the entire app.
CAll workers shut down and the app crashes.
DThe crashed worker is ignored and not restarted.
Step-by-Step Solution
Solution:
  1. Step 1: Understand cluster fault tolerance

    The cluster master process monitors workers and restarts any that crash to keep the app running.
  2. Step 2: Understand reverse proxy role

    The reverse proxy continues routing requests to available workers; it does not stop the entire app.
  3. Final Answer:

    The cluster master automatically restarts the crashed worker. -> Option A
  4. Quick Check:

    Cluster crash handling = D [OK]
Quick Trick: Cluster master restarts crashed workers automatically [OK]
Common Mistakes:
  • Thinking reverse proxy stops all traffic
  • Assuming app crashes on one worker failure
  • Believing crashed workers are ignored

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes