Bird
0
0

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:
  1. Step 1: Identify cluster's role in performance

    Clusters run multiple worker processes to use all CPU cores, improving performance and reliability.
  2. Step 2: Identify reverse proxy's role in traffic and security

    Reverse proxies distribute incoming requests, handle SSL termination, and add security features.
  3. Step 3: Evaluate options

    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.
  4. 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
  5. Quick Check:

    Cluster = CPU workers, Reverse proxy = traffic & SSL [OK]
Quick Trick: Cluster for CPU workers, reverse proxy for traffic & SSL [OK]
Common Mistakes:
  • Assigning reverse proxy to create workers
  • Confusing caching with cluster role
  • Swapping roles of cluster and reverse proxy

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes