SlideShare a Scribd company logo
Delivering High-Performance
Web Sites with NGINX
June 7, 2017
MORE INFORMATION AT
NGINX.COM
MORE INFORMATION AT
NGINX.COM
The average attention span of
a human being dropped from
12 seconds in 2000,
to 8.25 seconds in 2013.
http://www.statisticbrain.com/attention-span-statistics/
MORE INFORMATION AT
NGINX.COM
Why does Performance matter?
MORE INFORMATION AT
NGINX.COM
0
10,000
20,000
30,000
40,000
50,000
60,000
70,000
80,000
90,000
100,000
110,000
120,000
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
IP Traffic (PB/month)
MORE INFORMATION AT
NGINX.COM
0
20
40
60
80
100
120
0
500
1,000
1,500
2,000
2,500
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
Web Page Weight
Weight (kB)
Weight (objects)
MORE INFORMATION AT
NGINX.COM
0
2
4
6
8
10
12
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
Typical user wait time (seconds)
MORE INFORMATION AT
NGINX.COM
How are delays perceived by users?
0.1 s
0.25 s
1.0 s
10 s
Instantaneous: < 0.1 s
Typical reaction time: < 0.25 s
Concentration span: < 1.0 s
Attention span: < 10 s
source: Jacob Nielsen, Usability Engineering
MORE INFORMATION AT
NGINX.COM
Some tales from the field…
500ms delay 20% decrease in ad
clickthroughs
100ms delay 1% decrease in
revenue per customer
2.2s improvement 15% increase in
downloads
60% improvement 14% increase in
donations
MORE INFORMATION AT
NGINX.COM
Lab Benchmarks do not predict
real-world performance
MORE INFORMATION AT
NGINX.COM
Four Fallacies of Benchmarking
1. Benchmark tools may not count network errors, only successful
requests
• Sometimes they do count fast, application errors and this
skews the results!
2. A fast, local network eliminates the effects of slow connections
and packet loss
3. Desktop-class operating systems are not tuned for real-world
performance
4. Benchmark traffic does not resemble real-world traffic
MORE INFORMATION AT
NGINX.COM
1. I use benchmarking tool X because it gives better
(higher) results than Y?
2. It got 1,000 RPS in the lab, but it’s struggling to
get more than 100 RPS in production?
Have you ever heard…?
So, what is benchmarking
good for?
MORE INFORMATION AT
NGINX.COM
How can I reliably improve my
site performance?
MORE INFORMATION AT
NGINX.COM
Internet
4 opportunities to optimize performance
Python
Ruby
node.js
Java
Client Device Network Application Stack Code
MORE INFORMATION AT
NGINX.COM
Internet
Python
Ruby
node.js
Java
Client Device Network Code
Application Stack
4 opportunities to optimize performance
MORE INFORMATION AT
NGINX.COM
NGINX: Part of your Application Stack
NGINX Plus
Load Balancing
Tier
SSL decrypt
Internal Load Balancing
Groups of web and
application servers
Application Platform
Typical application stacks
are not optimized for
performance in the face of
unpredictable, slow
internet traffic.
NGINX and NGINX Plus
are optimized for real-
world traffic
MORE INFORMATION AT
NGINX.COM
NGINX: What makes NGINX different?
NGINX philosophy Alternative Products
Architecture Event driven
• Massively scalable
• No hard limit on concurrency
Process or thread per connection
• Each connection is expensive
• Fixed concurrency limit
Features Simple, lightweight
• Web server and cache
• Reverse proxy and load balancer
Rich, but heavyweight
• Web and application server
• High memory and CPU footprint
Purpose Application Acceleration
• Focus on performance first,
features second
Rich application server
• Focus on functionality and
developer productivity
MORE INFORMATION AT
NGINX.COM
How does NGINX help you?
MORE INFORMATION AT
NGINX.COM
NGINX: Three things it can do for your app
Offload HTTP “Heavy Lifting”
Cache common responses
Deliver secure content faster with HTTP/2
MORE INFORMATION AT
NGINX.COM
What is HTTP heavy lifting?
Hundreds of
concurrent
connections…
require hundreds of heavyweight
threads or processes…
competing for limited
CPU and memory
Client-side:
Slow network
Multiple connections
HTTP Keepalives
Server-side:
Limited concurrency
MORE INFORMATION AT
NGINX.COM
What is HTTP heavy lifting?
Hundreds of
concurrent
connections…
handed by a small number of
multiplexing processes,…
typically one process
per core
MORE INFORMATION AT
NGINX.COM
Let’s see the effect on a typical web app
SlowHTTPTest
code.google.com/p/slowhttptest/
WordPress
Standard install
:80
Measure capacity of application using a simple benchmarking tool (ab)
Repeat the test after using slowhttptest to simulate a number of slow internet users
MORE INFORMATION AT
NGINX.COM
Repeat, using NGINX to do the heavy
lifting
Measure capacity of application using a simple benchmarking tool (ab)
Repeat the test after using slowhttptest to simulate a number of slow internet users
SlowHTTPTest
code.google.com/p/slowhttptest/
NGINX+ and WordPress
Standard install with sample
content
:8080
MORE INFORMATION AT
NGINX.COM
How did we do this?
server {
listen 8080;
location / {
proxy_pass http://wp-servers;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
}
upstream wp-servers {
server localhost:80;
keepalive 10;
}
Listen for traffic on port 8080
Pass it to the wp-servers
upstream group, while upgrading
the internal connection to
HTTP/1.1 keepalives
Load-balance to one server –
localhost:80 – and maintain a
maximum of 10 idle keepalive
connections
MORE INFORMATION AT
NGINX.COM
NGINX: Three things it can do for your app
Offload HTTP “Heavy Lifting”
Cache common responses
Deliver secure content faster with HTTP/2
MORE INFORMATION AT
NGINX.COM
What is the purpose of caching?
MORE INFORMATION AT
NGINX.COM
Let’s see it in action
Measure capacity of application using a simple benchmarking tool (ab)
Compare with and without caching
ab
Measure performance difference
NGINX+ (caching) and WordPress
Standard install
:8082
MORE INFORMATION AT
NGINX.COM
How did we do this?
proxy_cache_path /tmp/cache
keys_zone=cache:10m levels=1:2
inactive=600s max_size=100m;
server {
listen 8082;
location / {
proxy_pass http://wp-servers;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_cache cache;
proxy_cache_valid 200 1s;
proxy_cache_lock on;
proxy_cache_use_stale updating;
}
}
Configure a local disk/memory
cache
Listen on port 8082
Proxy all traffic to wp-servers
Cache responses for 1 second,
and update in the background
MORE INFORMATION AT
NGINX.COM
NGINX: Three things it can do for your app
Offload HTTP “Heavy Lifting”
Cache common responses
Deliver secure content faster with HTTP/2
MORE INFORMATION AT
NGINX.COM
HTTP/1 connection HTTP/2 connection
MORE INFORMATION AT
NGINX.COM
HTTP/1.x and HTTP/2 Compared
Browsers typically makes 6 connections per domain with HTTP/1.x
MORE INFORMATION AT
NGINX.COM
HTTP/1 waterfall HTTP/2 waterfall
MORE INFORMATION AT
NGINX.COM
Use of HTTP/2
Source: https://w3techs.com/technologies/breakdown/ce-http2/ranking
MORE INFORMATION AT
NGINX.COM
Use of HTTP/2
Source: https://w3techs.com/technologies/segmentation/ce-http2/web_server
MORE INFORMATION AT
NGINX.COM
HTTP/2: Summary of Features
• Request Multiplexing – multiple, parallel requests in the same TCP connection
• Binary Header – Smaller header size
• Request Prioritization – Define what objects should be prioritized
• Header Compression – HPACK header compression reduces size of HTTP/2
header
• Mandatory SSL – Not mandated by RFC but Chrome and Firefox won’t support
without it
• More secure websites
• Higher search rankings for encrypted sites
MORE INFORMATION AT
NGINX.COM
Typical HTTP/2 configuration
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
ssl_certificate server.crt;
ssl_certificate_key server.key;
…
}
Capture and redirect HTTP traffic
to HTTPS
Enable http2 with the http2
keyword
MORE INFORMATION AT
NGINX.COM
Conclusion
MORE INFORMATION AT
NGINX.COM
MORE INFORMATION AT
NGINX.COM
NGINX: Three things it can do for your app
Offload HTTP “Heavy Lifting”
Cache common responses
Deliver secure content faster with HTTP/2
MORE INFORMATION AT
NGINX.COM
NGINX open source
NGINX
reverse
proxy
• Rules Language
• Rate Limits
• Access Control
• Proxying and Balancing
• Logging
• Caching
• Direct response
HTTP
HTTPS
HTTP/2
TCP
UDP
MORE INFORMATION AT
NGINX.COM
NGINX Plus
NGINX
Plus
• Rules Language
• Rate Limits
• Access Control
• Proxying and Balancing
• Logging
• Adv. Load Balancing
• Web App Firewall
• Service Discovery
• Authentication
• Load Balancing Config API
• Extended Status API
• Caching and Purging
• Direct response
HTTP
HTTPS
HTTP/2
TCP
UDP
MORE INFORMATION AT
NGINX.COM
Where to find more?
Past webinars: nginx.com/webinars
NGINX Trial: nginx.com
Questions – Q&A panel in webex
Thank you

