SlideShare a Scribd company logo
NginxNginx
your load balancer & cacheyour load balancer & cache
MarianMarian HackManHackMan Marinov <mm@1h.com>Marinov <mm@1h.com>
CEO of 1H Ltd.CEO of 1H Ltd.
Why load balance with Nginx?Why load balance with Nginx?
Why load balance with Nginx?Why load balance with Nginx?
Why not do it with other tools?Why not do it with other tools?
➢ Balancing with iptablesBalancing with iptables
➢ Balancing with iproute2Balancing with iproute2
➢ LinuxVserverLinuxVserver
➢ HAproxyHAproxy
➢ VarnishVarnish
➢ even Apache can do iteven Apache can do it
with mod_proxy_balancerwith mod_proxy_balancer
sample.comsample.com
IN A 10.0.0.1IN A 10.0.0.1
IN A 10.0.0.2IN A 10.0.0.2
10.0.0.110.0.0.1 10.0.0.210.0.0.2
DNS balancingDNS balancing
sample.comsample.com
IN A 10.0.0.1IN A 10.0.0.1
IN A 10.0.0.2IN A 10.0.0.2
10.0.0.110.0.0.1 10.0.0.210.0.0.2
10.0.0.110.0.0.1
Fault ToleranceFault Tolerance
High AvailabilityHigh Availability
➢Always have at least two LB nodesAlways have at least two LB nodes
➢Use DNS balancingUse DNS balancing
(two A/AAAA) records(two A/AAAA) records
➢Use vrrpd or keepalivedUse vrrpd or keepalived
for floating IPs (on layer 2)for floating IPs (on layer 2)
➢In more complex network setupsIn more complex network setups
Corosync + PacemakerCorosync + Pacemaker
Make sure your infrastructureMake sure your infrastructure
can handle a single LB failurecan handle a single LB failure
(has enough resources CPU, Bandwidth)(has enough resources CPU, Bandwidth)
Load balancing with NginxLoad balancing with Nginx
Load balancing with NginxLoad balancing with Nginx
➢ upstreamupstream
➢ scgi/uwsgi/fastcgi/memcachedscgi/uwsgi/fastcgi/memcached
➢_pass (using upstream)_pass (using upstream)
➢_next_server_next_server
➢ upstream_conf (commercial)upstream_conf (commercial)
➢ Your own monitoringYour own monitoring
Load balancing with NginxLoad balancing with Nginx
synopsis:synopsis:
server IP [options];server IP [options];
upstream static_backend {upstream static_backend {
server 10.0.0.1 fail_timeout=5s max_fails=1;server 10.0.0.1 fail_timeout=5s max_fails=1;
server 10.0.0.2 fail_timeout=5s max_fails=1;server 10.0.0.2 fail_timeout=5s max_fails=1;
keepalive 512;keepalive 512;
}}
Load balancing with NginxLoad balancing with Nginx
weight=numberweight=number
max_fails=numbermax_fails=number
fail_timeout=timefail_timeout=time
backupbackup
downdown
max_conns=numbermax_conns=number
resolveresolve
slow_start=timeslow_start=time
Load balancing with NginxLoad balancing with Nginx
Request distribution methodRequest distribution method
➢ round-robin (default)round-robin (default)
➢ ip_haship_hash
➢ hashhash
➢ least_connleast_conn
➢ least_timeleast_time header/bytesheader/bytes
Load balancing with NginxLoad balancing with Nginx
keepalivekeepalive
health_check [parameters]health_check [parameters]
match namematch name
queue number [timeout=time]queue number [timeout=time]
sticky cookie namesticky cookie name
Load balancing with NginxLoad balancing with Nginx
health_check interval=1 uri=/health;health_check interval=1 uri=/health;
# status ok and not in maintenance mode# status ok and not in maintenance mode
match server_ok {match server_ok {
status 200-399;status 200-399;
body !~ "maintenance mode";body !~ "maintenance mode";
}}
Caching in NginxCaching in Nginx
➢ Why not cache the static content?Why not cache the static content?
➢ Limited ESI support troughLimited ESI support trough
ngx_http_ssi and ngx_esingx_http_ssi and ngx_esi
➢ Handle traffic extremesHandle traffic extremes
withwith stale cachingstale caching
➢ Reduce response timesReduce response times
If there are people willing to extend ngx_esiIf there are people willing to extend ngx_esi
I would join forces with them!I would join forces with them!
Caching in NginxCaching in Nginx
proxy_cache_path /var/lib/nginx/cacheproxy_cache_path /var/lib/nginx/cache
levels=1:2 keys_zone=WP:1024mlevels=1:2 keys_zone=WP:1024m
max_size=2048m;max_size=2048m;
proxy_cache_keyproxy_cache_key
"$host$request_uri $cookie_user";"$host$request_uri $cookie_user";
proxy_cache_valid 200 301 302 2s;proxy_cache_valid 200 301 302 2s;
proxy_cache_use_staleproxy_cache_use_stale
error timeout invalid_header updating;error timeout invalid_header updating;
expires 60s;expires 60s;
?/? Questions ?/??/? Questions ?/?
MarianMarian HackManHackMan MarinovMarinov
<mm@1h.com><mm@1h.com>
CEO of 1H Ltd.CEO of 1H Ltd.
Thank Youuuuuu!!!Thank Youuuuuu!!!

