Node.js - Cluster ModuleGiven 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.Check Answer
Step-by-Step SolutionSolution:Step 1: Understand cluster fault toleranceThe cluster master process monitors workers and restarts any that crash to keep the app running.Step 2: Understand reverse proxy roleThe reverse proxy continues routing requests to available workers; it does not stop the entire app.Final Answer:The cluster master automatically restarts the crashed worker. -> Option AQuick Check:Cluster crash handling = D [OK]Quick Trick: Cluster master restarts crashed workers automatically [OK]Common Mistakes:Thinking reverse proxy stops all trafficAssuming app crashes on one worker failureBelieving crashed workers are ignored
Master "Cluster Module" in Node.js9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallPerf
More Node.js Quizzes Debugging and Profiling - Heap snapshot for memory leaks - Quiz 12easy Debugging and Profiling - Debugging with VS Code - Quiz 3easy Debugging and Profiling - Console methods beyond log - Quiz 6medium Error Handling Patterns - Graceful shutdown on errors - Quiz 8hard Error Handling Patterns - Error-first callback convention - Quiz 5medium Error Handling Patterns - Graceful shutdown on errors - Quiz 1easy Timers and Scheduling - setImmediate vs process.nextTick - Quiz 5medium Timers and Scheduling - setImmediate vs process.nextTick - Quiz 9hard Worker Threads - Worker pool pattern - Quiz 7medium Worker Threads - When to use workers vs cluster - Quiz 4medium