SlideShare a Scribd company logo
NGINX
HEALTH CHECKS
NGINX LIVE EP.5
SUPACHAI JATURAPROM (TUM)
AUG 2020
NGINX USER GROUP: THAILAND CHAPTER
WWW.MEETUP.COM/TH-TH/NGINX-THAILAND
NGINX
HEALTH CHECKS
AGENDA
Why ? Health Checks
TCP Health Checks
HTTP Health Checks
UDP Health Checks
Active Health Checks
Passive Health Checks
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
WHY ? HEALTH CHECKS (1)
Client 1
Load Balance
Host 1
Host 2
Host 3
Client 2
Client 3
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
WHY ? HEALTH CHECKS (2)
Client 1
Load Balance
Host 1
Host 2
Host 3
Client 2
Client 3
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
WHY ? HEALTH CHECKS (3)
Client 1
Load Balance
Host 1
Host 2
Host 3
Client 2
Client 3
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
WHY ? HEALTH CHECKS (4)
Client 1
Load Balance
Host 1
Host 2
Host 3
Client 2
Client 3
Health checks
Health checks
Health checks
Data Traffic
Data Traffic
Data Traffic
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
WHY ? HEALTH CHECKS (5)
Load Balance
Client 1 Host 1
Host 2
Host 3
Client 2
Client 3
Health checks
Health checks
Health checks
Data Traffic
Data Traffic
Data Traffic
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
WHY ? HEALTH CHECKS (6)
Client 1
Load Balance
Host 1
Host 2Client 2
Client 3
Health checks
Health checks
Health checks
Host 3
Data Traffic
Data Traffic
Data Traffic
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
WHY ? HEALTH CHECKS (7)
Client 1
Load Balance
Host 1
Host 2
Host 3
Client 2
Client 3
Health checks
Health checks
Health checks
Data Traffic
Data Traffic
Data Traffic
healthy
healthy
healthy
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
Load Balance
Host 1
Host 2
Host 3
Client 1
Health checks
Health checks
Health checks
Data Traffic
ACTIVE HEALTH CHECK
GET / Return 200 OK
healthy
healthy
healthy
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
Load Balance
Host 1
Host 2
Host 3
Client 1
Data Traffic
PASSIVE HEALTH CHECK
500 Error
หรือ Timeout
Client 2
Data Traffic
unhealthy
healthy
healthy
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
HTTPS HEALTH CHECKS (1)
upstream backend {
server backend1.example.com;
server backend2.example.com;
}
server {
location / {
proxy_pass http://backend;
health_check;
}
}
by default, every five seconds
a request for “/” to each server in
the backend group.
If any communication error or
timeout occurs (outside 200-399)
the health check fails.
The server is marked as unhealthy.
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
HTTPS HEALTH CHECKS (2)
server {
location / {
proxy_pass http://backend;
health_check port=9999 interval=10 fails=3 passes=2
uri=/some/path;
}
} port = คือ การระบุ port number ทีใช้ health checks (default port server)
interval = คือ การระบุระยะเวลาในการทํา health checks (default 5s)
fails= คือ จํานวนการ fails ทีจะทําการ marking ว่า unhealthy (default 1)
passes= คือ จํานวนการ success ทีจะทําการ marking ว่า healthy (default 1)
uri= คือ การระบุ uri path (default path "/" )
http://backend1.exmaple.naja/i/love/nginx
marking unhealthy = 10x3 = 30 วินาที
marking healthy = 10x2 = 20 วินาที
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
HTTPS HEALTH CHECKS (3)
http {
...........
match server_ok {
status 200-399;
body !~ "maintenance mode";
}
server {
...........
location / {
proxy_pass http://backend;
health_check match=server_ok;
}
Here the health check is passed if
the status code of the response is
in the range 200–399, and its
body does not contain the string
"maintenance mode".
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
TCP HEALTH CHECKS (1)
stream {
#...
server {
listen 12345;
proxy_pass stream_backend;
health_check port=12346 interval=10 passes=2 fails=3;
health_check_timeout 5s;
}
}
** health_check_timeout directive is overrides proxy_timeout directive.
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
TCP HEALTH CHECKS (2)
stream {
#...
upstream stream_backend {
..........
}
match http {
send "GET / HTTP/1.0rnHost: localhostrnrn";
expect ~* "200 OK";
}
server {
listen 12345;
health_check match=http;
proxy_pass stream_backend;
}
send คือ text string หรือ hex (/x) ทีส่งออกไป
expect คือ Literal string หรือ regex ทีคาดหวังจะได้รับ
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
UDP HEALTH CHECKS (1)
stream {
#...
server {
listen 53 udp;
proxy_pass dns_upstream;
health_check interval=20 passes=2 fails=2 udp;
}
#...
}
** udp parameter specifies that the UDP protocol should be used
for health checks instead of the default TCP protocol.
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
UDP HEALTH CHECKS (2)
stream {
#...
match dns {
send x00x2ax00x00x00x01x00x00x00x00x00x00x03.....;
expect ~* "health.is.good";
}
server {
listen 53 udp;
proxy_pass dns_upstream;
health_check match=udp_test udp;
}
#...
}
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
SERVER SLOW-START
upstream backend {
server backend1.example.com slow_start=30s;
server backend2.example.com;
server 127.255.255.254 backup;
}
slow‑start allows an upstream server to gradually recover its weight from 0 to
its nominal value after it has been recovered or became available. by default is
0, that mean disable slow-start.
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
NGINX
HEALTH CHECKS
SUMMARY
Why ? Health Checks
Active Health Checks
Passive Health Checks
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand
NGINX Live EP.5
Supachai Jaturaprom (Tum)
THANKS YOUR
NGINX LIVE EP.5
SUPACHAI JATURAPROM (TUM)
NGINX User Group: Thailand Chapter
www.meetup.com/th-TH/NGINX-Thailand

More Related Content

Similar to NGINX Live EP.5 NGINX Health Checks Slide

Migrating to Prometheus: what we learned running it in production
Migrating to Prometheus: what we learned running it in productionMigrating to Prometheus: what we learned running it in production
Migrating to Prometheus: what we learned running it in production
Marco Pracucci
 
PPePR Overview Web2 Ireland
PPePR Overview Web2 IrelandPPePR Overview Web2 Ireland
PPePR Overview Web2 Ireland
Liam Ó Móráin
 
Creating Great REST and gRPC API Experiences (in Swift)
Creating Great REST and gRPC API Experiences (in Swift)Creating Great REST and gRPC API Experiences (in Swift)
Creating Great REST and gRPC API Experiences (in Swift)
Tim Burks
 
Debugging Your Debugging Tools: What to do When Your Service Mesh Goes Down
Debugging Your Debugging Tools: What to do When Your Service Mesh Goes DownDebugging Your Debugging Tools: What to do When Your Service Mesh Goes Down
Debugging Your Debugging Tools: What to do When Your Service Mesh Goes Down
Aspen Mesh
 
TekTape Manual
TekTape ManualTekTape Manual
TekTape Manual
Yasin KAPLAN
 
Designing for Distributed Systems with Reactor and Reactive Streams
Designing for Distributed Systems with Reactor and Reactive StreamsDesigning for Distributed Systems with Reactor and Reactive Streams
Designing for Distributed Systems with Reactor and Reactive Streams
Stéphane Maldini
 
C08 – Updated planning and commissioning guidelines for Profinet - Xaver Sch...
C08 – Updated planning and commissioning guidelines for Profinet -  Xaver Sch...C08 – Updated planning and commissioning guidelines for Profinet -  Xaver Sch...
C08 – Updated planning and commissioning guidelines for Profinet - Xaver Sch...
PROFIBUS and PROFINET InternationaI - PI UK
 
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Semihalf
 
Everybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with ErlangEverybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with Erlang
Rusty Klophaus
 
Ccna Imp Guide
Ccna Imp GuideCcna Imp Guide
Ccna Imp Guide
abhijitgnbbl
 
Handy Networking Tools and How to Use Them
Handy Networking Tools and How to Use ThemHandy Networking Tools and How to Use Them
Handy Networking Tools and How to Use Them
Sneha Inguva
 
Traffic monitoring
Traffic monitoringTraffic monitoring
Traffic monitoring
Radu Galbenu
 
Training Slides: 153 - Working with the CLI
Training Slides: 153 - Working with the CLITraining Slides: 153 - Working with the CLI
Training Slides: 153 - Working with the CLI
Continuent
 
Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)
Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)
Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)
James Titcumb
 