More Related Content

What's hot

websphere commerce server admin configuration
websphere commerce server admin configuration websphere commerce server admin configuration
websphere commerce server admin configuration
Laxmi Kanth Kshatriya
 

What's hot (20)

NGINX High-performance Caching
NGINX High-performance CachingNGINX High-performance Caching
NGINX High-performance Caching
 
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse ProxyNginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
 
Nginx
NginxNginx
Nginx
 
Low Code Integration with Apache Camel.pdf
Low Code Integration with Apache Camel.pdfLow Code Integration with Apache Camel.pdf
Low Code Integration with Apache Camel.pdf
 
NGINX: Basics and Best Practices EMEA
NGINX: Basics and Best Practices EMEANGINX: Basics and Best Practices EMEA
NGINX: Basics and Best Practices EMEA
 
Apache Traffic Server
Apache Traffic ServerApache Traffic Server
Apache Traffic Server
 
스프링 부트와 로깅
스프링 부트와 로깅스프링 부트와 로깅
스프링 부트와 로깅
 
NGINX: Basics and Best Practices
NGINX: Basics and Best PracticesNGINX: Basics and Best Practices
NGINX: Basics and Best Practices
 
Learn nginx in 90mins
Learn nginx in 90minsLearn nginx in 90mins
Learn nginx in 90mins
 
Pushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack UpPushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack Up
 
Using eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in CiliumUsing eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in Cilium
 
Cloud Native Java GraalVM 이상과 현실
Cloud Native Java GraalVM 이상과 현실Cloud Native Java GraalVM 이상과 현실
Cloud Native Java GraalVM 이상과 현실
 
Fast Userspace OVS with AF_XDP, OVS CONF 2018
Fast Userspace OVS with AF_XDP, OVS CONF 2018Fast Userspace OVS with AF_XDP, OVS CONF 2018
Fast Userspace OVS with AF_XDP, OVS CONF 2018
 
OverlayFS as a Docker Storage Driver
OverlayFS as a Docker Storage DriverOverlayFS as a Docker Storage Driver
OverlayFS as a Docker Storage Driver
 
Jenkins-CI
Jenkins-CIJenkins-CI
Jenkins-CI
 
Hazelcast Essentials
Hazelcast EssentialsHazelcast Essentials
Hazelcast Essentials
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and Tuning
 
websphere commerce server admin configuration
websphere commerce server admin configuration websphere commerce server admin configuration
websphere commerce server admin configuration
 
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
 

