SlideShare ist ein Scribd-Unternehmen logo
1 von 50
An introduction to Apache
         Traffic Server


Leif Hedstrom
December 2011
Who am I?
• One of the drivers to open source Traffic
  Server (at Yahoo)
• Committer for Apache Traffic Server
• VP of Apache Traffic Server PMC
• ASF member
• Go Daddy’s Principal Architect for Hosting

                   zwoop@apache.org
                    @zwoop
                    +zwoop
History of Traffic Server


          Inkt omi          Yahoo            A pache
       T raffic Server   T raffic Server   T raffic Server




1995           2000         2005             2010
Plenty of FOSS Proxy Servers
Features
                   ATS    HAproxy   ngin   Squid    Varnish    mod_proxy
                                     x
Worker Threads      Y       N        N      N         Y           Y
Multi-Process       N       Y        Y      N         Y           Y
Event-driven        Y       Y        Y      Y      sometimes      Y
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      weak     Y        Y      Y         Y           Y
Persistent Cache    Y       N        Y      Y        sorta        Y
ESI                 Y       N        N      Y        kinda        N
ICP                soon     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
Mandatory useless benchmark …

              120,000

              100,000

               80,000
 Throughput




               60,000

               40,000

               20,000

                   0
                        ATS 2.1.9       Nginx 0.8.53   Varnish 2.1.5

                                    Req / sec
Less useless benchmark …
             120,000                                                       4.0
                                                                           3.5
             100,000




                                                                                 Time to firt res p onse
                                                                           3.0
              80,000
Throughput




                                                                           2.5
              60,000                                                       2.0




                                                                                       s
                                                                           1.5
              40,000
                                                                           1.0
              20,000
                                                                           0.5
                  0                                                        0.0
                       ATS 2.1.9          Nginx 0.8.53     Varnish 2.1.5

                                   Req / sec      Latency (ms)
Intermediaries - Forward Proxy
Intermediaries - Reverse Proxy
Intermediaries - Intercepting Proxy
Web Cash?




            http://www.flickr.com/photos/amagill/3366720659/
No, Web Cache!




           http://www.flickr.com/photos/dglazkov/287092560/
Common enemies of performance

3-Way handshake

     Congestion control

            DNS lookups
Common enemies of performance

3-Way handshake
TCP 3-way Handshake
Common enemies of performance




     Congestion control
Congestion control
Common enemies of performance




            DNS lookups
http://news.example.com/
http://finance.example.com/
http://groups.example.com/
vs
http://www.example.com/news
http://www.example.com/finance
http://www.example.com/groups
The concurrency problem
Solution 1: Multithreading

       Single CPU               Dual CPU

       Thread 1            Thread 1        Thread 2

                                             Thread 3
            Thread 2
                           Thread 1

              Thread 3
                                Thread 3
       Thread 1



              Thread 3




     Time                Time
Problems with multi-threading


      "When two trains approach each other at a
       crossing, both shall come to a full stop
        and neither shall start up again until
                the other has gone."

      From Wikipedia, Illogical statute passed by Kansas legislation .
Solution 2: Event Processing
         Scheduled        Network       Disk I/O
          events           events       events




                           Queue




                        Event
                        Loop

         Disk            HTTP state         Accept
        handler           machine           handler




                  Can generate new events
Problems with event processors
Asynchronous event processor

                                   Asynchronous event processor




   RAM cache
                                               ...
                                                                  n threads per core




                                   Asynchronous event processor




   Disk cache
                                          Disk I/O thread

                                          Disk I/O thread
                                               ...
                                                                  m threads per disk




                                          Disk I/O thread
                Shared Resources

 Configs
Reloadable




                                     Accept threads (per port)

                                         Logging threads
                                                                                       Traffic Server threads model




   etc.
Stats, logs
                                                                        ~10 threads




                                      Various "admin" threads