Dpdk: rte_security: An update and introducing PDCP
Dpdk: rte_security: An update and introducing PDCPDpdk: rte_security: An update and introducing PDCP
Dpdk: rte_security: An update and introducing PDCP
Hemant Agrawal
 
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 FinalExploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Finalmasoodnt10
 
Router internals
Router internalsRouter internals
Router internals
Jinank Jain
 
HTTP2 and gRPC
HTTP2 and gRPCHTTP2 and gRPC
HTTP2 and gRPC
Guo Jing
 
I know what your packet did last hop using packet histories to troubleshoot...
I know what your packet did last hop  using  packet histories to troubleshoot...I know what your packet did last hop  using  packet histories to troubleshoot...
I know what your packet did last hop using packet histories to troubleshoot...
承達 蔡
 

Similar to NGINX Live EP.5 NGINX Health Checks Slide (20)

Migrating to Prometheus: what we learned running it in production
Migrating to Prometheus: what we learned running it in productionMigrating to Prometheus: what we learned running it in production
Migrating to Prometheus: what we learned running it in production
 
PPePR Overview Web2 Ireland
PPePR Overview Web2 IrelandPPePR Overview Web2 Ireland
PPePR Overview Web2 Ireland
 
Creating Great REST and gRPC API Experiences (in Swift)
Creating Great REST and gRPC API Experiences (in Swift)Creating Great REST and gRPC API Experiences (in Swift)
Creating Great REST and gRPC API Experiences (in Swift)
 