Viewers also liked

What's New in NGINX Plus R10?
What's New in NGINX Plus R10?What's New in NGINX Plus R10?
What's New in NGINX Plus R10?
NGINX, Inc.
 
Load Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINXLoad Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINX
NGINX, Inc.
 

Viewers also liked (8)

NGiNX, o motor da sua aplicação web
NGiNX, o motor da sua aplicação webNGiNX, o motor da sua aplicação web
NGiNX, o motor da sua aplicação web
 
Liliana rivas gonzalez_actividad1_mapa_c
Liliana rivas gonzalez_actividad1_mapa_cLiliana rivas gonzalez_actividad1_mapa_c
Liliana rivas gonzalez_actividad1_mapa_c
 
Nginx
NginxNginx
Nginx
 
What's New in NGINX Plus R10?
What's New in NGINX Plus R10?What's New in NGINX Plus R10?
What's New in NGINX Plus R10?
 
The 3 Models in the NGINX Microservices Reference Architecture
The 3 Models in the NGINX Microservices Reference ArchitectureThe 3 Models in the NGINX Microservices Reference Architecture
The 3 Models in the NGINX Microservices Reference Architecture
 
Load Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINXLoad Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINX
 
Extending functionality in nginx, with modules!
Extending functionality in nginx, with modules!Extending functionality in nginx, with modules!
Extending functionality in nginx, with modules!
 
Nginx Internals
Nginx InternalsNginx Internals
Nginx Internals
 

Similar to Load Balancing with Nginx

ByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalivedByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalived
redhat9
 
Free enterpriseloadbalancer
Free enterpriseloadbalancerFree enterpriseloadbalancer
Free enterpriseloadbalancer
mikesoule
 

Similar to Load Balancing with Nginx (20)

Wckansai 2014
Wckansai 2014Wckansai 2014
Wckansai 2014
 
NSClient Workshop: 04 Protocols
NSClient Workshop: 04 ProtocolsNSClient Workshop: 04 Protocols
NSClient Workshop: 04 Protocols
 
20110701 zsc2011-advanced proxying-formatted
20110701 zsc2011-advanced proxying-formatted20110701 zsc2011-advanced proxying-formatted
20110701 zsc2011-advanced proxying-formatted
 
How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7How To Configure Nginx Load Balancer on CentOS 7
How To Configure Nginx Load Balancer on CentOS 7
 
Php assíncrono com_react_php
Php assíncrono com_react_phpPhp assíncrono com_react_php
Php assíncrono com_react_php
 
ByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalivedByPat博客出品Lvs+keepalived
ByPat博客出品Lvs+keepalived
 
HAProxy scale out using open source
HAProxy scale out using open sourceHAProxy scale out using open source
HAProxy scale out using open source
 
Load Balancing MySQL with HAProxy - Slides
Load Balancing MySQL with HAProxy - SlidesLoad Balancing MySQL with HAProxy - Slides
Load Balancing MySQL with HAProxy - Slides
 
How To Set Up SQL Load Balancing with HAProxy - Slides
How To Set Up SQL Load Balancing with HAProxy - SlidesHow To Set Up SQL Load Balancing with HAProxy - Slides
How To Set Up SQL Load Balancing with HAProxy - Slides
 
Dev ops for developers
Dev ops for developersDev ops for developers
Dev ops for developers
 
Django and Nginx reverse proxy cache
Django and Nginx reverse proxy cacheDjango and Nginx reverse proxy cache
Django and Nginx reverse proxy cache
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
DevOps for Developers
DevOps for DevelopersDevOps for Developers
DevOps for Developers
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
Migrating to a Bazel-based CI System: 6 Learnings - Or Shachar
Migrating to a Bazel-based CI System: 6 Learnings - Or ShacharMigrating to a Bazel-based CI System: 6 Learnings - Or Shachar
Migrating to a Bazel-based CI System: 6 Learnings - Or Shachar
 