http://www.flickr.com/photos/stuartpilbrow/3345896050
plugin.config      ip_allow.config
records.config     storage.config
partition.config   logs_xml.config
hosting.config     parent.config
cache.config       remap.config
update.config      icp.config
records.config for reverse proxy
CONFIG proxy.config.http.server_port INT 80
CONFIG proxy.config.cache.ram_cache.size INT 1G
CONFIG proxy.config.cache.ram_cache_cutoff INT 1M
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.http.negative_caching_enabled INT 1
CONFIG proxy.config.http.negative_caching_lifetime INT 120
CONFIG proxy.config.http.cache.ignore_client_cc_max_age
INT 1
CONFIG proxy.config.http.normalize_ae_gzip INT 1
records.config for reverse proxy
CONFIG proxy.config.http.server_port INT 80



CONFIG proxy.config.reverse_proxy.enabled INT 1
CONFIG proxy.config.url_remap.remap_required INT 1
records.config for forward proxy
CONFIG proxy.config.http.server_port INT 8080



CONFIG proxy.config.reverse_proxy.enabled INT 0
CONFIG proxy.config.url_remap.remap_required INT 0
remap.config examples
map http://www.example.com/css http://css.example.com
map http://www.example.com http://real.example.com
reverse_map http://real.example.com http://www.example.com

redirect http://example.com http://www.example.com

regex_map http://(.*).example.com http://o.example.com/$1

map / http://kitchensink.example.com
remap.config examples
map http://www.example.com/css http://css.example.com
map http://www.example.com http://real.example.com
remap.config examples


reverse_map http://real.example.com http://www.example.com
remap.config examples




regex_map http://(.*).example.com http://o.example.com/$1
remap.config examples




map / http://kitchensink.example.com
Some interesting features
RAM: Optional compression
 –Various compression levels supported
 –Very fast (virtually no overhead using the faster algo)
RAM: Several cache eviction algorithms
 –CLFUS algorithm avoids the classic problem on an LRU
  during “scans”
Disk: Supports various block sizes (SSD)
Disk: Can be tuned for various object sizes
Disk: No file system overhead (RAW disks)
Future directions
Release early, and often
Full IPv6 support
NPN, SNI and other SSL improvements
Improved memory management, support
 debug features in e.g. jemalloc and tcmalloc
Optimizations for SSD (“stacked” caches)
More focus on plugins, and plugin APIs
 –Hopefully a real load balancer plugin!
Was this a huge waste of time, or?




             http://www.flickr.com/photos/simpologist/16734948/
A versatile tool




               http://www.flickr.com/photos/airosan/2232394342/
                                                              41
Yes, it’s fast, ridiculously fast




                                    42
A vibrant community!




            The
                  Apache
Software Foundation
http://www.apache.org/



                         43
Artur Bergman tells us if we’re
 not using SSD drives, we’re
       wasting our lives.
I’d say, if you are not using a
caching proxy, you’re wasting
           your SSDs!
46
Contact me




             47
records.config for reverse proxy




CONFIG proxy.config.http.cache.ignore_client_cc_max_age
INT 1
CONFIG proxy.config.http.normalize_ae_gzip INT 1
Four Horseman of Bad Performance
–Data copies
–Context Switches
–Memory allocation
–Lock contention




–Avoid these!

                 http://pl.atyp.us/content/tech/servers.html
Disk cache: “Cyclone”

Weitere ähnliche Inhalte

Was ist angesagt?

PHP Performance with APC + Memcached
PHP Performance with APC + MemcachedPHP Performance with APC + Memcached
PHP Performance with APC + Memcached
Ford AntiTrust
 
Choosing A Proxy Server - Apachecon 2014
Choosing A Proxy Server - Apachecon 2014Choosing A Proxy Server - Apachecon 2014
Choosing A Proxy Server - Apachecon 2014
bryan_call
 
High Concurrency Architecture and Laravel Performance Tuning
High Concurrency Architecture and Laravel Performance TuningHigh Concurrency Architecture and Laravel Performance Tuning
High Concurrency Architecture and Laravel Performance Tuning
Albert Chen
 
초보자를 위한 분산 캐시 이야기
초보자를 위한 분산 캐시 이야기초보자를 위한 분산 캐시 이야기
초보자를 위한 분산 캐시 이야기
OnGameServer
 

Was ist angesagt? (20)

Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APC
 
PHP Performance with APC + Memcached
PHP Performance with APC + MemcachedPHP Performance with APC + Memcached
PHP Performance with APC + Memcached
 