Debugging Your Debugging Tools: What to do When Your Service Mesh Goes Down
Debugging Your Debugging Tools: What to do When Your Service Mesh Goes DownDebugging Your Debugging Tools: What to do When Your Service Mesh Goes Down
Debugging Your Debugging Tools: What to do When Your Service Mesh Goes Down
 
TekTape Manual
TekTape ManualTekTape Manual
TekTape Manual
 
Designing for Distributed Systems with Reactor and Reactive Streams
Designing for Distributed Systems with Reactor and Reactive StreamsDesigning for Distributed Systems with Reactor and Reactive Streams
Designing for Distributed Systems with Reactor and Reactive Streams
 
C08 – Updated planning and commissioning guidelines for Profinet - Xaver Sch...
C08 – Updated planning and commissioning guidelines for Profinet -  Xaver Sch...C08 – Updated planning and commissioning guidelines for Profinet -  Xaver Sch...
C08 – Updated planning and commissioning guidelines for Profinet - Xaver Sch...
 
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
Oczyszczacz powietrza i stos sieciowy? Czas na test! Semihalf Barcamp 13/06/2018
 
Firewall
FirewallFirewall
Firewall
 
Everybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with ErlangEverybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with Erlang
 
Ccna Imp Guide
Ccna Imp GuideCcna Imp Guide
Ccna Imp Guide
 
Handy Networking Tools and How to Use Them
Handy Networking Tools and How to Use ThemHandy Networking Tools and How to Use Them
Handy Networking Tools and How to Use Them
 
Traffic monitoring
Traffic monitoringTraffic monitoring
Traffic monitoring
 
Training Slides: 153 - Working with the CLI
Training Slides: 153 - Working with the CLITraining Slides: 153 - Working with the CLI
Training Slides: 153 - Working with the CLI
 
Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)
Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)
Adding 1.21 Gigawatts to Applications with RabbitMQ (PHPNW Dec 2014 Meetup)
 
Dpdk: rte_security: An update and introducing PDCP
Dpdk: rte_security: An update and introducing PDCPDpdk: rte_security: An update and introducing PDCP
Dpdk: rte_security: An update and introducing PDCP
 
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 FinalExploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
 
Router internals
Router internalsRouter internals
Router internals
 
HTTP2 and gRPC
HTTP2 and gRPCHTTP2 and gRPC
HTTP2 and gRPC
 
I know what your packet did last hop using packet histories to troubleshoot...
I know what your packet did last hop  using  packet histories to troubleshoot...I know what your packet did last hop  using  packet histories to troubleshoot...
I know what your packet did last hop using packet histories to troubleshoot...
 

Recently uploaded

GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 

Recently uploaded (20)

GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 

