SlideShare una empresa de Scribd logo
1 de 25
REVERSE PROXY & WEB CACHE
BY :ELMAHDI BENZEKRI
Proxy vs ReverseProxy
Reverseproxy in 4 questions–Whatis a reverseproxy ?
• Bridge between the local entreprise network and the external.
• Avoid to expose frontal servers.
• Intended to be securized and to absorb large loads of traffic.
Reverseproxy in 4 questions–What are it’s additionnal
features?
• Access logs
• Cache
• Load balancing
• Data compression, firewall
• Authenticationand SSL encryption
Reverse proxyin 4 questions – Can reduce the complexityof a
web architecture?
• Yes.
Reverse proxyin 4 questions – Can reduce the complexityof a
web architecture?
• Yes.
• Allthe requests pass trough => uniform error pages, access logs..
• Expose only one address to the external
Reverseproxy in 4 questions–What are the most used
reverseproxy?
• Depending of the majoritary web server
• Free
• Nginx
• Apache
• Squid
• HAProxy
• Proprietary
• Microsoft ISA Server
• Big IP
• Traffic management appliances that also fulfillthis task: F5 network, Cisco…
NGINX
• Global syntax
• C10K problem
• Open source writen in 2002 in C by Igor Sysoev
<section> {
<directive> <parameters>
}
ApacheHTTPD
• Hyper Text Transfer Protocol Daemon
• <> Tomcat
• The most popular (39% in 2015)
• Writen in C In 1995 as ad-on to NCSA HTTPd
• Version 2 comes with lot of features
Apachevs Nginx- Connectionhandeling architecture
• Apache httpd provide multi processing modules
• mpm_prefork
• mpm_worker
• mpm_event
• Nginx asynchronous, non blocking, event driver connection
• Onemaster andseveral workerprocesses
Apachevs Nginx- Connectionhandeling architecture
Webcaching management
• Improved responsiveness
• Increased performance on the same hardware
• Availability of content during network interruptions
Webcaching management
• Caching headers:
• Expires
• Cache-Control
• Etag
• Last-Modified
• Content-Length
• Cache-Control flag
• No-cache
• No-store
• What cannot be cached ?
• Dynamic pages
• Content with authentication cookie
• Content linked to user or cart…
• Terminology
• Origin server
• Cache hit ratio
• Stale content
• Validation
• invalidation
Webcaching management- nginx
• proxy_cache_valid any10m;
• proxy_cache_path /var/www/cachelevels=1:2 keys_zone=my-cache:8mmax_size=1000minactive=600m;
• proxy_temp_path /var/www/cache/tmp;
• proxy_cache_use_staleerrortimeoutupdatinghttp_500http_502http_503http_504;
• Location/{
• Proxy_cache my-cache
• }
Webcaching management-varnish
• By Paul Henning Kamp(FreeBSD dev) in
2006
• Reverse proxy cache server
• http processor
• Optimized for Linux
• Custom configuration langage
Webcaching management-varnish
DAEMON_OPTS="-a:6081
-Tlocalhost:6082
-f/etc/varnish/default.vcl
-S/etc/varnish/secret
-s malloc,256m“
Subroutines:
• subvcl_recv {}
• subvcl_hash {}
• subvcl_backend_response{}
• subvcl_deliver {}
…
RequestandresponseVCLobject:
• Req,bereq,beresp,resp,obj
Returnin each subroutine:
• Return(pass)
• Return(fetch)
• Return(deliver)
• …
Loadbalancing
• Trafficisintelligentlydistributedamongstmultipleservers(appinstances)
• Features
• Optimizing resource utilization
• Reducing latency
• Ensuring faulttolerance
• Someloadbalancingsolutions
• Open source
• Nginx
• Haproxy
• Corporate Standard
• F5
• Citrix
Loadbalancing- comparison
NGINX HAPROXY
ONLY HTTP TCP BASED
On request health check Out of band health check
Three algorithmes Multiple algorithmes
Complicated tasks based on HTTP infos -
HTTP2 & SSL in v 1,9 Only in dev version
Free & commercial version Free
Loadbalancingwith Nginx
• Load balancingmethods
• Round robin
• Least connected
• Ip-hash
• Session persistence
• Weighted load balancing
• Health check(passive)
Optimizing Nginx
• Numberofworkers
• grep processor /proc/cpuinfo | wc –l
• Worker_connections
• Ulimit –u
• LimitingtheBuffer size
• client_header_buffer_size 1k;
• client_max_body_size 8m;
• large_client_header_buffers 2 1k;
• Timeouts
• client_body_timeout 12;
• client_header_timeout 12;
• keepalive_timeout 15;
• Gzipcompression
DEMO
• 2 Tomcat
• Nginx > tomcat
• Nginx if / break / set / rewrite
• Nginx headers
• Nginx cache
• Nginx log + blacklist
• Nginx > 2tomcat
• Nginx > varnish > tomcat
DEMO
TOMCAT A
TOMCAT B
THANK U

