Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Nginx Troubleshooting

You're reading from   Nginx Troubleshooting Investigate and solve problems with Nginx-powered websites using a deep understanding of the underlying principles

Arrow left icon
Product type Paperback
Published in Apr 2016
Publisher
ISBN-13 9781785288654
Length 172 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Alexey Kapranov Alexey Kapranov
Author Profile Icon Alexey Kapranov
Alexey Kapranov
Arrow right icon
View More author details
Toc

Solving the problem of an idle upstream


We devoted a great deal of content to the concept of upstreams. Just to remind you, upstreams are entities that generate HTTP responses that Nginx sends to the clients. Usually, an upstream contains several (or at least one) servers speaking one of the supported protocols, such as FastCGI or plain HTTP. Nginx uses sophisticated client code to very efficiently proxy the communication between the clients and the upstream in a transparent way by also optimizing the number of idle connections and wasted memory. There are a number of algorithms that Nginx uses to balance the client load on all the members of an upstream block, and one of those algorithms is known to bite the unsuspecting web administrators.

The configuration under discussion looks like this:

proxy_pass http://backend;

upstream backend {
    server server1.example.com;
    server server2.example.com;
    server server3.example.com;
    ip_hash;
}

The first line sets up the handling of some...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images