3

Nginx: Protecting upstream from overload on cache miss

 2 years ago
source link: https://blog.jakubholy.net/2015/10/01/nginx-protecting-upstream-from-overload-on-cache-miss/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Nginx: Protecting upstream from overload on cache miss

October 1, 2015
These 2 magical lines will protect your upstream server from possible overload of many users try to access the same in cached or expired content: 

proxy_cache_use_stale updating timeout; # Serve the cached version even when outdated while refreshing it proxy_cache_lock on; # Only one req is allowed to load/refresh the item, others wait / get the stale one 

You can verify this using Shopify's Toxiproxy. 

<3 Nginx

Are you benefitting from my writing? Consider buying me a coffee or supporting my work via GitHub Sponsors. Thank you! You can also book me for a mentoring / pair-programming session via Codementor or (cheaper) email.

Allow me to write to you!

Let's get in touch! I will occasionally send you a short email with a few links to interesting stuff I found and with summaries of my new blog posts. Max 1-2 emails per month. I read and answer to all replies.

Copyright © 2022 Jakub Holý
Powered by Cryogen
Theme by KingMob

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK