Oscon 2010 - ATS

41
Driving Apache Traffic Server Leif Hedstrom Engineer, Yahoo Inc. [email protected] [email protected] @zwoop

description

Apache Traffic Server presentation at Oscon 2010.

Transcript of Oscon 2010 - ATS

Page 1: Oscon 2010 - ATS

Driving Apache Traffic Server

Leif HedstromEngineer, Yahoo Inc.

[email protected]@apache.org

@zwoop

Page 2: Oscon 2010 - ATS

http://www.flickr.com/photos/zackbrescia/3292033740/

Page 3: Oscon 2010 - ATS

History and introduction to intermediaries

Configuration

Use cases

Page 4: Oscon 2010 - ATS

Origins of the software

Page 5: Oscon 2010 - ATS
Page 6: Oscon 2010 - ATS

Forward Proxy

Page 7: Oscon 2010 - ATS

Reverse Proxy

Page 8: Oscon 2010 - ATS

Intercepting Proxy

Page 9: Oscon 2010 - ATS

Plenty of FOSS Proxy Servers

Page 10: Oscon 2010 - ATS

Choosing an intermediary

Page 11: Oscon 2010 - ATS

SMP Scalability and performance

Page 12: Oscon 2010 - ATS

Traffic Server threads model

Page 13: Oscon 2010 - ATS

Traffic Server performance350,000 requests / sec in production CDN

- 30 Gbps / second (95-percentile)Many more request handled for HTML105,000 requests / sec with small content

out of cache, for a single (lab) box3.6Gbps out of a single box, with larger

content (4x GigE NIC bonded)

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

Page 14: Oscon 2010 - ATS

HTTP/1.1 Features

Page 15: Oscon 2010 - ATS

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 Y Y N 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 16: Oscon 2010 - ATS

Ease of use, extensible

Page 17: Oscon 2010 - ATS

http://www.flickr.com/photos/stuartpilbrow/3345896050/

Page 18: Oscon 2010 - ATS

Traffic Server making Ops easyTraffic 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 19: Oscon 2010 - ATS
Page 20: Oscon 2010 - ATS

Configurations

Page 21: Oscon 2010 - ATS
Page 22: Oscon 2010 - ATS
Page 23: Oscon 2010 - ATS

Critical in records.configCONFIG proxy.config.exec_thread.autoconfig INT 1

CONFIG proxy.config.exec_thread.autoconfig.scale FLOAT 2.0

CONFIG proxy.config.exec_thread.limit INT 2

CONFIG proxy.config.http.server_port INT 8080

CONFIG proxy.config.http.cache.http INT 1

CONFIG proxy.config.cache.ram_cache.size INT 512M

CONFIG proxy.config.reverse_proxy.enabled INT 1

CONFIG proxy.config.url_remap.remap_required INT 1

CONFIG proxy.config.url_remap.pristine_host_hdr INT 0

CONFIG proxy.config.ssl.enabled INT 0

CONFIG proxy.config.ssl.server.cert.filename STRING server.pem

Page 24: Oscon 2010 - ATS

CONFIG proxy.config.url_remap.remap_required INT 1

Page 25: Oscon 2010 - ATS

CONFIG proxy.config.url_remap.remap_required INT 0

Page 26: Oscon 2010 - ATS

QUICK DEMO

Page 27: Oscon 2010 - ATS

Use Case: Content Delivery Network

Page 28: Oscon 2010 - ATS

CDN on the Edge

Page 29: Oscon 2010 - ATS

Traffic Server CDN configuration

CONFIG proxy.config.http.server_port INT 80CONFIG proxy.config.cache.ram_cache.size INT 4096MCONFIG 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 30: Oscon 2010 - ATS

Common enemies of performance

Page 31: Oscon 2010 - ATS

TCP 3-way Handshake

Page 32: Oscon 2010 - ATS

Congestion avoidance

Page 33: Oscon 2010 - ATS

Use case: TCP Connection Management

Page 34: Oscon 2010 - ATS

ATS Connection mgmt configuration

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

CONFIG proxy.config.http.send_http11_requests INT 1CONFIG proxy.config.http.share_server_sessions INT 1CONFIG proxy.config.http.server_max_connections INT 2000

CONFIG proxy.config.http.keep_alive_no_activity_timeout_out INT 60CONFIG proxy.config.http.transaction_no_activity_timeout_out INT 60

map http://www.example.com/ http://real-www.example.com

Page 35: Oscon 2010 - ATS

Executive Summary Understand your requirements

Evaluate available solutions

Building a CDN is easy

Apache Traffic Server is

- Fast and SMP scalable

- Battle hardened

- HTTP/1.1 compliant

- Easy to configure and manage

- Actively developed

- Free as in beer! (Now lets go have some)

Page 36: Oscon 2010 - ATS

trafficserver.apache.org

Page 37: Oscon 2010 - ATS

The concurrency problem

Page 38: Oscon 2010 - ATS

Solution 1: Multithreading

Page 39: Oscon 2010 - ATS

Problems with multi-threading

Page 40: Oscon 2010 - ATS

Solution 2: Event Processing

Page 41: Oscon 2010 - ATS

Problems with event processors