Más contenido relacionado

La actualidad más candente

VSAN – Architettura e Design
VSAN – Architettura e DesignVSAN – Architettura e Design
VSAN – Architettura e DesignVMUG IT
 
Reference design for v mware nsx
Reference design for v mware nsxReference design for v mware nsx
Reference design for v mware nsxsolarisyougood
 
Storage as a service and OpenStack Cinder
Storage as a service and OpenStack CinderStorage as a service and OpenStack Cinder
Storage as a service and OpenStack Cinderopenstackindia
 
Storage tiering and erasure coding in Ceph (SCaLE13x)
Storage tiering and erasure coding in Ceph (SCaLE13x)Storage tiering and erasure coding in Ceph (SCaLE13x)
Storage tiering and erasure coding in Ceph (SCaLE13x)Sage Weil
 
LoadBalancer using KeepAlived
LoadBalancer using KeepAlivedLoadBalancer using KeepAlived
LoadBalancer using KeepAlivedKhushalChandak1
 
High Availability for OpenStack
High Availability for OpenStackHigh Availability for OpenStack
High Availability for OpenStackKamesh Pemmaraju
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Odinot Stanislas
 
Ceph Introduction 2017
Ceph Introduction 2017  Ceph Introduction 2017
Ceph Introduction 2017 Karan Singh
 
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 ShapeBlue
 
High Availability on pfSense 2.4 - pfSense Hangout March 2017
High Availability on pfSense 2.4 - pfSense Hangout March 2017High Availability on pfSense 2.4 - pfSense Hangout March 2017
High Availability on pfSense 2.4 - pfSense Hangout March 2017Netgate
 
Minio Cloud Storage
Minio Cloud StorageMinio Cloud Storage
Minio Cloud StorageMinio
 
pfSense firewall workshop guide
pfSense firewall workshop guidepfSense firewall workshop guide
pfSense firewall workshop guideSopon Tumchota
 
Alphorm.com : Formation Active directory 2008 R2 (70-640)
Alphorm.com : Formation Active directory 2008 R2 (70-640)Alphorm.com : Formation Active directory 2008 R2 (70-640)
Alphorm.com : Formation Active directory 2008 R2 (70-640)Alphorm
 
Zerto for dr migration to cloud overview
Zerto for dr migration to cloud overviewZerto for dr migration to cloud overview
Zerto for dr migration to cloud overviewMorgan Davidson
 
Understanding Cisco Next Generation SD-WAN Solution
Understanding Cisco Next Generation SD-WAN SolutionUnderstanding Cisco Next Generation SD-WAN Solution
Understanding Cisco Next Generation SD-WAN SolutionCisco Canada
 
Vce vxrail-customer-presentation new
Vce vxrail-customer-presentation newVce vxrail-customer-presentation new
Vce vxrail-customer-presentation newJennifer Graham
 

La actualidad más candente (20)

OpenStack Swift
OpenStack SwiftOpenStack Swift
OpenStack Swift
 
VSAN – Architettura e Design
VSAN – Architettura e DesignVSAN – Architettura e Design
VSAN – Architettura e Design
 