More Related Content

PPTX
High Availability Content Caching with NGINX
PPTX
Rate Limiting with NGINX and NGINX Plus
PPTX
NGINX: High Performance Load Balancing
PDF
NGINX ADC: Basics and Best Practices – EMEA
PPTX
NGINX: Basics & Best Practices - EMEA Broadcast
PPTX
NGINX: High Performance Load Balancing
PPTX
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
PDF
NGINX ADC: Basics and Best Practices
High Availability Content Caching with NGINX
Rate Limiting with NGINX and NGINX Plus
NGINX: High Performance Load Balancing
NGINX ADC: Basics and Best Practices – EMEA
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX: High Performance Load Balancing
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
NGINX ADC: Basics and Best Practices

What's hot (20)

PPTX
NGINX: Basics and Best Practices
PPTX
Introduction to NGINX web server
PPTX
5 things you didn't know nginx could do
PPTX
NGINX: HTTP/2 Server Push and gRPC
PDF
What's New in NGINX Plus R12?
PDF
Lcu14 Lightning Talk- NGINX
PPTX
ModSecurity 3.0 and NGINX: Getting Started - EMEA
PPTX
5 things you didn't know nginx could do velocity
PPTX
What's New in NGINX Plus R7?
PDF
DockerCon Live 2020 - Securing Your Containerized Application with NGINX
PPTX
Maximizing PHP Performance with NGINX
PDF
Nginx dhruba mandal
PPTX
MRA AMA Part 10: Kubernetes and the Microservices Reference Architecture
PDF
Using NGINX as an Effective and Highly Available Content Cache
PPTX
What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0
PPTX
KEY
Nginx - Tips and Tricks.
PDF
NGINX: Basics and Best Practices EMEA
PPTX
What's New in NGINX Plus R8
PDF
Nginx Essential
NGINX: Basics and Best Practices
Introduction to NGINX web server
5 things you didn't know nginx could do
NGINX: HTTP/2 Server Push and gRPC
What's New in NGINX Plus R12?
Lcu14 Lightning Talk- NGINX
ModSecurity 3.0 and NGINX: Getting Started - EMEA
5 things you didn't know nginx could do velocity
What's New in NGINX Plus R7?
DockerCon Live 2020 - Securing Your Containerized Application with NGINX
Maximizing PHP Performance with NGINX
Nginx dhruba mandal
MRA AMA Part 10: Kubernetes and the Microservices Reference Architecture
Using NGINX as an Effective and Highly Available Content Cache
What’s New in NGINX Ingress Controller for Kubernetes Release 1.5.0
Nginx - Tips and Tricks.
NGINX: Basics and Best Practices EMEA
What's New in NGINX Plus R8
Nginx Essential
Ad

