Discover the very wide world of web servers, in addition to the basic web deliverance fonctionnality, we will cover the reverse proxy, the resource caching and the load balancing.
Nginx and apache HTTPD will be used as web server and reverse proxy, and to illustrate some caching features we will also present varnish a powerful caching server.
To introduce load balancers we will compare between Nginx and Haproxy.
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
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
17. Webcaching management-varnish
• By Paul Henning Kamp(FreeBSD dev) in
2006
• Reverse proxy cache server
• http processor
• Optimized for Linux
• Custom configuration langage
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)