NGINX Live EP.5 NGINX Health Checks Slide

  • 1. NGINX HEALTH CHECKS NGINX LIVE EP.5 SUPACHAI JATURAPROM (TUM) AUG 2020 NGINX USER GROUP: THAILAND CHAPTER WWW.MEETUP.COM/TH-TH/NGINX-THAILAND
  • 2. NGINX HEALTH CHECKS AGENDA Why ? Health Checks TCP Health Checks HTTP Health Checks UDP Health Checks Active Health Checks Passive Health Checks NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 3. WHY ? HEALTH CHECKS (1) Client 1 Load Balance Host 1 Host 2 Host 3 Client 2 Client 3 NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 4. WHY ? HEALTH CHECKS (2) Client 1 Load Balance Host 1 Host 2 Host 3 Client 2 Client 3 NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 5. WHY ? HEALTH CHECKS (3) Client 1 Load Balance Host 1 Host 2 Host 3 Client 2 Client 3 NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 6. WHY ? HEALTH CHECKS (4) Client 1 Load Balance Host 1 Host 2 Host 3 Client 2 Client 3 Health checks Health checks Health checks Data Traffic Data Traffic Data Traffic NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 7. WHY ? HEALTH CHECKS (5) Load Balance Client 1 Host 1 Host 2 Host 3 Client 2 Client 3 Health checks Health checks Health checks Data Traffic Data Traffic Data Traffic NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 8. WHY ? HEALTH CHECKS (6) Client 1 Load Balance Host 1 Host 2Client 2 Client 3 Health checks Health checks Health checks Host 3 Data Traffic Data Traffic Data Traffic NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 9. WHY ? HEALTH CHECKS (7) Client 1 Load Balance Host 1 Host 2 Host 3 Client 2 Client 3 Health checks Health checks Health checks Data Traffic Data Traffic Data Traffic healthy healthy healthy NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 10. Load Balance Host 1 Host 2 Host 3 Client 1 Health checks Health checks Health checks Data Traffic ACTIVE HEALTH CHECK GET / Return 200 OK healthy healthy healthy NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 11. Load Balance Host 1 Host 2 Host 3 Client 1 Data Traffic PASSIVE HEALTH CHECK 500 Error หรือ Timeout Client 2 Data Traffic unhealthy healthy healthy NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 12. HTTPS HEALTH CHECKS (1) upstream backend { server backend1.example.com; server backend2.example.com; } server { location / { proxy_pass http://backend; health_check; } } by default, every five seconds a request for “/” to each server in the backend group. If any communication error or timeout occurs (outside 200-399) the health check fails. The server is marked as unhealthy. NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 13. HTTPS HEALTH CHECKS (2) server { location / { proxy_pass http://backend; health_check port=9999 interval=10 fails=3 passes=2 uri=/some/path; } } port = คือ การระบุ port number ทีใช้ health checks (default port server) interval = คือ การระบุระยะเวลาในการทํา health checks (default 5s) fails= คือ จํานวนการ fails ทีจะทําการ marking ว่า unhealthy (default 1) passes= คือ จํานวนการ success ทีจะทําการ marking ว่า healthy (default 1) uri= คือ การระบุ uri path (default path "/" ) http://backend1.exmaple.naja/i/love/nginx marking unhealthy = 10x3 = 30 วินาที marking healthy = 10x2 = 20 วินาที NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 14. HTTPS HEALTH CHECKS (3) http { ........... match server_ok { status 200-399; body !~ "maintenance mode"; } server { ........... location / { proxy_pass http://backend; health_check match=server_ok; } Here the health check is passed if the status code of the response is in the range 200–399, and its body does not contain the string "maintenance mode". NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 15. TCP HEALTH CHECKS (1) stream { #... server { listen 12345; proxy_pass stream_backend; health_check port=12346 interval=10 passes=2 fails=3; health_check_timeout 5s; } } ** health_check_timeout directive is overrides proxy_timeout directive. NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 16. TCP HEALTH CHECKS (2) stream { #... upstream stream_backend { .......... } match http { send "GET / HTTP/1.0rnHost: localhostrnrn"; expect ~* "200 OK"; } server { listen 12345; health_check match=http; proxy_pass stream_backend; } send คือ text string หรือ hex (/x) ทีส่งออกไป expect คือ Literal string หรือ regex ทีคาดหวังจะได้รับ NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 17. UDP HEALTH CHECKS (1) stream { #... server { listen 53 udp; proxy_pass dns_upstream; health_check interval=20 passes=2 fails=2 udp; } #... } ** udp parameter specifies that the UDP protocol should be used for health checks instead of the default TCP protocol. NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 18. UDP HEALTH CHECKS (2) stream { #... match dns { send x00x2ax00x00x00x01x00x00x00x00x00x00x03.....; expect ~* "health.is.good"; } server { listen 53 udp; proxy_pass dns_upstream; health_check match=udp_test udp; } #... } NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 19. SERVER SLOW-START upstream backend { server backend1.example.com slow_start=30s; server backend2.example.com; server 127.255.255.254 backup; } slow‑start allows an upstream server to gradually recover its weight from 0 to its nominal value after it has been recovered or became available. by default is 0, that mean disable slow-start. NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 20. NGINX HEALTH CHECKS SUMMARY Why ? Health Checks Active Health Checks Passive Health Checks NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand NGINX Live EP.5 Supachai Jaturaprom (Tum)
  • 21. THANKS YOUR NGINX LIVE EP.5 SUPACHAI JATURAPROM (TUM) NGINX User Group: Thailand Chapter www.meetup.com/th-TH/NGINX-Thailand