Choosing A Proxy Server OSCON 2014 Bryan Call Yahoo.

Slides:



Advertisements
Similar presentations
Out and About with Apache Traffic Server Leif Hedstrom November 2011.
Advertisements

Getting to 2nd Base with your Content Delivery Network Mike Brittain Engineering Architect.
Chapter 10 Performance and Reliability. Objectives Explain performance, workload, throughput, capacity, response time, and latency Describe a process.
HTTP HyperText Transfer Protocol. HTTP Uses TCP as its underlying transport protocol Uses port 80 Stateless protocol (i.e. HTTP Server maintains no information.
HTTP – HyperText Transfer Protocol
Chapter 9 Application Layer, HTTP Professor Rick Han University of Colorado at Boulder
Web Proxy. Computer Center, CS, NCTU 2 Proxy  Proxy A proxy server is a server which services the requests of its clients by:  Making requests to other.
1 HTTP – HyperText Transfer Protocol Part 1. 2 Common Protocols In order for two remote machines to “ understand ” each other they should –‘‘ speak the.
Load Balance of Tomcat with Apache by George Fu, UCCS CS 526 Semester Project Spring 2009.
How the web works: HTTP and CGI explained
What’s a Web Cache? Why do people use them? Web cache location Web cache purpose There are two main reasons that Web cache are used:  to reduce latency.
Web architecture Dr Jim Briggs Web architecture.
The World Wide Web and the Internet Dr Jim Briggs 1WUCM1.
World Wide Web WeeSan Lee
 What is it ? What is it ?  URI,URN,URL URI,URN,URL  HTTP – methods HTTP – methods  HTTP Request Packets HTTP Request Packets  HTTP Request Headers.
Fronting Tomcat with Apache Httpd Mladen Turk Red Hat, Inc.
1 Caching  Temporary storage of frequently accessed data (duplicating original data stored somewhere else)  Reduces access time/latency for clients 
Web. Computer Center, CS, NCTU 2 Outline  Web hosting Basics Client-Server architecture HTTP protocol Static vs. dynamic pages Virtual hosts  Proxy.
Basics of the HTTP Protocol and Apache Web Server Brandon Checketts.
Lighttpd & Modcache 2009/06/28. Basic lighttpd info Event-driven, single process Event-driven, single process Uses non-block io (network) + writev (memory)
Human-Computer Interface Course 5. ISPs and Internet connection.
Web Server Design Week 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/10/10.
HTTP Caching & Cache-Busting for Content Publishers Michael J. Radwin O’Reilly Open Source Convention July 28, 2004.
Java Technology and Applications
HTTP Protocol Specification
Web Caching: Replication on the World Wide Web Jonathan Bulava CSC8530 – Distributed Systems Dr. Paul Schragger.
CSC 2720 Building Web Applications Getting and Setting HTTP Headers (With PHP Examples)
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
Application Layer 2 Figures from Kurose and Ross
Maryam Elahi University of Calgary – CPSC 441.  HTTP stands for Hypertext Transfer Protocol.  Used to deliver virtually all files and other data (collectively.
Web Proxy Squid Setup. A proxy is a host which relays web access requests from clients a proxy server is an application program that acts as an intermediary.
Sistem Jaringan dan Komunikasi Data #9. DNS The Internet Directory Service  the Domain Name Service (DNS) provides mapping between host name & IP address.
The Power of mod_proxy Proxy servers, load balancers and how to implement with Apache HTTP Server.
Web Services CSCI N321 – System and Network Administration Copyright © 2007,2008 by Scott Orr and the Trustees of Indiana University.
The HyperText Transfer Protocol. History HTTP has been in use since 1990 (HTTP/0.9) HTTP/1.0 was defined in RFC 1945 (May 1996) and included metainformation.
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
1 Introductory material. This module illustrates the interactions of the protocols of the TCP/IP protocol suite with the help of an example. The example.
Proxy Lab Recitation I Monday Nov 20, 2006.
Web Server Design Week 8 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/3/10.
1 CS 4396 Computer Networks Lab TCP/IP Networking An Example.
HyperText Transfer Protocol (HTTP) RICHI GUPTA CISC 856: TCP/IP and Upper Layer Protocols Fall 2007 Thanks to Dr. Amer, UDEL for some of the slides used.
HTTP1 Hypertext Transfer Protocol (HTTP) After this lecture, you should be able to:  Know how Web Browsers and Web Servers communicate via HTTP Protocol.
Providing Differentiated Levels of Service in Web Content Hosting Jussara Almeida, etc... First Workshop on Internet Server Performance, 1998 Computer.
 Proxy › A proxy server is a server which services the requests of its clients by:  Making requests to other servers  Caching some results for further.
NCACHE The fast web cache server base on nginx Use aio sendfile and epoll modules The self sort share mem hash index High performance and large storage.
HTTP/2 and ATS ATS Fall Summit 2015 Bryan Call. Why HTTP/2? Reduce latency and TCP connection overhead Easier to write well-performing sites (no domain.
Web Technologies Lecture 1 The Internet and HTTP.
HTTP Here, we examine the hypertext transfer protocol (http) – originally introduced around 1990 but not standardized until 1997 (version 1.0) – protocol.
EE 122: Lecture 21 (HyperText Transfer Protocol - HTTP) Ion Stoica Nov 20, 2001 (*)
1 10/19/05CS360 Windows Programming ASP.NET. 2 10/19/05CS360 Windows Programming ASP.NET  ASP.NET works on top of the HTTP protocol  Takes advantage.
Overview of Servlets and JSP
LURP Details. LURP Lab Details  1.Given a GET … call a proxy CGI script in the same way you would for a normal CGI request  2.This UDP perl.
Web Caching. Why Caching? Faster browsing experience for users Cache hit rate Traffic Prioritization Reduce network bandwidth requirements significantly.
Overview on Web Caching COSC 513 Class Presentation Instructor: Prof. M. Anvari Student name: Wei Wei ID:
Providing Differentiated Levels of Service in Web Content Hosting J ussara Almeida, Mihaela Dabu, Anand Manikutty and Pei Cao First Workshop on Internet.
WEB1P webarch1 Web architecture Dr Jim Briggs. WEB1P webarch2 What is the web? Distributed system Client-server system Characteristics of clients and.
Web Cache. What is Cache? Cache is the storing of data temporarily to improve performance. Cache exist in a variety of areas such as your CPU, Hard Disk.
Speeding Up Alfresco and Share using Nginx Reverse/Caching Frontend Proxy Ishara Fernando Senior Linux Systems Administrator.
Speeding Up Alfresco and Share using Nginx Reverse/Caching Frontend Proxy Ishara Fernando Senior Linux Systems Administrator.
Web Server Design Week 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2012 Michael L. Nelson 02/07/12.
Driving Apache Traffic Server Leif Hedstrom Engineer, Yahoo Inc. @zwoop.
REST API Design. Application API API = Application Programming Interface APIs expose functionality of an application or service that exists independently.
Fiddler and Your Website Robert Boedigheimer. About Me Web developer since 1995 Columnist for aspalliance.com Pluralsight Author 3 rd Degree Black Belt,
Lecture 4: Stateful Inspection, Advanced Protocols.
DEPLOYING SPDY: 5 “GOTCHAS” TO WATCH OUT FOR BY FASIHULLAH ASKIRI.
Web Cacheability of CRLs David Groep, Jan 26 th, 2009.
Web.
Web.
Securing the Network Perimeter with ISA 2004
Web hwlin1414.
Presentation transcript:

Choosing A Proxy Server OSCON 2014 Bryan Call Yahoo

About Me Apache – Committer and PMC for Apache Traffic Server (ATS) – Apache Member IETF – HTTP/2 – TLS – TCP Enhancement Yahoo – WebRing, GeoCities, People Search, Personals, Tiger Team, Platform Architect, Edge Group, Network Research, Apache/IETF

Overview Types of Proxies Features Architecture Cache Architecture Performance Pros and Cons

How are you going to use a proxy server?

Reverse Proxy

Proxy in front of your own web servers Caching? Geographic location? Connection handling? SSL termination? SPDY support? Adding business logic?

Forward Proxy

Intercepting Proxy

Forward / Intercepting Proxy Proxy in front of the Internet Configure clients to use proxy? Caching? SSL - CONNECT? SSL - termination?

Choices

Plenty of Proxy Servers PerlBal

Plenty of Proxy Servers

Features And Options

Features ATSNGiNXSquidVarnishApache httpd mod_proxy Reverse ProxyYYYYY Forward ProxyYNYNY Transp. ProxyYNYNY Plugin APIsYYpartialYY CacheYYYYY ESIYNYpartialN ICPYNYNN SSLYYYNY SPDYYYNNpartial

SSL Features Source: - Ilya Grigorik

What type of proxy do you need? Of our candidates, only three fully supports all proxy modes

HTTP/1.1 Compliance

Accept-Encoding - gzip Vary Age If-None-Match

How things can go wrong: Vary $ curl -D - -o /dev/null -s --compress HTTP/ OK Server: nginx/1.3.9 Date: Wed, 12 Dec :00:48 GMT Content-Type: text/html; charset=utf-8 Content-Length: 8051 Connection: keep-alive Cache-Control: public, max-age=900 Last-Modified: Wed, 12 Dec :52: Expires: Sun, 19 Nov :00:00 GMT Vary: Cookie,Accept-Encoding Content-Encoding: gzip

How things can go wrong: Vary $ curl -D - -o /dev/null -s HTTP/ OK Server: nginx/1.3.9 Date: Wed, 12 Dec :00:57 GMT Content-Type: text/html; charset=utf-8 Content-Length: 8051 Connection: keep-alive Cache-Control: public, max-age=900 Last-Modified: Wed, 12 Dec :52: Expires: Sun, 19 Nov :00:00 GMT Vary: Cookie,Accept-Encoding Content-Encoding: gzip EPIC FAIL! Note: no gzip request

CoAdvisor HTTP protocol quality tests for reverse proxies 49% 81% 51% 68%

25% 6% 27% 15%

Architecture

Architecture And Process Models Multithreading Events Process Fibers – Co-operative multitasking, getcontext/setcontext

Threads

Pros – Easy to share memory – Lightweight context switching Cons – Easy to (accidently) share memory Overwriting another threads memory – Locking Deadlocks, race conditions, starvation

Event Processing

Problems with Event Processing Doesn’t work well with blocking APIs – open(), locking It doesn’t scale on SMP by itself

Process Model And Architecture ATSNGiNXSquidVarnishApache httpd mod_proxy ThreadsXXX EventsXXXpartialX ProcessesXXX

Caching Architecture

Cache Mainly two types – File system – Database like In memory index – Bytes per object Minimize disk seeks and system calls

Cache ATSNGiNXSquidVarnishApache httpd mod_cache File systemXXX mmapX Raw disk/direct IOXX Ram cacheXX Memory indexXXX* Persistent cacheXXXX

Performance Testing

ATS Configuration etc/trafficserver/remap.config: map / etc/trafficserver/records.config: CONFIG proxy.config.http.server_ports STRING 80 CONFIG proxy.config.accept_threads INT 3

NGiNX Configuration worker_processes 24; access_log logs/access.log main; proxy_cache_path /mnt/nginx_cache levels=1:2 keys_zone=my-cache:8m max_size=16384m inactive=600m; proxy_temp_path /mnt/nginx_temp; server { set $ae ""; if ($http_accept_encoding ~* gzip) { set $ae "gzip"; } location / { proxy_pass proxy_cache my-cache; proxy_set_header If-None-Match ""; proxy_set_header If-Modified-Since ""; proxy_set_header Accept-Encoding $ae; proxy_cache_key $uri$is_args$args$ae; } location ~ /purge_it(/.*) { proxy_cache_purge example.com $1$is_args$args$myae }

Squid Configuration http_access allow all http_port 80 accel workers 24 cache_mem 4096 MB memory_cache_shared on cache_dir rock /usr/local/squid/cache 1000 max-size=32768 cache_peer origin.example.com parent 80 0 no-query originserver

Varnish Configuration backend default {.host = ”origin.example.com”;.port = "80"; }

Varnish Configuration (Cont) sudo /usr/local/sbin/varnishd -f /usr/local/etc/varnish/default.vcl -p thread_pool_max=4000 sudo /usr/local/sbin/varnishd -f /usr/local/etc/varnish/default.vcl -p thread_pool_max=2000 -p thread_pool_add_delay=2 -p thread_pool_min=200 sudo /usr/local/sbin/varnishd -f /usr/local/etc/varnish/default.vcl -p thread_pool_max=2000 -p thread_pool_add_delay=2 -p thread_pool_min=1000 -p session_linger=0 sudo /usr/local/sbin/varnishd -f /usr/local/etc/varnish/default.vcl -p thread_pool_max=2000 -p thread_pool_add_delay=2 -p thread_pool_min=1000 -p session_linger=10

Apache httpd Configuration LoadModule cache_module modules/mod_cache.so LoadModule cache_disk_module modules/mod_cache_disk.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so Include conf/extra/httpd-mpm.conf ProxyPass / CacheRoot /usr/local/apache2/cache CacheEnable disk / CacheDirLevels 5 CacheDirLength 3 MaxKeepAliveRequests 10000

Benchmark 1 1,000 clients 8KB response 100% cache hit Keep-alive on 100K rps rate limited

Squid used the most CPU and the worst median latency 95 th percentile latency with NiGNX, Squid and httpd

Benchmark 2 1,000 clients 8KB response 100% cache hit Keep-alive off

Squid used the most CPU again NGiNX had latency issues ATS most throughput

ATS Pros – Scales well automatically, little config needed – Best cache implementation Cons – Too many config files – Too many options in the default config files (5.x fixed this)

NGiNX Pros – Lots of plugins – FastCGI support Cons – HTTP/1.1 compliance – Latency issues around accepting new connections – Rebuild server for new plugins

Squid Pros – Best HTTP/1.1 compliance Cons – Memory index for cache using 10x that of ATS – Least efficient with CPU – Worst median latency for keep-alive benchmarks

Varnish Pros – VCL (Varnish Configuration Language) Can do a lot without writing plugins Cons – Thread per connection – mmap for cache Persistence is experimental – No SSL or SPDY support

Apache httpd Pros – Lots of plugins – Most used http server – Best 95 th percentile latency for non-keep-alive Cons – SPDY Support

Why ATS? Scales well – CPU Usage, auto config Cache scales well – Efficient memory index, minimizes seeks Apache Community Plugin support – Dynamic loading of plugins and easy to port existing plugins over

References ATS - NGiNX - Squid - Varnish - Apache httpd -