Improving PHP Application Performance with APC
Improving PHP Application Performance with APCImproving PHP Application Performance with APC
Improving PHP Application Performance with APC
 
Find bottleneck and tuning in Java Application
Find bottleneck and tuning in Java ApplicationFind bottleneck and tuning in Java Application
Find bottleneck and tuning in Java Application
 
(CMP402) Amazon EC2 Instances Deep Dive
(CMP402) Amazon EC2 Instances Deep Dive(CMP402) Amazon EC2 Instances Deep Dive
(CMP402) Amazon EC2 Instances Deep Dive
 
Varnish Configuration Step by Step
Varnish Configuration Step by StepVarnish Configuration Step by Step
Varnish Configuration Step by Step
 
Apache Performance Tuning: Scaling Up
Apache Performance Tuning: Scaling UpApache Performance Tuning: Scaling Up
Apache Performance Tuning: Scaling Up
 
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
 
Peter Zaitsev "18 ways to fix MySQL bottlenecks"
Peter Zaitsev "18 ways to fix MySQL bottlenecks"Peter Zaitsev "18 ways to fix MySQL bottlenecks"
Peter Zaitsev "18 ways to fix MySQL bottlenecks"
 
Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...Anton Moldovan "Building an efficient replication system for thousands of ter...
Anton Moldovan "Building an efficient replication system for thousands of ter...
 
Apc presentation
Apc presentationApc presentation
Apc presentation
 
Kafka Summit SF 2017 - One Day, One Data Hub, 100 Billion Messages: Kafka at ...
Kafka Summit SF 2017 - One Day, One Data Hub, 100 Billion Messages: Kafka at ...Kafka Summit SF 2017 - One Day, One Data Hub, 100 Billion Messages: Kafka at ...
Kafka Summit SF 2017 - One Day, One Data Hub, 100 Billion Messages: Kafka at ...
 
