0
0
Nginxdevops~20 mins

Why load balancing distributes traffic in Nginx - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Load Balancer Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does NGINX load balancing distribute traffic?

NGINX can distribute incoming web traffic to multiple backend servers. What is the main reason it does this?

ATo share the workload evenly among servers and improve response time
BTo block some users from accessing the website
CTo store user data on the load balancer itself
DTo increase the size of the website files
Attempts:
2 left
💡 Hint

Think about why spreading work helps a busy restaurant kitchen.

💻 Command Output
intermediate
2:00remaining
What is the effect of this NGINX load balancing config?

Given this NGINX config snippet, what will happen when users access the site?

Nginx
upstream backend {
    server backend1.example.com;
    server backend2.example.com;
}

server {
    listen 80;
    location / {
        proxy_pass http://backend;
    }
}
AAll requests will go only to backend1 server
BNGINX will serve the content directly without contacting backend servers
CRequests will be sent alternately to backend1 and backend2 servers
DRequests will be blocked by NGINX
Attempts:
2 left
💡 Hint

Look at how multiple servers are listed under upstream.

Troubleshoot
advanced
2:00remaining
Why does NGINX send all traffic to one backend despite multiple servers configured?

NGINX is configured with two backend servers in the upstream block, but all traffic goes to only one server. What is a likely cause?

AThe backend servers are down, so NGINX sends traffic to the first server only
BThe <code>ip_hash</code> directive is enabled, causing sticky sessions to one server
CNGINX does not support multiple backend servers
DThe <code>proxy_pass</code> directive is missing in the config
Attempts:
2 left
💡 Hint

Sticky sessions keep users connected to the same server.

🔀 Workflow
advanced
2:00remaining
Order the steps NGINX takes to distribute traffic using load balancing

Put these steps in the correct order for how NGINX handles incoming requests with load balancing.

A1,2,4,3
B2,1,3,4
C1,3,2,4
D1,2,3,4
Attempts:
2 left
💡 Hint

Think about the natural flow from receiving to responding.

Best Practice
expert
2:00remaining
Which NGINX load balancing method best avoids overloading a slow backend?

NGINX supports several load balancing methods. Which method helps avoid sending too many requests to a slow backend server?

Aleast_conn - sends requests to the server with the fewest active connections
Bround_robin - sends requests evenly in order to all servers
Cip_hash - sends requests from the same client IP to the same server
Drandom - sends requests randomly to any server
Attempts:
2 left
💡 Hint

Think about which method balances load based on current server usage.