Free enterpriseloadbalancer
Free enterpriseloadbalancerFree enterpriseloadbalancer
Free enterpriseloadbalancer
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
Nginx
NginxNginx
Nginx
 
PostgreSQL Query Cache - "pqc"
PostgreSQL Query Cache - "pqc"PostgreSQL Query Cache - "pqc"
PostgreSQL Query Cache - "pqc"
 
Resin Outperforms NginX
Resin Outperforms NginXResin Outperforms NginX
Resin Outperforms NginX
 

More from Marian Marinov

More from Marian Marinov (20)

How to implement PassKeys in your application
How to implement PassKeys in your applicationHow to implement PassKeys in your application
How to implement PassKeys in your application
 
Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & Logging
 
Basic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsBasic presentation of cryptography mechanisms
Basic presentation of cryptography mechanisms
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?
 
Introduction and replication to DragonflyDB
Introduction and replication to DragonflyDBIntroduction and replication to DragonflyDB
Introduction and replication to DragonflyDB
 
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMessage Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
 
How to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfHow to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdf
 
How to survive in the work from home era
How to survive in the work from home eraHow to survive in the work from home era
How to survive in the work from home era
 
Managing sysadmins
Managing sysadminsManaging sysadmins
Managing sysadmins
 
Improve your storage with bcachefs
Improve your storage with bcachefsImprove your storage with bcachefs
Improve your storage with bcachefs
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storage
 
Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?
 
Securing your MySQL server
Securing your MySQL serverSecuring your MySQL server
Securing your MySQL server
 
Sysadmin vs. dev ops
Sysadmin vs. dev opsSysadmin vs. dev ops
Sysadmin vs. dev ops
 
DoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKDoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDK
 
Challenges with high density networks
Challenges with high density networksChallenges with high density networks
Challenges with high density networks
 
SiteGround building automation
SiteGround building automationSiteGround building automation
SiteGround building automation
 
Preventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingPreventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel tracking
 
Managing a lot of servers
Managing a lot of serversManaging a lot of servers
Managing a lot of servers
 

Recently uploaded

Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
abhinandnam9997
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
aagad
 

Recently uploaded (12)

The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case Study
 
Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
 
How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?
 
The Best AI Powered Software - Intellivid AI Studio
The Best AI Powered Software - Intellivid AI StudioThe Best AI Powered Software - Intellivid AI Studio
The Best AI Powered Software - Intellivid AI Studio
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdf
 
The AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdfThe AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdf
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 

