You want to improve your Node.js app's performance and reliability. You decide to use both a cluster and a reverse proxy. Which setup best achieves this goal?
hard📝 Application Q15 of 15
Node.js - Cluster Module
You want to improve your Node.js app's performance and reliability. You decide to use both a cluster and a reverse proxy. Which setup best achieves this goal?
AUse a cluster to run multiple workers on all CPU cores, and a reverse proxy to distribute incoming requests and handle SSL
BUse a reverse proxy to create worker processes, and a cluster to forward requests to other servers
CUse a cluster to cache static files, and a reverse proxy to manage CPU usage
DUse a reverse proxy to run multiple Node.js instances, and a cluster to balance traffic
Step-by-Step Solution
Solution:
Step 1: Identify cluster's role in performance
Clusters run multiple worker processes to use all CPU cores, improving performance and reliability.
Step 2: Identify reverse proxy's role in traffic and security
Only Use a cluster to run multiple workers on all CPU cores, and a reverse proxy to distribute incoming requests and handle SSL correctly assigns cluster to CPU usage and reverse proxy to traffic distribution and SSL.
Final Answer:
Use a cluster to run multiple workers on all CPU cores, and a reverse proxy to distribute incoming requests and handle SSL -> Option A