34
Apache Traffic Server HTTP Proxy Server on the Edge Leif Hedstrom Engineer [email protected] [email protected]

Velocity 2010 - ATS

Embed Size (px)

DESCRIPTION

Apache Traffic Server presentation, at Velocity 2010.

Citation preview

Page 1: Velocity 2010 - ATS

Apache Traffic ServerHTTP Proxy Server on the Edge

Leif HedstromEngineer

[email protected]@apache.org

Page 2: Velocity 2010 - ATS

Agenda

History and background of Traffic Server

Brief introduction to HTTP intermediaries

Concurrency problems (and solutions)

Choosing an intermediary

Building a CDN

TCP connection management

Server Load Balancer (if time permits)

Page 3: Velocity 2010 - ATS

Origins of the software

Page 4: Velocity 2010 - ATS

Open Source benefits

Page 5: Velocity 2010 - ATS

Forward Proxy

Page 6: Velocity 2010 - ATS

Reverse Proxy

Page 7: Velocity 2010 - ATS

Intercepting Proxy

Page 8: Velocity 2010 - ATS

The concurrency problem

Page 9: Velocity 2010 - ATS

Solution 1: Multithreading

Page 10: Velocity 2010 - ATS

Problems with multi-threading

Page 11: Velocity 2010 - ATS

Solution 2: Event Processing

Page 12: Velocity 2010 - ATS

Problems with event processors

Page 13: Velocity 2010 - ATS

Traffic Server threads model

Page 14: Velocity 2010 - ATS

Plenty of FOSS Proxy Servers

Page 15: Velocity 2010 - ATS

Choosing an intermediary

Page 16: Velocity 2010 - ATS

SMP Scalability and performance

Page 17: Velocity 2010 - ATS

Traffic Server performance

350,000 requests / sec in production CDN- 30 Gbps / second

Max capacity is at least 10x normal usage, to deal with massive spikes.

85,000 requests / sec with small content out of cache, for a single (lab) box

3.6Gbps out of a single box, with larger content (4x GigE NIC bonded)

(all numbers from Y! CDN and lab testing).

Page 18: Velocity 2010 - ATS

HTTP/1.1 Features

Page 19: Velocity 2010 - ATS

Ease of use, extensible

Page 20: Velocity 2010 - ATS

Traffic Server making Ops easy

Traffic Server will restart automatically if it crashes

Traffic Server will kill itself if it isn’t responding

Traffic Server can reload most configurations without server restarts

Adding plugins is a matter of dropping in the shared object, and restarting

Stats and configurations are accessible via command line utilities

Page 21: Velocity 2010 - ATS

Example evaluation sheet

ATS HAproxy nginx Squid Varnish mod_proxy

Worker Threads Y N N N Y Y

Multi-Process N Y Y N Y Y

Event-driven Y Y Y Y N N?

Plugin APIs Y N Y part Y Y

Forward Proxy Y N N Y N Y

Reverse Proxy Y Y Y Y Y Y

Transp. Proxy N Y Y Y N N

Load Balancer part Y! Y Y Y Y

Cache Y N Y Y Y Y

ESI soon N N Y Y N

ICP Y N N Y N N

Keep-Alive Y N Y Y Y Y

SSL Y N Y Y N Y

Pipeline Y N Y Y N Y

Page 22: Velocity 2010 - ATS

Operations is important!

Page 23: Velocity 2010 - ATS

Yahoo! Traffic Server Use Cases

Page 24: Velocity 2010 - ATS

Content Delivery Network

Page 25: Velocity 2010 - ATS

CDN on the Edge

Page 26: Velocity 2010 - ATS

Traffic Server CDN configuration

CONFIG proxy.config.http.server_port INT 80CONFIG proxy.config.cache.ram_cache.size INT 512MBCONFIG proxy.config.url_remap.remap_required INT 1

map http://cdn.example.com/js http://js.example.comreverse_map http://js.example.com http://cdn.example.com/js

map http://cdn.example.com/css http://css.example.comreverse_map http://css.example.com http://cdn.exampe.com/css

map http://cdn.example.com/img http://img.example.comreverse_map http://img.example.com http://cdn.example.com/img

/dev/sd2

Page 27: Velocity 2010 - ATS

Common enemies of performance

Page 28: Velocity 2010 - ATS

TCP 3-way Handshake

Page 29: Velocity 2010 - ATS

Congestion avoidance

Page 30: Velocity 2010 - ATS

TCP Connection Management

Page 31: Velocity 2010 - ATS

Why Server Load Balancers?

Page 32: Velocity 2010 - ATS

Server Load Balancer

Page 33: Velocity 2010 - ATS

Executive Summary Understand your requirements

Evaluate available solutions

Building a CDN is easy

Apache Traffic Server is

- Fast and SMP scalable

- HTTP/1.1 compliant

- Battle hardened

- Easy to configure and operate

- Actively developed

- Free as in beer

Page 34: Velocity 2010 - ATS

trafficserver.apache.org