Reference design for v mware nsx
Reference design for v mware nsxReference design for v mware nsx
Reference design for v mware nsx
 
Storage as a service and OpenStack Cinder
Storage as a service and OpenStack CinderStorage as a service and OpenStack Cinder
Storage as a service and OpenStack Cinder
 
Storage tiering and erasure coding in Ceph (SCaLE13x)
Storage tiering and erasure coding in Ceph (SCaLE13x)Storage tiering and erasure coding in Ceph (SCaLE13x)
Storage tiering and erasure coding in Ceph (SCaLE13x)
 
LoadBalancer using KeepAlived
LoadBalancer using KeepAlivedLoadBalancer using KeepAlived
LoadBalancer using KeepAlived
 
High Availability for OpenStack
High Availability for OpenStackHigh Availability for OpenStack
High Availability for OpenStack
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
 
Ceph Introduction 2017
Ceph Introduction 2017  Ceph Introduction 2017
Ceph Introduction 2017
 
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
 
High Availability on pfSense 2.4 - pfSense Hangout March 2017
High Availability on pfSense 2.4 - pfSense Hangout March 2017High Availability on pfSense 2.4 - pfSense Hangout March 2017
High Availability on pfSense 2.4 - pfSense Hangout March 2017
 
Secure Your Network for Scale & the Cloud
Secure Your Network for Scale & the CloudSecure Your Network for Scale & the Cloud
Secure Your Network for Scale & the Cloud
 
Minio Cloud Storage
Minio Cloud StorageMinio Cloud Storage
Minio Cloud Storage
 
ACI Hands-on Lab
ACI Hands-on LabACI Hands-on Lab
ACI Hands-on Lab
 
pfSense firewall workshop guide
pfSense firewall workshop guidepfSense firewall workshop guide
pfSense firewall workshop guide
 
Alphorm.com : Formation Active directory 2008 R2 (70-640)
Alphorm.com : Formation Active directory 2008 R2 (70-640)Alphorm.com : Formation Active directory 2008 R2 (70-640)
Alphorm.com : Formation Active directory 2008 R2 (70-640)
 
VXLAN Practice Guide
VXLAN Practice GuideVXLAN Practice Guide
VXLAN Practice Guide
 
Zerto for dr migration to cloud overview
Zerto for dr migration to cloud overviewZerto for dr migration to cloud overview
Zerto for dr migration to cloud overview
 
Understanding Cisco Next Generation SD-WAN Solution
Understanding Cisco Next Generation SD-WAN SolutionUnderstanding Cisco Next Generation SD-WAN Solution
Understanding Cisco Next Generation SD-WAN Solution
 
Vce vxrail-customer-presentation new
Vce vxrail-customer-presentation newVce vxrail-customer-presentation new
Vce vxrail-customer-presentation new
 

Similar a Reverse proxy & web cache with NGINX, HAProxy and Varnish

Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011camp_drupal_ua
 
Building & Testing Scalable Rails Applications
Building & Testing Scalable Rails ApplicationsBuilding & Testing Scalable Rails Applications
Building & Testing Scalable Rails Applicationsevilmike
 
Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Amazee Labs
 
BuildStuff 2019: Let me handle that for you... Why you need a reverse proxy
BuildStuff 2019: Let me handle that for you... Why you need a reverse proxyBuildStuff 2019: Let me handle that for you... Why you need a reverse proxy
BuildStuff 2019: Let me handle that for you... Why you need a reverse proxyElton Stoneman
 
What is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress HostingWhat is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress HostingWPSFO Meetup Group
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 SystemsDavid Newman
 
Rails Caching: Secrets From the Edge
Rails Caching: Secrets From the EdgeRails Caching: Secrets From the Edge
Rails Caching: Secrets From the EdgeFastly
 
Rails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeRails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeMichael May
 
ActiveMQ 5.9.x new features
ActiveMQ 5.9.x new featuresActiveMQ 5.9.x new features
ActiveMQ 5.9.x new featuresChristian Posta
 
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…Atwix
 
Accelerating Rails with edge caching
Accelerating Rails with edge cachingAccelerating Rails with edge caching
Accelerating Rails with edge cachingMichael May
 