[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기[245] presto 내부구조 파헤치기
[245] presto 내부구조 파헤치기
 
Choosing A Proxy Server - Apachecon 2014
Choosing A Proxy Server - Apachecon 2014Choosing A Proxy Server - Apachecon 2014
Choosing A Proxy Server - Apachecon 2014
 
High Concurrency Architecture and Laravel Performance Tuning
High Concurrency Architecture and Laravel Performance TuningHigh Concurrency Architecture and Laravel Performance Tuning
High Concurrency Architecture and Laravel Performance Tuning
 
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013
Integrating multiple CDN providers at Etsy - Velocity Europe (London) 2013
 
How to optimize CloudLinux OS limits
How to optimize CloudLinux OS limitsHow to optimize CloudLinux OS limits
How to optimize CloudLinux OS limits
 
초보자를 위한 분산 캐시 이야기
초보자를 위한 분산 캐시 이야기초보자를 위한 분산 캐시 이야기
초보자를 위한 분산 캐시 이야기
 
vSphere vStorage: Troubleshooting Performance
vSphere vStorage: Troubleshooting PerformancevSphere vStorage: Troubleshooting Performance
vSphere vStorage: Troubleshooting Performance
 
Troubleshooting redis
Troubleshooting redisTroubleshooting redis
Troubleshooting redis
 

Andere mochten auch

Eman Jaheen Resume 2(1)- e.jaheen@outlook
Eman  Jaheen Resume 2(1)- e.jaheen@outlookEman  Jaheen Resume 2(1)- e.jaheen@outlook
Eman Jaheen Resume 2(1)- e.jaheen@outlook
Eman Jaheen
 
Car one magazine_ Invierno 2012
Car one magazine_ Invierno 2012Car one magazine_ Invierno 2012
Car one magazine_ Invierno 2012
EmeGe SocialMedia
 
Biomarker Analyst_Presentation_For_Client
Biomarker Analyst_Presentation_For_ClientBiomarker Analyst_Presentation_For_Client
Biomarker Analyst_Presentation_For_Client
Camille Diges
 

Andere mochten auch (20)

Apache con 2011 gd
Apache con 2011 gdApache con 2011 gd
Apache con 2011 gd
 
Introduction to karen bloomfield
Introduction to karen bloomfieldIntroduction to karen bloomfield
Introduction to karen bloomfield
 
Rit 2011 ats
Rit 2011 atsRit 2011 ats
Rit 2011 ats
 
Traffic Server を使ってみた
Traffic Server を使ってみたTraffic Server を使ってみた
Traffic Server を使ってみた
 
Traffic server overview
Traffic server overviewTraffic server overview
Traffic server overview
 
Name one gay club/bar for each of these global cities? And a little descripti...
Name one gay club/bar for each of these global cities? And a little descripti...Name one gay club/bar for each of these global cities? And a little descripti...
Name one gay club/bar for each of these global cities? And a little descripti...
 
Prospectiva Universitaria en Venezuela
Prospectiva Universitaria en VenezuelaProspectiva Universitaria en Venezuela
Prospectiva Universitaria en Venezuela
 
Eman Jaheen Resume 2(1)- e.jaheen@outlook
Eman  Jaheen Resume 2(1)- e.jaheen@outlookEman  Jaheen Resume 2(1)- e.jaheen@outlook
Eman Jaheen Resume 2(1)- e.jaheen@outlook
 
Pal oil mill machines
Pal oil mill machinesPal oil mill machines
Pal oil mill machines
 
Vetbiz smart technology tools
Vetbiz smart technology toolsVetbiz smart technology tools
Vetbiz smart technology tools
 
Story To Reflect Upon 25,26
Story To Reflect Upon 25,26Story To Reflect Upon 25,26
Story To Reflect Upon 25,26
 
11.4
11.411.4
11.4
 
Media Monitoring als Erfolgsfaktor - Beispiel M-Adaptive
Media Monitoring als Erfolgsfaktor - Beispiel M-AdaptiveMedia Monitoring als Erfolgsfaktor - Beispiel M-Adaptive
Media Monitoring als Erfolgsfaktor - Beispiel M-Adaptive
 
Conor2011
Conor2011Conor2011
Conor2011
 
Informatica bb 2011
Informatica bb 2011Informatica bb 2011
Informatica bb 2011
 
Car one magazine_ Invierno 2012
Car one magazine_ Invierno 2012Car one magazine_ Invierno 2012
Car one magazine_ Invierno 2012
 
Presentación Pacto de Socios para certificado de profesionalidad
Presentación Pacto de Socios para certificado de profesionalidadPresentación Pacto de Socios para certificado de profesionalidad
Presentación Pacto de Socios para certificado de profesionalidad
 
Biomarker Analyst_Presentation_For_Client
Biomarker Analyst_Presentation_For_ClientBiomarker Analyst_Presentation_For_Client
Biomarker Analyst_Presentation_For_Client
 
Semana 2 actividad 2.2 función de un lms - josé jaime ruiz - ges
Semana 2   actividad 2.2 función de un lms - josé jaime ruiz - gesSemana 2   actividad 2.2 función de un lms - josé jaime ruiz - ges
Semana 2 actividad 2.2 función de un lms - josé jaime ruiz - ges
 
Mise en œuvre d’une solution biométrique d’authentification forte
Mise en œuvre d’une solution biométrique d’authentification forteMise en œuvre d’une solution biométrique d’authentification forte
Mise en œuvre d’une solution biométrique d’authentification forte
 

Ähnlich wie Usenix lisa 2011

Varnish, The Good, The Awesome, and the Downright Crazy
Varnish, The Good, The Awesome, and the Downright CrazyVarnish, The Good, The Awesome, and the Downright Crazy
Varnish, The Good, The Awesome, and the Downright Crazy
Mike Willbanks
 
Varnish, The Good, The Awesome, and the Downright Crazy.
Varnish, The Good, The Awesome, and the Downright Crazy.Varnish, The Good, The Awesome, and the Downright Crazy.
Varnish, The Good, The Awesome, and the Downright Crazy.
Mike Willbanks
 
Supercharging Cassandra - GOTO Amsterdam
Supercharging Cassandra - GOTO AmsterdamSupercharging Cassandra - GOTO Amsterdam
Supercharging Cassandra - GOTO Amsterdam
Acunu
 
Virtual Network Performance Challenge
Virtual Network Performance ChallengeVirtual Network Performance Challenge
Virtual Network Performance Challenge
Stephen Hemminger
 

Ähnlich wie Usenix lisa 2011 (20)

Varnish Cache
Varnish CacheVarnish Cache
Varnish Cache
 
Varnish, The Good, The Awesome, and the Downright Crazy
Varnish, The Good, The Awesome, and the Downright CrazyVarnish, The Good, The Awesome, and the Downright Crazy
Varnish, The Good, The Awesome, and the Downright Crazy
 
Varnish, The Good, The Awesome, and the Downright Crazy.
Varnish, The Good, The Awesome, and the Downright Crazy.Varnish, The Good, The Awesome, and the Downright Crazy.
Varnish, The Good, The Awesome, and the Downright Crazy.
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
Deployment de Rails
Deployment de RailsDeployment de Rails
Deployment de Rails
 
Varnish Cache - International PHP Conference Fall 2012
Varnish Cache - International PHP Conference Fall 2012Varnish Cache - International PHP Conference Fall 2012
Varnish Cache - International PHP Conference Fall 2012
 
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
Asynchronous Architectures for Implementing Scalable Cloud Services - Evan Co...
 
Cold Hard Cache
Cold Hard CacheCold Hard Cache
Cold Hard Cache
 
Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.js
 
Everyday tools and tricks for scaling Node.js
Everyday tools and tricks for scaling Node.jsEveryday tools and tricks for scaling Node.js
Everyday tools and tricks for scaling Node.js
 
vert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVMvert.x - asynchronous event-driven web applications on the JVM
vert.x - asynchronous event-driven web applications on the JVM
 
Optimizing wordpress
Optimizing wordpressOptimizing wordpress
Optimizing wordpress
 
Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!
 
Embrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with RippleEmbrace NoSQL and Eventual Consistency with Ripple
Embrace NoSQL and Eventual Consistency with Ripple
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
 
Building WebSocket and Server Side Events Applications using Atmosphere
Building WebSocket and Server Side Events Applications using AtmosphereBuilding WebSocket and Server Side Events Applications using Atmosphere
Building WebSocket and Server Side Events Applications using Atmosphere
 
Supercharging Cassandra - GOTO Amsterdam
Supercharging Cassandra - GOTO AmsterdamSupercharging Cassandra - GOTO Amsterdam
Supercharging Cassandra - GOTO Amsterdam
 
Ruby Proxies for Scale, Performance, and Monitoring - GoGaRuCo - igvita.com
Ruby Proxies for Scale, Performance, and Monitoring - GoGaRuCo - igvita.comRuby Proxies for Scale, Performance, and Monitoring - GoGaRuCo - igvita.com
Ruby Proxies for Scale, Performance, and Monitoring - GoGaRuCo - igvita.com
 
Open stack in sina
Open stack in sinaOpen stack in sina
Open stack in sina
 
Virtual Network Performance Challenge
Virtual Network Performance ChallengeVirtual Network Performance Challenge
Virtual Network Performance Challenge
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Usenix lisa 2011

Hinweis der Redaktion

  1. Worked on Traffic Server both at Yahoo, and at Apache.Before we go on, lets do a show of hands. How many have or are using a Proxy server of some sort?How many of you are or were using Squid ?There’s still hope for you.
  2. Traffic Server started as a commercial product, developed and sold by Inktomi way back in the days Yahoo! Acquired Inktomi in 2003, and the software was shelved. Yahoo! needed a reverse proxy to build their own CDN, and squid was not a viable option. So, we took ATS off the shelves again, and made it run on our RHEL distros. In 2009, Y! donated the Traffic Server source code to the Apache Software Foundation. In April of 2010, Apache Traffic Server became a TLP.
  3. Traffic Server is obviously not the only HTTP intermediary in the Open Source community. Existing servers include Apache mod_proxy, Squid, NGINX, Varnish and Haproxy. This makes the task of choosing a Proxy server an interesting, but challenging task. You really need to understand your problem space, your requirements, and any restrictions (like, budget). Easy for me to pick, but lets discuss some of the considerations you should take.
  4. I hate this slide, because by the time I do the presentation, this table is already wrong, and you can bet that someone in the audience will point it out! So, please look at this for the next 10 seconds, and then come to me after the presentation and complain.
  5. The point here is that performance of modern proxy servers is already ridiculous. Other things are more important, such as latency, or features.
  6. The point here is that performance of modern proxy servers is already ridiculous. Other things are more important, such as latency, or features.
  7. * Before we go into details of what drives Traffic Server, and how we use it, let me briefly discuss the three most common proxy server configurations.* In a forward proxy, the web browser has to be manually (or via auto-PAC files etc.) configured to use a proxy server for all (or some) requests. The browser typically sends the “full” URL as part of the GET request.The forward proxy typically is not required to be configured for “allowed” destination addresses, but can be configured with Access Control List, or blacklists controlling what requests are allowed, and by whom. A forward proxy is typically allowed to cache content, and a common use case scenario is inside corporate firewalls.
  8. A reverse proxy, aka a web accelerator, does not require the browser to cooperate in any special way. As far as the user (browser) is concerned, it looks like it’s talking to any other HTTP web server on the internet. The reverse proxy server on the other hand must be explicitly configured for what traffic it should handle, and how such requests are properly routed to the backend servers (aka. Origin Servers). Just as with a forward proxy, many reverse proxies are configured to cache content locally. It can also help load balancing and redundancy on the Origin Servers, and help solve difficult problems like Ajax routing.
  9. An intercepting proxy, also commonly called a transparent proxy, is very similar to a forward proxy, except the client (browser) does not require any special configuration. As far as the user is concerned, the proxying happens completely transparently. A transparent proxy will intercerpt the HTTP requests, modify them accordingly, and typically “forge” the source IP before forwarding the request to the final destination. Transparent proxies usually also implements traffic filters and monitoring, allowing for strict control of what HTTP traffic passes through the mandatory proxy layer. Typical use cases include ISPs and very strictly controlled corporate firewalls. I’m very excited to announce that as of a few days ago, code for transparent proxy is available in the subversion tree.
  10. * The obvious use case of a proxy is as a cache.
  11. Sorry, not cash, content cache. The idea is to offload traffic from the origin servers, your web servers, to the proxy cache.This has obvious advantages, such as easier to scale, easier to manage, and higher availabilityAnd finally, what most people associate a web cache for, you can move content closer to the user, on the “edge”.
  12. Before we go into the next use case scenario, lets discuss a couple of common problems that can severely affect your web sites performance.There are several reasons why a Web page might be slow to render, three common problems that I personally have to deal with are TCP 3-way handshake, TCP congestion control, and DNS lookups. We’ll discuss the first two here, and explain what we’ve done at Yahoo! using Traffic Server to alleviate these two problems.
  13. Before we go into the next use case scenario, lets discuss a couple of common problems that can severely affect your web sites performance.There are several reasons why a Web page might be slow to render, three common problems that I personally have to deal with are TCP 3-way handshake, TCP congestion control, and DNS lookups. We’ll discuss the first two here, and explain what we’ve done at Yahoo! using Traffic Server to alleviate these two problems.
  14. In TCP, every new connection has to go through a setup phase, typically referred to as the 3-way handshake. As you can see from the picture above, this means that there’s a full round-trip worth of latency before the client can even send the first HTTP request to the server. Since latency introduced by 3-way handshake is associated with network round-trip time, it goes without saying that the longer the distance between the client and the server, the longer the latency until the HTTP request can be sent. The solution to this problem is generally to use HTTP keep-alive between the client and server, which is a major reason why it is so critical for Traffic Server, and other intermediaries, to be able to handle tens of thousands of concurrent connections.
  15. Before we go into the next use case scenario, lets discuss a couple of common problems that can severely affect your web sites performance.There are several reasons why a Web page might be slow to render, three common problems that I personally have to deal with are TCP 3-way handshake, TCP congestion control, and DNS lookups. We’ll discuss the first two here, and explain what we’ve done at Yahoo! using Traffic Server to alleviate these two problems.
  16. TCP congestion avoidance is a mechanism for TCP to avoid congestion on our networks. There are many different implementations of TCP congestion control mechanisms, but the general idea is to start out ‘slow’, and increase the amount of packets we have outstanding on the wires before we wait for an acknowledgement from the receiver. This is why sometimes congestion control is referred to as “slow start”. Similar to 3-way handshake, this will introduce latencies which are directly related to the round-trip time between client and server. Keep-alive generally doesn‘t solve this, since by default (sometimes configurable) an idle connection will force the restart of another slow start.
  17. Before we go into the next use case scenario, lets discuss a couple of common problems that can severely affect your web sites performance.There are several reasons why a Web page might be slow to render, three common problems that I personally have to deal with are TCP 3-way handshake, TCP congestion control, and DNS lookups. We’ll discuss the first two here, and explain what we’ve done at Yahoo! using Traffic Server to alleviate these two problems.
  18. Looks familiar?
  19. Looks familiar?
  20. Alright, so lets talk about what problems a good HTTP (and/or proxy server) can solve. There are two primary concurrency problems for the server software developers to consider:How can the software handle tens of thousands of concurrent TCP connections?How can the software take advantage of modern multi-core CPUs? Commodity hardware today has 2, or 4 and even 8 or more cores in each server.* Additionally, while solving these two problems, we have to make sure we don’t introduce other resource starvations, for example, memory pressure.
  21. Multithreading allows a process to split itself, and run multiple tasks in “parallel”. There is significantly less overhead running threads compared to individual processes, but threads are still not free. They need memory resources, and incur context switches. It’s a known methodology for solving the concurrency problem, and many, many server implementations relies heavily on threads. Modern OS’es have good support for threads, and standard libraries are widely available.
  22. Deadlocks, where two threads (or processes) need to acquire the same two resources (e.g. locks), which can cause the application to completely stall (unrecoverable) Race conditions can occur, where the outcome is not deterministic, but depends on timing or scheduling of threads execution. Difficult to code and ‘get right’.
  23. Events are scheduled by the event loop, and event handlers execute specific code for specific events This makes it easier to code for, there’s no risk of deadlock or race condition Can handle a good number of connections (but not unlimited) Squid is a good example of an event driven server.
  24. Can not block on I/O or the entire event processor stall CPU intensive processing in an event handler can starve pending events for CPU (solution: Cooperative multi-tasking, where the event handler yields the CPU) Latency can become an issue if an event processor has to handle a lot of events Can only use one CPU / core
  25. There are n worker threads per core, typically 2. This gives around 16 – 24 threads of execution threads on typical modern hardware, each running an event loop There are m I/O threads per disk spindle. This is used to deal with disk I/O outside of the worker threads, and the default is 4. A critical configuration decision here is to scale this appropriately, particularly if a “disk” is raided, and might have more than 1 spindle under the hood. There are also a small number of “helper” threads, to do tasks like accepting new connections, produce log output and stats aggregation and presentation* All threads share resources, such as RAM and Disk cache, configurations, stats and logs.
  26. When people first look at the ATS configurations, this is usually their reaction.But, it’s actually the complete oppositeGood defaults, in most cases you don’t have to change anythingMost configurations can be reloaded without restartMost features are readily configurable in readable formats.
  27. Traffic Server comes with a fairly large number of configuration files. Most of the configurations have reasonable “defaults”. Most applications wouldn’t use even a fraction of the available configuration options and features.
  28. Getting started, only two or maybe three configuration files are necessary to tweak. records.config is a key-value configuration format, holding most global application configuration settings storage.config is used to specify disk storage configurations remap.config is used to specify mapping rules for rewriting requests, typically in a reverse proxy setup
  29. * Now, the big question, was this a huge waste of your time at the end of a long day?I really hope that it was not, and here’s why
  30. * Apache Traffic Server is a great, versatile tool readily available, and it’s free!
  31. * Apache Traffic Server is fast, ridiculously fast. If it’s not fast enough for your needs, please let us know, and please hire some developers, because you probably can afford it.
  32. * And of course, Traffic Server has a very vibrant community, as a top-level Apache project.
  33. * And finally, I’d like to thank Go Daddy to not only let me play with fun technology all day, they also pay my bills
  34. First time I met some of the original developers of Traffic Server, John Plevyak and George Paul both mentioned the “four horsemen”Foundational belief held by some of the original developers of Traffic Server
  35. * RAW disks, striped and monitored internally* Very low overhead on CPU and disk I/O, since there is no LRU to manage Very low memory overhead (10 bytes per object stored on cache, compare to 60-70 bytes for Squid) Can support very large disks (0.5PB per “partition”)