SlideShare uma empresa 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

Mais conteúdo relacionado

Mais procurados

Learning how AWS implement AWS VPC CNI
Learning how AWS implement AWS VPC CNILearning how AWS implement AWS VPC CNI
Learning how AWS implement AWS VPC CNIHungWei Chiu
 
IBM Spectrum Scale Secure- Secure Data in Motion and Rest
IBM Spectrum Scale Secure- Secure Data in Motion and RestIBM Spectrum Scale Secure- Secure Data in Motion and Rest
IBM Spectrum Scale Secure- Secure Data in Motion and RestSandeep Patil
 
NGINX High-performance Caching
NGINX High-performance CachingNGINX High-performance Caching
NGINX High-performance CachingNGINX, Inc.
 
Nick Fisk - low latency Ceph
Nick Fisk - low latency CephNick Fisk - low latency Ceph
Nick Fisk - low latency CephShapeBlue
 
Ceph Block Devices: A Deep Dive
Ceph Block Devices:  A Deep DiveCeph Block Devices:  A Deep Dive
Ceph Block Devices: A Deep DiveRed_Hat_Storage
 
How to prevent ssh-tunneling using Palo Alto Networks NGFW
How to prevent ssh-tunneling using Palo Alto Networks NGFWHow to prevent ssh-tunneling using Palo Alto Networks NGFW
How to prevent ssh-tunneling using Palo Alto Networks NGFWYudi Arijanto
 
Boosting I/O Performance with KVM io_uring
Boosting I/O Performance with KVM io_uringBoosting I/O Performance with KVM io_uring
Boosting I/O Performance with KVM io_uringShapeBlue
 
GLC webinar: limiting bandwidth using mikrotik
GLC webinar: limiting bandwidth using mikrotikGLC webinar: limiting bandwidth using mikrotik
GLC webinar: limiting bandwidth using mikrotikAchmad Mardiansyah
 
OpenShift 4 installation
OpenShift 4 installationOpenShift 4 installation
OpenShift 4 installationRobert Bohne
 
Private cloud-webinar
Private cloud-webinarPrivate cloud-webinar
Private cloud-webinarWSO2
 
Introduction to Vault
Introduction to VaultIntroduction to Vault
Introduction to VaultKnoldus Inc.
 
Cisco's journey from Verbs to Libfabric
Cisco's journey from Verbs to LibfabricCisco's journey from Verbs to Libfabric
Cisco's journey from Verbs to LibfabricJeff Squyres
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationSuresh Kumar
 
[2018] 오픈스택 5년 운영의 경험
[2018] 오픈스택 5년 운영의 경험[2018] 오픈스택 5년 운영의 경험
[2018] 오픈스택 5년 운영의 경험NHN FORWARD
 
CloudStack Overview
CloudStack OverviewCloudStack Overview
CloudStack Overviewsedukull
 
Interplanetary File System.pptx
Interplanetary File System.pptxInterplanetary File System.pptx
Interplanetary File System.pptxGitam Gadtaula
 
Data Structures in and on IPFS
Data Structures in and on IPFSData Structures in and on IPFS
Data Structures in and on IPFSC4Media
 
Room 1 - 2 - Nguyễn Văn Thắng & Dzung Nguyen - Proxmox VE và ZFS over iscsi
Room 1 - 2 - Nguyễn Văn Thắng & Dzung Nguyen - Proxmox VE và ZFS over iscsiRoom 1 - 2 - Nguyễn Văn Thắng & Dzung Nguyen - Proxmox VE và ZFS over iscsi
Room 1 - 2 - Nguyễn Văn Thắng & Dzung Nguyen - Proxmox VE và ZFS over iscsiVietnam Open Infrastructure User Group
 

Mais procurados (20)

Learning how AWS implement AWS VPC CNI
Learning how AWS implement AWS VPC CNILearning how AWS implement AWS VPC CNI
Learning how AWS implement AWS VPC CNI
 
IBM Spectrum Scale Secure- Secure Data in Motion and Rest
IBM Spectrum Scale Secure- Secure Data in Motion and RestIBM Spectrum Scale Secure- Secure Data in Motion and Rest
IBM Spectrum Scale Secure- Secure Data in Motion and Rest
 
Nginx
NginxNginx
Nginx
 
NGINX High-performance Caching
NGINX High-performance CachingNGINX High-performance Caching
NGINX High-performance Caching
 
Nick Fisk - low latency Ceph
Nick Fisk - low latency CephNick Fisk - low latency Ceph
Nick Fisk - low latency Ceph
 
Ceph Block Devices: A Deep Dive
Ceph Block Devices:  A Deep DiveCeph Block Devices:  A Deep Dive
Ceph Block Devices: A Deep Dive
 
How to prevent ssh-tunneling using Palo Alto Networks NGFW
How to prevent ssh-tunneling using Palo Alto Networks NGFWHow to prevent ssh-tunneling using Palo Alto Networks NGFW
How to prevent ssh-tunneling using Palo Alto Networks NGFW
 
Boosting I/O Performance with KVM io_uring
Boosting I/O Performance with KVM io_uringBoosting I/O Performance with KVM io_uring
Boosting I/O Performance with KVM io_uring
 
Kubernetes networking & Security
Kubernetes networking & SecurityKubernetes networking & Security
Kubernetes networking & Security
 
GLC webinar: limiting bandwidth using mikrotik
GLC webinar: limiting bandwidth using mikrotikGLC webinar: limiting bandwidth using mikrotik
GLC webinar: limiting bandwidth using mikrotik
 
OpenShift 4 installation
OpenShift 4 installationOpenShift 4 installation
OpenShift 4 installation
 
Private cloud-webinar
Private cloud-webinarPrivate cloud-webinar
Private cloud-webinar
 
Introduction to Vault
Introduction to VaultIntroduction to Vault
Introduction to Vault
 
Cisco's journey from Verbs to Libfabric
Cisco's journey from Verbs to LibfabricCisco's journey from Verbs to Libfabric
Cisco's journey from Verbs to Libfabric
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
[2018] 오픈스택 5년 운영의 경험
[2018] 오픈스택 5년 운영의 경험[2018] 오픈스택 5년 운영의 경험
[2018] 오픈스택 5년 운영의 경험
 
CloudStack Overview
CloudStack OverviewCloudStack Overview
CloudStack Overview
 
Interplanetary File System.pptx
Interplanetary File System.pptxInterplanetary File System.pptx
Interplanetary File System.pptx
 
Data Structures in and on IPFS
Data Structures in and on IPFSData Structures in and on IPFS
Data Structures in and on IPFS
 
Room 1 - 2 - Nguyễn Văn Thắng & Dzung Nguyen - Proxmox VE và ZFS over iscsi
Room 1 - 2 - Nguyễn Văn Thắng & Dzung Nguyen - Proxmox VE và ZFS over iscsiRoom 1 - 2 - Nguyễn Văn Thắng & Dzung Nguyen - Proxmox VE và ZFS over iscsi
Room 1 - 2 - Nguyễn Văn Thắng & Dzung Nguyen - Proxmox VE và ZFS over iscsi
 

Semelhante 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
 

Semelhante 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

WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%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
 
%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
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...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
 
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 Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%+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
 

Último (20)

WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%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
 
%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
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
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...
 
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 Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+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...
 

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