Choosing A Proxy Server - Apachecon 2014
Choosing A Proxy Server - Apachecon 2014Choosing A Proxy Server - Apachecon 2014
Choosing A Proxy Server - Apachecon 2014bryan_call
 
DrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtDrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtNick Santamaria
 
Varnish & Magento TechTalk @Lyracons
Varnish & Magento TechTalk @LyraconsVarnish & Magento TechTalk @Lyracons
Varnish & Magento TechTalk @LyraconsEzequiel Kupelian
 
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...Michele Orru
 
T3DD12 Caching with Varnish
T3DD12 Caching with VarnishT3DD12 Caching with Varnish
T3DD12 Caching with VarnishAOE
 
Nginx caching
Nginx cachingNginx caching
Nginx cachingreneedv
 
About Caching
About CachingAbout Caching
About CachingWeng Wei
 

Similar a Reverse proxy & web cache with NGINX, HAProxy and Varnish (20)

Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
 
Building & Testing Scalable Rails Applications
Building & Testing Scalable Rails ApplicationsBuilding & Testing Scalable Rails Applications
Building & Testing Scalable Rails Applications
 
Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012
 
BuildStuff 2019: Let me handle that for you... Why you need a reverse proxy
BuildStuff 2019: Let me handle that for you... Why you need a reverse proxyBuildStuff 2019: Let me handle that for you... Why you need a reverse proxy
BuildStuff 2019: Let me handle that for you... Why you need a reverse proxy
 
What is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress HostingWhat is Nginx and Why You Should to Use it with Wordpress Hosting
What is Nginx and Why You Should to Use it with Wordpress Hosting
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 Systems
 
Rails Caching: Secrets From the Edge
Rails Caching: Secrets From the EdgeRails Caching: Secrets From the Edge
Rails Caching: Secrets From the Edge
 
Rails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeRails Caching Secrets from the Edge
Rails Caching Secrets from the Edge
 
Varnish intro
Varnish introVarnish intro
Varnish intro
 
ActiveMQ 5.9.x new features
ActiveMQ 5.9.x new featuresActiveMQ 5.9.x new features
ActiveMQ 5.9.x new features
 
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
Host and Boast: Best Practices for Magento Hosting | Imagine 2013 Technolog…
 
Accelerating Rails with edge caching
Accelerating Rails with edge cachingAccelerating Rails with edge caching
Accelerating Rails with edge caching
 
Choosing A Proxy Server - Apachecon 2014
Choosing A Proxy Server - Apachecon 2014Choosing A Proxy Server - Apachecon 2014
Choosing A Proxy Server - Apachecon 2014
 
DrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtDrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an Afterthought
 
Varnish & Magento TechTalk @Lyracons
Varnish & Magento TechTalk @LyraconsVarnish & Magento TechTalk @Lyracons
Varnish & Magento TechTalk @Lyracons
 
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
Rooting your internals - Exploiting Internal Network Vulns via the Browser Us...
 
T3DD12 Caching with Varnish
T3DD12 Caching with VarnishT3DD12 Caching with Varnish
T3DD12 Caching with Varnish
 
Performance stack
Performance stackPerformance stack
Performance stack
 
Nginx caching
Nginx cachingNginx caching
Nginx caching
 
About Caching
About CachingAbout Caching
About Caching
 

Último

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 

Último (20)

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 