Load Balancing with Nginx

  • 1. NginxNginx your load balancer & cacheyour load balancer & cache MarianMarian HackManHackMan Marinov <mm@1h.com>Marinov <mm@1h.com> CEO of 1H Ltd.CEO of 1H Ltd.
  • 2. Why load balance with Nginx?Why load balance with Nginx?
  • 3. Why load balance with Nginx?Why load balance with Nginx? Why not do it with other tools?Why not do it with other tools?
  • 4. ➢ Balancing with iptablesBalancing with iptables ➢ Balancing with iproute2Balancing with iproute2 ➢ LinuxVserverLinuxVserver ➢ HAproxyHAproxy ➢ VarnishVarnish ➢ even Apache can do iteven Apache can do it with mod_proxy_balancerwith mod_proxy_balancer
  • 5. sample.comsample.com IN A 10.0.0.1IN A 10.0.0.1 IN A 10.0.0.2IN A 10.0.0.2 10.0.0.110.0.0.1 10.0.0.210.0.0.2 DNS balancingDNS balancing
  • 6. sample.comsample.com IN A 10.0.0.1IN A 10.0.0.1 IN A 10.0.0.2IN A 10.0.0.2 10.0.0.110.0.0.1 10.0.0.210.0.0.2 10.0.0.110.0.0.1 Fault ToleranceFault Tolerance High AvailabilityHigh Availability
  • 7. ➢Always have at least two LB nodesAlways have at least two LB nodes ➢Use DNS balancingUse DNS balancing (two A/AAAA) records(two A/AAAA) records ➢Use vrrpd or keepalivedUse vrrpd or keepalived for floating IPs (on layer 2)for floating IPs (on layer 2) ➢In more complex network setupsIn more complex network setups Corosync + PacemakerCorosync + Pacemaker Make sure your infrastructureMake sure your infrastructure can handle a single LB failurecan handle a single LB failure (has enough resources CPU, Bandwidth)(has enough resources CPU, Bandwidth)
  • 8. Load balancing with NginxLoad balancing with Nginx
  • 9. Load balancing with NginxLoad balancing with Nginx ➢ upstreamupstream ➢ scgi/uwsgi/fastcgi/memcachedscgi/uwsgi/fastcgi/memcached ➢_pass (using upstream)_pass (using upstream) ➢_next_server_next_server ➢ upstream_conf (commercial)upstream_conf (commercial) ➢ Your own monitoringYour own monitoring
  • 10. Load balancing with NginxLoad balancing with Nginx synopsis:synopsis: server IP [options];server IP [options]; upstream static_backend {upstream static_backend { server 10.0.0.1 fail_timeout=5s max_fails=1;server 10.0.0.1 fail_timeout=5s max_fails=1; server 10.0.0.2 fail_timeout=5s max_fails=1;server 10.0.0.2 fail_timeout=5s max_fails=1; keepalive 512;keepalive 512; }}
  • 11. Load balancing with NginxLoad balancing with Nginx weight=numberweight=number max_fails=numbermax_fails=number fail_timeout=timefail_timeout=time backupbackup downdown max_conns=numbermax_conns=number resolveresolve slow_start=timeslow_start=time
  • 12. Load balancing with NginxLoad balancing with Nginx Request distribution methodRequest distribution method ➢ round-robin (default)round-robin (default) ➢ ip_haship_hash ➢ hashhash ➢ least_connleast_conn ➢ least_timeleast_time header/bytesheader/bytes
  • 13. Load balancing with NginxLoad balancing with Nginx keepalivekeepalive health_check [parameters]health_check [parameters] match namematch name queue number [timeout=time]queue number [timeout=time] sticky cookie namesticky cookie name
  • 14. Load balancing with NginxLoad balancing with Nginx health_check interval=1 uri=/health;health_check interval=1 uri=/health; # status ok and not in maintenance mode# status ok and not in maintenance mode match server_ok {match server_ok { status 200-399;status 200-399; body !~ "maintenance mode";body !~ "maintenance mode"; }}
  • 15. Caching in NginxCaching in Nginx ➢ Why not cache the static content?Why not cache the static content? ➢ Limited ESI support troughLimited ESI support trough ngx_http_ssi and ngx_esingx_http_ssi and ngx_esi ➢ Handle traffic extremesHandle traffic extremes withwith stale cachingstale caching ➢ Reduce response timesReduce response times If there are people willing to extend ngx_esiIf there are people willing to extend ngx_esi I would join forces with them!I would join forces with them!
  • 16. Caching in NginxCaching in Nginx proxy_cache_path /var/lib/nginx/cacheproxy_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=WP:1024mlevels=1:2 keys_zone=WP:1024m max_size=2048m;max_size=2048m; proxy_cache_keyproxy_cache_key "$host$request_uri $cookie_user";"$host$request_uri $cookie_user"; proxy_cache_valid 200 301 302 2s;proxy_cache_valid 200 301 302 2s; proxy_cache_use_staleproxy_cache_use_stale error timeout invalid_header updating;error timeout invalid_header updating; expires 60s;expires 60s;
  • 17. ?/? Questions ?/??/? Questions ?/? MarianMarian HackManHackMan MarinovMarinov <mm@1h.com><mm@1h.com> CEO of 1H Ltd.CEO of 1H Ltd.