Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Rit 2011 ats


Published on

My Apache Traffic Server presentation for RIT++ in Russia, 2011.

Published in: Technology
  • Be the first to comment

Rit 2011 ats

  1. 1. Apache Traffic Server<br />Leif Hedstrom<br />Principal Architect, Akamai Technologies<br /><br /><br />@zwoop<br />
  2. 2. History and introduction<br />Choosing a proxy<br />Setup<br />
  3. 3. Origins of the software<br />
  4. 4.
  5. 5. Why HTTP proxy / cache?<br />Better performance<br />Save money (or other scarce resources)<br />Make operations less of a pain in the …<br />Easier web development<br />Better user experience<br /> Lets look at the three common HTTP proxy configurations <br />
  6. 6. Forward Proxy<br />
  7. 7. Reverse Proxy<br />
  8. 8. Intercepting Proxy<br />
  9. 9. Plenty of FOSS Proxy Servers<br />
  10. 10. Choosing an intermediary<br />
  11. 11. SMP Scalability and performance<br />
  12. 12. Four Horseman of Bad Performance<br />Data copies<br />Context Switches<br />Memory allocation<br />Lock contention<br />Avoid these!<br /><br />
  13. 13. Traffic Server threads model<br />
  14. 14. Event Processing<br />
  15. 15. Disk cache: “Cyclone”<br /><br />
  16. 16. Some interesting features<br />RAM: Optional compression<br />Various compression levels supported<br />Very fast (virtually no overhead using the faster algo)<br />RAM: Several cache eviction algorithms<br />CLFUS algorithm avoids the classic problem on an LRU during “scans”<br />And it’s not encumbered by any patents<br />Disk: Supports various block sizes (e.g. SSD)<br />Disk: Can be tuned for various object sizes<br />Disk: No file system overhead (RAW disks)<br />
  17. 17. Clustering<br /><br />
  18. 18. Traffic Server performance<br />400,000 requests / sec in a production CDN<br />50 Gbps / second (95-percentile)<br />Many more request handled for HTML<br />100,000 requests / sec with small content out of RAM cache, on a single (lab) quad-core<br />3.6Gbps out of a single box, with larger content (4x GigE NIC bonded)<br />19Gbps on “localhost” using 2 CPUs (for large objects, 1MB in the test)<br />
  19. 19. HTTP/1.1 Features<br />
  20. 20.
  21. 21. Ease of use, extensible<br />
  22. 22.<br />
  23. 23. Traffic Server making Ops easy<br />Traffic Server will restart automatically if it crashes<br />Traffic Server will kill itself if it isn’t responding<br />Traffic Server can reload most configurations without server restarts<br />Adding plugins is a matter of dropping in the shared object, and restarting<br />Speaking of plugins, we have a very flexible plugin APIs for C/C++ developers (hopefully some scripted languages soon)<br />Stats and configurations are accessible via command line utilities<br />
  24. 24. Configurations<br />
  25. 25. plugin.config<br />records.config<br />volume.config<br />hosting.config<br />cache.config<br />update.config<br />ip_allow.config<br />storage.config<br />logs_xml.config<br />parent.config<br />remap.config<br />icp.config<br />
  26. 26. records.config<br />storage.config<br />remap.config<br />
  27. 27. Critical in records.config<br />CONFIG proxy.config.exec_thread.autoconfig INT 1<br />CONFIG proxy.config.exec_thread.autoconfig.scale FLOAT 2.0<br />CONFIG proxy.config.exec_thread.limit INT 2<br />CONFIG proxy.config.http.server_port INT 8080<br />CONFIG proxy.config.http.cache.http INT 1<br />CONFIG proxy.config.cache.ram_cache.size INT 512M<br />CONFIG proxy.config.reverse_proxy.enabled INT 1<br />CONFIG proxy.config.url_remap.remap_required INT 1<br />CONFIG proxy.config.url_remap.pristine_host_hdr INT 0<br />CONFIG proxy.config.ssl.enabled INT 0<br />CONFIG proxy.config.ssl.server.cert.filename STRING server.pem<br />
  28. 28. CONFIG proxy.config.url_remap.remap_required INT 1<br />CONFIG proxy.config.reverse_proxy.enabled INT 1<br />
  29. 29. CONFIG proxy.config.url_remap.remap_required INT 0<br />CONFIG proxy.config.reverse_proxy.enabled INT 0<br />
  30. 30. Content on the Edge<br />
  31. 31. Traffic Server configuration<br />CONFIG proxy.config.http.server_port INT 80CONFIG proxy.config.cache.ram_cache.size INT 4096M<br />CONFIG proxy.config.url_remap.remap_required INT 1<br />map<br />reverse_map<br />map<br />reverse_map<br />map<br />reverse_map<br />/dev/sd2<br />
  32. 32. Enemies of Web performance<br />
  33. 33. TCP 3-way Handshake<br />
  34. 34. Congestion avoidance<br />
  35. 35. TCP Connection Management<br />
  36. 36. ATS Connection mgmt configuration<br />CONFIG proxy.config.http.server_port INT 80CONFIG proxy.config.cache.ram_cache.size INT 0<br />CONFIG proxy.config.url_remap.remap_required INT 1<br />CONFIG proxy.config.http.send_http11_requests INT 1<br />CONFIG proxy.config.http.share_server_sessions INT 1<br />CONFIG proxy.config.http.server_max_connections INT 2000<br />CONFIG proxy.config.http.keep_alive_no_activity_timeout_out INT 60<br />CONFIG proxy.config.http.transaction_no_activity_timeout_out INT 60<br />map<br />
  37. 37. Executive Summary<br />Understand your requirements<br />Evaluate available software, services and solutions<br />Apache Traffic Server is<br />Fast and SMP scalable<br />Battle hardened<br />HTTP/1.1 compliant<br />Easy to configure and manage<br />Extensible<br />Actively developed<br />And of course, it’s free!<br />
  38. 38. Content Delivery: Correctness first<br />
  39. 39.
  40. 40. The concurrency problem<br />
  41. 41. Solution 1: Multithreading<br />
  42. 42. Problems with multi-threading<br />