Reverse proxy & web cache with NGINX, HAProxy and Varnish

  • 1. REVERSE PROXY & WEB CACHE BY :ELMAHDI BENZEKRI
  • 3. Reverseproxy in 4 questions–Whatis a reverseproxy ? • Bridge between the local entreprise network and the external. • Avoid to expose frontal servers. • Intended to be securized and to absorb large loads of traffic.
  • 4. Reverseproxy in 4 questions–What are it’s additionnal features? • Access logs • Cache • Load balancing • Data compression, firewall • Authenticationand SSL encryption
  • 5. Reverse proxyin 4 questions – Can reduce the complexityof a web architecture? • Yes.
  • 6. Reverse proxyin 4 questions – Can reduce the complexityof a web architecture? • Yes. • Allthe requests pass trough => uniform error pages, access logs.. • Expose only one address to the external
  • 7. Reverseproxy in 4 questions–What are the most used reverseproxy? • Depending of the majoritary web server • Free • Nginx • Apache • Squid • HAProxy • Proprietary • Microsoft ISA Server • Big IP • Traffic management appliances that also fulfillthis task: F5 network, Cisco…
  • 8.
  • 9. NGINX • Global syntax • C10K problem • Open source writen in 2002 in C by Igor Sysoev <section> { <directive> <parameters> }
  • 10. ApacheHTTPD • Hyper Text Transfer Protocol Daemon • <> Tomcat • The most popular (39% in 2015) • Writen in C In 1995 as ad-on to NCSA HTTPd • Version 2 comes with lot of features
  • 11. Apachevs Nginx- Connectionhandeling architecture • Apache httpd provide multi processing modules • mpm_prefork • mpm_worker • mpm_event • Nginx asynchronous, non blocking, event driver connection • Onemaster andseveral workerprocesses
  • 13.
  • 14. Webcaching management • Improved responsiveness • Increased performance on the same hardware • Availability of content during network interruptions
  • 15. Webcaching management • Caching headers: • Expires • Cache-Control • Etag • Last-Modified • Content-Length • Cache-Control flag • No-cache • No-store • What cannot be cached ? • Dynamic pages • Content with authentication cookie • Content linked to user or cart… • Terminology • Origin server • Cache hit ratio • Stale content • Validation • invalidation
  • 16. Webcaching management- nginx • proxy_cache_valid any10m; • proxy_cache_path /var/www/cachelevels=1:2 keys_zone=my-cache:8mmax_size=1000minactive=600m; • proxy_temp_path /var/www/cache/tmp; • proxy_cache_use_staleerrortimeoutupdatinghttp_500http_502http_503http_504; • Location/{ • Proxy_cache my-cache • }
  • 17. Webcaching management-varnish • By Paul Henning Kamp(FreeBSD dev) in 2006 • Reverse proxy cache server • http processor • Optimized for Linux • Custom configuration langage
  • 18. Webcaching management-varnish DAEMON_OPTS="-a:6081 -Tlocalhost:6082 -f/etc/varnish/default.vcl -S/etc/varnish/secret -s malloc,256m“ Subroutines: • subvcl_recv {} • subvcl_hash {} • subvcl_backend_response{} • subvcl_deliver {} … RequestandresponseVCLobject: • Req,bereq,beresp,resp,obj Returnin each subroutine: • Return(pass) • Return(fetch) • Return(deliver) • …
  • 19. Loadbalancing • Trafficisintelligentlydistributedamongstmultipleservers(appinstances) • Features • Optimizing resource utilization • Reducing latency • Ensuring faulttolerance • Someloadbalancingsolutions • Open source • Nginx • Haproxy • Corporate Standard • F5 • Citrix
  • 20. Loadbalancing- comparison NGINX HAPROXY ONLY HTTP TCP BASED On request health check Out of band health check Three algorithmes Multiple algorithmes Complicated tasks based on HTTP infos - HTTP2 & SSL in v 1,9 Only in dev version Free & commercial version Free
  • 21. Loadbalancingwith Nginx • Load balancingmethods • Round robin • Least connected • Ip-hash • Session persistence • Weighted load balancing • Health check(passive)
  • 22. Optimizing Nginx • Numberofworkers • grep processor /proc/cpuinfo | wc –l • Worker_connections • Ulimit –u • LimitingtheBuffer size • client_header_buffer_size 1k; • client_max_body_size 8m; • large_client_header_buffers 2 1k; • Timeouts • client_body_timeout 12; • client_header_timeout 12; • keepalive_timeout 15; • Gzipcompression
  • 23. DEMO • 2 Tomcat • Nginx > tomcat • Nginx if / break / set / rewrite • Nginx headers • Nginx cache • Nginx log + blacklist • Nginx > 2tomcat • Nginx > varnish > tomcat