Similar to Delivering High Performance Websites with NGINX (20)

PDF
What is Nginx and Why You Should to Use it with Wordpress Hosting
PDF
Web performance Part 1 "Networking theoretical basis"
PPTX
Web Performance Optimization
PPTX
Accelerating Your Web Application with NGINX
PPTX
Using an API Gateway for Microservices
PDF
Architecting for now & the future with NGINX London April 19
PDF
Architecting &Building Scalable Secure Web API
PPTX
NGINX Basics: Ask Me Anything – EMEA
PDF
WordPress Cluster for Enterprise High-Availability and On-Demand Scaling
PPTX
Web Application Development using PHP and MySQL
PPTX
App Deployment on Cloud
PDF
Site Speed Fundamentals
PDF
ITB2017 - Nginx ppf intothebox_2017
PDF
NGINX: The Past, Present and Future of the Modern Web
PPTX
How to Reduce Latency with Cloudflare Argo Smart Routing
PPTX
What's new in NGINX Plus R19
PPTX
NGINX Kubernetes Ingress Controller: Getting Started – EMEA
PPTX
Choosing A Proxy Server - Apachecon 2014
PDF
Nginx, PHP, Apache and Spelix
PDF
Google Cloud Next '22 Recap: Serverless & Data edition
What is Nginx and Why You Should to Use it with Wordpress Hosting
Web performance Part 1 "Networking theoretical basis"
Web Performance Optimization
Accelerating Your Web Application with NGINX
Using an API Gateway for Microservices
Architecting for now & the future with NGINX London April 19
Architecting &Building Scalable Secure Web API
NGINX Basics: Ask Me Anything – EMEA
WordPress Cluster for Enterprise High-Availability and On-Demand Scaling
Web Application Development using PHP and MySQL
App Deployment on Cloud
Site Speed Fundamentals
ITB2017 - Nginx ppf intothebox_2017
NGINX: The Past, Present and Future of the Modern Web
How to Reduce Latency with Cloudflare Argo Smart Routing
What's new in NGINX Plus R19
NGINX Kubernetes Ingress Controller: Getting Started – EMEA
Choosing A Proxy Server - Apachecon 2014
Nginx, PHP, Apache and Spelix
Google Cloud Next '22 Recap: Serverless & Data edition
Ad

