Oscon 2010 - ATS


Published on

Apache Traffic Server presentation at Oscon 2010.

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Oscon 2010 - ATS

  1. 1. Driving Apache Traffic Server <ul><li>Leif Hedstrom </li></ul><ul><li>Engineer, Yahoo Inc. </li></ul><ul><li>[email_address] </li></ul><ul><li>[email_address] </li></ul><ul><li>@zwoop </li></ul>
  2. 2. http://www.flickr.com/photos/zackbrescia/3292033740/
  3. 3. <ul><li>History and introduction to intermediaries </li></ul><ul><li>Configuration </li></ul><ul><li>Use cases </li></ul>
  4. 4. Origins of the software
  5. 6. Forward Proxy
  6. 7. Reverse Proxy
  7. 8. Intercepting Proxy
  8. 9. Plenty of FOSS Proxy Servers
  9. 10. Choosing an intermediary
  10. 11. SMP Scalability and performance
  11. 12. Traffic Server threads model
  12. 13. Traffic Server performance <ul><li>350,000 requests / sec in production CDN </li></ul><ul><ul><li>30 Gbps / second (95-percentile) </li></ul></ul><ul><li>Many more request handled for HTML </li></ul><ul><li>105,000 requests / sec with small content out of cache, for a single (lab) box </li></ul><ul><li>3.6Gbps out of a single box, with larger content (4x GigE NIC bonded) </li></ul><ul><li>(all numbers from Y! CDN and lab testing). </li></ul>
  13. 14. HTTP/1.1 Features
  14. 15. 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
  15. 16. Ease of use, extensible
  16. 17. http://www.flickr.com/photos/stuartpilbrow/3345896050/
  17. 18. Traffic Server making Ops easy <ul><li>Traffic Server will restart automatically if it crashes </li></ul><ul><li>Traffic Server will kill itself if it isn’t responding </li></ul><ul><li>Traffic Server can reload most configurations without server restarts </li></ul><ul><li>Adding plugins is a matter of dropping in the shared object, and restarting </li></ul><ul><li>Stats and configurations are accessible via command line utilities </li></ul>
  18. 20. Configurations
  19. 23. Critical in records.config <ul><li>CONFIG proxy.config.exec_thread.autoconfig INT 1 </li></ul><ul><li>CONFIG proxy.config.exec_thread.autoconfig.scale FLOAT 2.0 </li></ul><ul><li>CONFIG proxy.config.exec_thread.limit INT 2 </li></ul><ul><li>CONFIG proxy.config.http.server_port INT 8080 </li></ul><ul><li>CONFIG proxy.config.http.cache.http INT 1 </li></ul><ul><li>CONFIG proxy.config.cache.ram_cache.size INT 512M </li></ul><ul><li>CONFIG proxy.config.reverse_proxy.enabled INT 1 </li></ul><ul><li>CONFIG proxy.config.url_remap.remap_required INT 1 </li></ul><ul><li>CONFIG proxy.config.url_remap.pristine_host_hdr INT 0 </li></ul><ul><li>CONFIG proxy.config.ssl.enabled INT 0 </li></ul><ul><li>CONFIG proxy.config.ssl.server.cert.filename STRING server.pem </li></ul>
  20. 24. <ul><li>CONFIG proxy.config.url_remap.remap_required INT 1 </li></ul>
  21. 25. <ul><li>CONFIG proxy.config.url_remap.remap_required INT 0 </li></ul>
  22. 26. QUICK DEMO
  23. 27. Use Case : Content Delivery Network
  24. 28. CDN on the Edge
  25. 29. Traffic Server CDN configuration CONFIG proxy.config.http.server_port INT 80 CONFIG proxy.config.cache.ram_cache.size INT 4096M CONFIG proxy.config.url_remap.remap_required INT 1 map http://cdn.example.com/js http://js.example.com reverse_map http://js.example.com http://cdn.example.com/js map http://cdn.example.com/css http://css.example.com reverse_map http://css.example.com http://cdn.exampe.com/css map http://cdn.example.com/img http://img.example.com reverse_map http://img.example.com http://cdn.example.com/img /dev/sd2
  26. 30. Common enemies of performance
  27. 31. TCP 3-way Handshake
  28. 32. Congestion avoidance
  29. 33. Use case : TCP Connection Management
  30. 34. ATS Connection mgmt configuration CONFIG proxy.config.http.server_port INT 80 CONFIG proxy.config.cache.ram_cache.size INT 0 CONFIG proxy.config.url_remap.remap_required INT 1 CONFIG proxy.config.http.send_http11_requests INT 1 CONFIG proxy.config.http.share_server_sessions INT 1 CONFIG proxy.config.http.server_max_connections INT 2000 CONFIG proxy.config.http.keep_alive_no_activity_timeout_out INT 60 CONFIG proxy.config.http.transaction_no_activity_timeout_out INT 60 map http://www.example.com/ http://real-www.example.com
  31. 35. Executive Summary <ul><li>Understand your requirements </li></ul><ul><li>Evaluate available solutions </li></ul><ul><li>Building a CDN is easy </li></ul><ul><li>Apache Traffic Server is </li></ul><ul><ul><li>Fast and SMP scalable </li></ul></ul><ul><ul><li>Battle hardened </li></ul></ul><ul><ul><li>HTTP/1.1 compliant </li></ul></ul><ul><ul><li>Easy to configure and manage </li></ul></ul><ul><ul><li>Actively developed </li></ul></ul><ul><ul><li>Free as in beer! (Now lets go have some) </li></ul></ul>
  32. 36. trafficserver.apache.org
  33. 37. The concurrency problem
  34. 38. Solution 1: Multithreading
  35. 39. Problems with multi-threading
  36. 40. Solution 2: Event Processing
  37. 41. Problems with event processors