More from NGINX, Inc. (20)

PDF
【NGINXセミナー】 Ingressを使ってマイクロサービスの運用を楽にする方法
PDF
【NGINXセミナー】 NGINXのWAFとは?その使い方と設定方法 解説セミナー
PDF
【NGINXセミナー】API ゲートウェイとしてのNGINX Plus活用方法
PPTX
Get Hands-On with NGINX and QUIC+HTTP/3
PPTX
Managing Kubernetes Cost and Performance with NGINX & Kubecost
PDF
Manage Microservices Chaos and Complexity with Observability
PDF
Accelerate Microservices Deployments with Automation
PDF
Unit 2: Microservices Secrets Management 101
PDF
Unit 1: Apply the Twelve-Factor App to Microservices Architectures
PDF
NGINX基本セミナー(セキュリティ編)~NGINXでセキュアなプラットフォームを実現する方法!
PDF
Easily View, Manage, and Scale Your App Security with F5 NGINX
PDF
NGINXセミナー(基本編)~いまさら聞けないNGINXコンフィグなど基本がわかる!
PDF
Keep Ahead of Evolving Cyberattacks with OPSWAT and F5 NGINX
PPTX
Install and Configure NGINX Unit, the Universal Application, Web, and Proxy S...
PPTX
Protecting Apps from Hacks in Kubernetes with NGINX
PPTX
NGINX Kubernetes API
PPTX
Successfully Implement Your API Strategy with NGINX
PPTX
Installing and Configuring NGINX Open Source
PPTX
Shift Left for More Secure Apps with F5 NGINX
PPTX
How to Avoid the Top 5 NGINX Configuration Mistakes.pptx
【NGINXセミナー】 Ingressを使ってマイクロサービスの運用を楽にする方法
【NGINXセミナー】 NGINXのWAFとは?その使い方と設定方法 解説セミナー
【NGINXセミナー】API ゲートウェイとしてのNGINX Plus活用方法
Get Hands-On with NGINX and QUIC+HTTP/3
Managing Kubernetes Cost and Performance with NGINX & Kubecost
Manage Microservices Chaos and Complexity with Observability
Accelerate Microservices Deployments with Automation
Unit 2: Microservices Secrets Management 101
Unit 1: Apply the Twelve-Factor App to Microservices Architectures
NGINX基本セミナー(セキュリティ編)~NGINXでセキュアなプラットフォームを実現する方法!
Easily View, Manage, and Scale Your App Security with F5 NGINX
NGINXセミナー(基本編)~いまさら聞けないNGINXコンフィグなど基本がわかる!
Keep Ahead of Evolving Cyberattacks with OPSWAT and F5 NGINX
Install and Configure NGINX Unit, the Universal Application, Web, and Proxy S...
Protecting Apps from Hacks in Kubernetes with NGINX
NGINX Kubernetes API
Successfully Implement Your API Strategy with NGINX
Installing and Configuring NGINX Open Source
Shift Left for More Secure Apps with F5 NGINX
How to Avoid the Top 5 NGINX Configuration Mistakes.pptx

Recently uploaded (20)

PDF
Nekopoi APK 2025 free lastest update
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
medical staffing services at VALiNTRY
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Transform Your Business with a Software ERP System
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
System and Network Administraation Chapter 3
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
top salesforce developer skills in 2025.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Nekopoi APK 2025 free lastest update
Operating system designcfffgfgggggggvggggggggg
medical staffing services at VALiNTRY
Softaken Excel to vCard Converter Software.pdf
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Transform Your Business with a Software ERP System
How to Choose the Right IT Partner for Your Business in Malaysia
System and Network Administraation Chapter 3
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Reimagine Home Health with the Power of Agentic AI​
top salesforce developer skills in 2025.pdf
Design an Analysis of Algorithms I-SECS-1021-03
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Wondershare Filmora 15 Crack With Activation Key [2025
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
L1 - Introduction to python Backend.pptx
Computer Software and OS of computer science of grade 11.pptx
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool

Delivering High Performance Websites with NGINX