SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Downloaden Sie, um offline zu lesen
Why Memcached?

Presented by:
         Bill Takacs – Director, Product Management


September 2009
Agenda

     • Ri of th dynamic web
       Rise f the d  i    b


     • Memcached


     • The web architecture


     • The evolution of a dynamic site and Memcached


     • Gear6 solution

2 : Copyright 2009 Gear6 Inc.
The Web: What’s Changed?

     • Population

     • Traffic

     • Content and applications




3 : Copyright 2009 Gear6 Inc.
Web Growth: Population

           Forrester: 2 2 billion people online globally by 2013
                      2.2




4 : Copyright 2009 Gear6 Inc.
Web Growth: Traffic

        Cisco: “Annual global IP traffic
                Annual
     will exceed two-thirds of a zettabyte
         (
         (667 exabytes) in four y
                  y )           years”
                   [by 2013]
                     Source: Cisco Visual Networking Index,
                                  9 June 2009




5 : Copyright 2009 Gear6 Inc.
Web Growth: Application & Content



                                       Entertainment
                                     Social networking

 Static                                   Media          Dynamic
                                      Communication
                                Community-generated content




6 : Copyright 2009 Gear6 Inc.
But growth can be
Growth can be painful
                painful
       (VERY)
Clients
                                                                                                         Internet

                                                                                                                            CDN
                   ➜ Industry standard servers replaced proprietary SMP
                   ➜ Shift to dynamic content puts strain on origin sites



                                                                                 Interface
                   ➜ Most sites (over 65%) based on LAMP or JAVA




                                                                                                                                  Balancer
                                                                                                                    Proxy


                                                                                                                                   Load
                                                                                    Net




                                                                                                            Web
                                                                                                            W
                                                                                                           Se
                                                                                                            ervers
                                                                                                         Apac
                                                                                                            che, Nginx,
                                                                                                           Lighttpd
                                                                                                           L
                                                                            Web Stack

                                                                                                            App
                                                                                                            A
                                                                                                           Se
                                                                                                            ervers
Web Architecture




                                                                                                  PHP, Java, Rails, C
                                                                                                                    C,
                                         )




                                                                                                     Per Python
                                                                                                        rl,
                                                                                                         Database
                                                                                                              MySQL,
                                                                                                              M
                                                                                                            Pos
                                                                                                              stgreSQL
                                (




                                                                                                                                             8 : Copyright 2009 Gear6 Inc.
                                                                                                         Stora
                                                                                                         Stora
                                                                                                         Stora
                                                                                                         Stora
                                                                                                             age Interfac
                                                                                                             age Interfac
                                                                                                             age Interfac
                                                                                                             age Interfac
                                                                                                                        ce:
                                                                                                                        ce:
                                                                                                                        ce:
                                                                                                                        ce:
                                                                                                           file, block, FC, SCS
                                                                                                           file, block, FC, SCS
                                                                                                           file, block, FC, SCS
                                                                                                           file, block, FC, SCS
                                                                                                                              SI
                                                                                                                              SI
                                                                                                                              SI
                                                                                                                              SI




                                                                                               Storage
What to do?




9 : Copyright 2009 Gear6 Inc.
Clients
                                                        Internet

                                                                           CDN
                                Interface




                                                                                 Balancer
                                                                   Proxy


                                                                                  Load
                                   Net




                                                           Webb
                                                          Serve
                                                              ers                           Cache Servers
New Caching Architecture




                                                                                                            Memcached
                                                        Apache, N
                                                                Nginx,
                                                           Lighttp
                                                                 pd
                           Web S k
                           W b Stack




                                                           Appp
                                                          Serve
                                                              ers
                                                 PHP, Java, R
                                                            Rails, C,
                                                    Perl, Pyt
                                                            thon
for Scaling Out


                                                        Databa
                                                             ase
                                                             MySQL,
                                                           PostgreS
                                                                  SQL




                                                                                                                        10 : Copyright 2009 Gear6 Inc.
                                                        Storage Interface:
                                                        Storage Interface:
                                                        Storage Interface:
                                                        Storage Interface:
                                                          file, block, FC, SCSI




                                              Storage
Memcached: Pillar of Web 2.0 Architecture




                                 “Everything runs
                                   from memory
                                    in Web 2.0”
                                  Evan Weaver, Twitter, March 2009



11 : Copyright 2009 Gear6 Inc.
The Fix: Memcached

         “A high performance, distributed memory object caching
              g p            ,                    y    j         g
              system, generic in nature, but intended for use in
            speeding up dynamic web applications by alleviating
                               database load”
                                                 Ref: http://www.danga.com/memcached/

     • Big hash table

     • Created by Danga Interactive for LiveJournal

     • Significantly reduced database load

     • Perfect for web sites with high database load

     • In use by Facebook, Twitter, myYearbook, others

12 : Copyright 2009 Gear6 Inc.
More on Memcached

     • Takes advantage of available DRAM

     • Open source
       Ope sou ce

     • Distributed under BSD license

     • Server - Current version is 1.2.8
           » http://www.danga.com/memcached/download.bml

     • M
       Many clients
             li t
           » http://code.google.com/p/memcached/wiki/Clients


13 : Copyright 2009 Gear6 Inc.
Why Memcached with MySQL?

     • Scale-out of dynamic web sites
                     y

     • Page loads

     • Efficient resource utilization

     • Support for dozens
       to hundreds of nodes

     • Open source




14 : Copyright 2009 Gear6 Inc.
How Does Memcached Work?

                                 • Client - Server

                                 • H h Function
                                   Hash F  ti

                                 • Memcached
                                   » Two stage




15 : Copyright 2009 Gear6 Inc.
Memcached Server

     • Slab allocator

     • Libevent based

     • Simple Protocol (no XML)

     • Server has internal hash table

     • Servers are dumb – they don’t know about each other




16 : Copyright 2009 Gear6 Inc.
Memcached Server

     • Limits
           » Key size = (250 bytes)
           » 1MB Limit
           » 32bit/64bit (maximum size of process)
     • LRU
           » Least recently accessed
             items are cycled out
           » One LRU exists per “slab class”
                                  slab class
           » LRU “evictions” need not
             be common
     • Threads? Yes



17 : Copyright 2009 Gear6 Inc.
Memcached Clients

     • Client hashes key to server list

     • Serializes t e object
       Se a es the

     • Many client libraries
          y

     • Authentication




18 : Copyright 2009 Gear6 Inc.
What about…..

     • Redundancy

     • Failover




19 : Copyright 2009 Gear6 Inc.
Consistent Hashing
     • Why?

     • How does it work?




20 : Copyright 2009 Gear6 Inc.
Commands

     • Storage commands:
           » Set / Add / Replace /
             Append / Prepend / CAS


     • Retrieval commands:
           » Get / Gets


     • Delete / increment /
       decrement

     • Stats


21 : Copyright 2009 Gear6 Inc.
Memcached UDFs for MySQL


     • Suite of functions that
       work with Memcached
       and MySQL

     • Leverage power of
       SQL Engine

     • Combine tasks
                                  mySQL
     • Open source
                                 application
                                  pp

22 : Copyright 2009 Gear6 Inc.
Putting it all together

                        Client 1
                        Client-1      Client 2
                                      Client-2            Client 3
                                                          Client-3




                                                      C
                           Server X    Server Y           Server Z

                                      Key = value
                                        y
                                      Foo = seattle
23 : Copyright 2009 Gear6 Inc.
Evolution of a Dynamic Site #1
     A day in the life of a growing web service


    Event: Site has growth in
   number of users, sessions,                          Action: Replicate database
  page views and apps, causing                       (and/or add more app servers)
   excessive read load on DB



                                                           App Server       App Server       App Server
   App Server           App Server   App Server   App Server       App Server    App Server



                        write

                        read                                   write            …    write
                                                               read                  read
                     MySQL                                MySQL                     MySQL




24 : Copyright 2009 Gear6 Inc.
Evolution of a Dynamic Site #2
     A day in the life of a growing web service


  Event: Individual caches on the                                Action: Add memcached server
        app/db servers are                                        on servers with underutilized
  overwhelmed from chaotic, non-                                 memory resources… results in
   deterministic content access                                   even fewer reads to database



                                                                            memcached           memcached          memcached
           App Server            App Server      App Server                App Server          App Server         App Server
                                                               memcached           memcached          memcached
                                                              App Server          App Server        App Server
App Server         App Server         App Server




             write
               it                  …     write
                                           it                              write
                                                                             it                  …      write
                                                                                                          it
             read                        read                              read                         read
          MySQL                        MySQL                           MySQL                          MySQL




25 : Copyright 2009 Gear6 Inc.
Evolution of a Dynamic Site #3
     A day in the life of a growing web service


     Event: Memcached needs
    more memory resources than                                         Action: Move Memcached
     what are available on other                                      servers to dedicated servers
          (shared) servers


              memcached           memcached          memcached
             App Server          App Server         App Server             App Server             App Server      App Server
 memcached           memcached          memcached
App Server          App Server        App Server                 App Server          App Server        App Server

                                                                    memcached         memcached         …         memcached




             write                 …      write                               write                 …     write
             read                         read                                read                        read
          MySQL                         MySQL                             MySQL                         MySQL




26 : Copyright 2009 Gear6 Inc.
What Memcached is NOT:

                                 A persistent data store


                                 A database


                                 Application-specific


                                 A large object cache


                                 Fault-tolerant or highly available

27 : Copyright 2009 Gear6 Inc.
Memcached: Best Practices

                                 • Use with MySQL :-)
                                             y Q    )

                                 • Use on 64-bit servers

                                 • Cache “expensive
                                   operations”

                                 • Cache bi-directionally
                                   (
                                   (read/write)
                                              )

                                 • Design to withstand
                                   failures gracefully

                                 • Use consistent hashing

28 : Copyright 2009 Gear6 Inc.
Memcached: Best Practices (cont’d)

     • Careful with numbers of connections
           » Peak
           » Transitions


     • Evictions
           » Segment Memcached data into separate pools


     • O ti i sizing: instances and pools
       Optimize i i   i t         d    l

     • Instrumentation



29 : Copyright 2009 Gear6 Inc.
Memcache Use Cases

          Site Type                  Repeatable Use

          Social networking          Profile caching

          Content aggregation        HTML/page caching

          Ad targeting               Cookie/profile tracking

          Gaming and entertainment   Session caching

          Location-based services    DB query scaling

          Relationship
          R l ti   hi                Session caching
                                     S   i      hi

          E-commerce                 Session and HTML caching

30 : Copyright 2009 Gear6 Inc.
Use Case Example:
     Session Management

                                              • 4m+ daily visitors

                           Web Servers        • 15k hits/sec
                                              • 6k updates/sec
                   Application S
                               Servers with   • Tens of thousands of
                     Memcached Clients          concurrent connections

                       Memcached Servers
                                              • S
                                                Session tracked and ads
                                                     i   t   k d d d
                                                are placed in accordance
                                                to session
                           MySQL Servers




31 : Copyright 2009 Gear6 Inc.
Useful Memcached Tools

                                  p
                       advanced reporter
                       Track hot keys and clients in Memcached

                       wireshark
                       Dissect and analyze Memcached network traffic

                       brutis
                       Size and test changes to memcache clusters

                       statsproxy
                       View buffered Memcached stats in your browser

                       cacti
                       Graph and analyze Memcached statistics


32 : Copyright 2009 Gear6 Inc.
Statsproxy + Cacti Templates




                                    To use the cacti
                                    templates for
                                    memcached with
                                    statsproxy, you
                                    either need to
                                    modify the
                                    templates to use
                                    port 8080 or
                                    change the
                                    statsproxy config to
                                    use port 11211




33 : Copyright 2009 Gear6 Inc.
About Gear6
  • First and leading provider
    of Memcached solutions

  • Memcached solution including

          • High density

          • High availability

          • Advanced memory
            management

          • Enhanced reporting
            capabilities
                biliti

          • Support for multi-tenancy

          • Disruption free
            software upgrades

          • 100% c e t co pat b e
             00% client compatible


34 : Copyright 2009 Gear6 Inc.
Questions?

                             Thank you for attending our webinar
                                     “Why Memcached”


                                             Bill Takacs
                                                Gear6
                                        salesinfo@gear6.com
                                           +1 650 587 7118



                                 and please visit our web site at:
                                 www.gear6.com
35 : Copyright 2009 Gear6 Inc.
References
     •   Danga.com
     •   Highscalability.com
     •   Dev.gear6.com
     •   Groups.google.com/group/memcached
     •   Code.google.com/p/memcached
     •   Twitter.com/gearsix
     •   Cacti.net
     •   Wireshark.org
     •   http://dev.mysql.com/doc/mysql-ha-scalability/en/ha-memcached-using-
         deployment.html
     •   http://dev.mysql.com/doc/mysql-ha-scalability/en/ha-memcached-using-
         hashtypes.html
     •   http://jayant7k.blogspot.com/2009/04/memcached-replication.html
     •   http://www.lexemetech.com/2007/11/consistent-hashing.html
     •   http://www8.org/w8-papers/2a-
         webserver/caching/paper2.htmlhttp://www.last.fm/user/RJ/journal/2007/04/10/rz_l
         ibketama_-_a_consistent_hashing_algo_for_memcache_clients
     •   http://bazaar.launchpad.net/~libmemcached-
         http://bazaar launchpad net/~libmemcached
         developers/libmemcached/trunk/revision/539
36 : Copyright 2009 Gear6 Inc.

Weitere ähnliche Inhalte

Andere mochten auch

Memcached: What is it and what does it do? (PHP Version)
Memcached: What is it and what does it do? (PHP Version)Memcached: What is it and what does it do? (PHP Version)
Memcached: What is it and what does it do? (PHP Version)Brian Moon
 
Load Balancing from the Cloud - Layer 7 Aware Solution
Load Balancing from the Cloud - Layer 7 Aware SolutionLoad Balancing from the Cloud - Layer 7 Aware Solution
Load Balancing from the Cloud - Layer 7 Aware SolutionImperva Incapsula
 
Memcached: What is it and what does it do?
Memcached: What is it and what does it do?Memcached: What is it and what does it do?
Memcached: What is it and what does it do?Brian Moon
 
L7-L7 Services in a Cloud Datacenter
L7-L7 Services in a Cloud Datacenter L7-L7 Services in a Cloud Datacenter
L7-L7 Services in a Cloud Datacenter Vikas Deolaliker
 
SIMULATION AND PERFORMANCE ANALYSIS OF A LARGE SCALED INTERNET APPLICATION ...
SIMULATION AND PERFORMANCE ANALYSIS OF  A LARGE SCALED INTERNET APPLICATION  ...SIMULATION AND PERFORMANCE ANALYSIS OF  A LARGE SCALED INTERNET APPLICATION  ...
SIMULATION AND PERFORMANCE ANALYSIS OF A LARGE SCALED INTERNET APPLICATION ...ankit_saluja
 
Continuous Deployment
Continuous DeploymentContinuous Deployment
Continuous DeploymentBrian Moon
 

Andere mochten auch (6)

Memcached: What is it and what does it do? (PHP Version)
Memcached: What is it and what does it do? (PHP Version)Memcached: What is it and what does it do? (PHP Version)
Memcached: What is it and what does it do? (PHP Version)
 
Load Balancing from the Cloud - Layer 7 Aware Solution
Load Balancing from the Cloud - Layer 7 Aware SolutionLoad Balancing from the Cloud - Layer 7 Aware Solution
Load Balancing from the Cloud - Layer 7 Aware Solution
 
Memcached: What is it and what does it do?
Memcached: What is it and what does it do?Memcached: What is it and what does it do?
Memcached: What is it and what does it do?
 
L7-L7 Services in a Cloud Datacenter
L7-L7 Services in a Cloud Datacenter L7-L7 Services in a Cloud Datacenter
L7-L7 Services in a Cloud Datacenter
 
SIMULATION AND PERFORMANCE ANALYSIS OF A LARGE SCALED INTERNET APPLICATION ...
SIMULATION AND PERFORMANCE ANALYSIS OF  A LARGE SCALED INTERNET APPLICATION  ...SIMULATION AND PERFORMANCE ANALYSIS OF  A LARGE SCALED INTERNET APPLICATION  ...
SIMULATION AND PERFORMANCE ANALYSIS OF A LARGE SCALED INTERNET APPLICATION ...
 
Continuous Deployment
Continuous DeploymentContinuous Deployment
Continuous Deployment
 

Ähnlich wie How Memcached Helps Web Sites Handle Rapid Growth

Evolution of a Memcached Deployment Webinar 2010 01 13
Evolution of a Memcached Deployment Webinar 2010 01 13Evolution of a Memcached Deployment Webinar 2010 01 13
Evolution of a Memcached Deployment Webinar 2010 01 13Gear6
 
Cloud Scaling with Memcached
Cloud Scaling with MemcachedCloud Scaling with Memcached
Cloud Scaling with MemcachedGear6
 
FinCap Solutions Brochure
FinCap  Solutions BrochureFinCap  Solutions Brochure
FinCap Solutions BrochureCFPuser
 
Cloud Foundry Introduction - Canada - October 2012
Cloud Foundry Introduction - Canada - October 2012Cloud Foundry Introduction - Canada - October 2012
Cloud Foundry Introduction - Canada - October 2012Patrick Chanezon
 
Portrait of the developer as The Artist - SpringOne India 2012
Portrait of the developer as The Artist - SpringOne India 2012Portrait of the developer as The Artist - SpringOne India 2012
Portrait of the developer as The Artist - SpringOne India 2012Patrick Chanezon
 
Introduction to First Commercial Memcached Service for Cloud
Introduction to First Commercial Memcached Service for CloudIntroduction to First Commercial Memcached Service for Cloud
Introduction to First Commercial Memcached Service for CloudGear6
 
Cloud Foundry Demo SD Forum Cloud Sig Feb09
Cloud Foundry Demo SD Forum Cloud Sig Feb09Cloud Foundry Demo SD Forum Cloud Sig Feb09
Cloud Foundry Demo SD Forum Cloud Sig Feb09Chris Richardson
 
Lets make the web faster!
Lets make the web faster! Lets make the web faster!
Lets make the web faster! Surbhi Dangi
 
Virtual Data Centers with OpenStack Quantum
Virtual Data Centers with OpenStack QuantumVirtual Data Centers with OpenStack Quantum
Virtual Data Centers with OpenStack Quantumlaurabeckcahoon
 
Virtual data centers with OpenStack Quantum
Virtual data centers with OpenStack QuantumVirtual data centers with OpenStack Quantum
Virtual data centers with OpenStack QuantumLew Tucker
 
ECM Technical Solution
ECM Technical SolutionECM Technical Solution
ECM Technical SolutionThanh Nguyen
 
Mesh-Enabled Web Applications
Mesh-Enabled Web ApplicationsMesh-Enabled Web Applications
Mesh-Enabled Web Applicationsgoodfriday
 
OpenStack Quantum Network Service
OpenStack Quantum Network ServiceOpenStack Quantum Network Service
OpenStack Quantum Network ServiceLew Tucker
 
Portrait of the Developer as the Artist - OpenTour Sofia
Portrait of the Developer as the Artist - OpenTour SofiaPortrait of the Developer as the Artist - OpenTour Sofia
Portrait of the Developer as the Artist - OpenTour SofiaPatrick Chanezon
 
Portrait of the Developer As "The Artist" - English Version
Portrait of the Developer As "The Artist" - English VersionPortrait of the Developer As "The Artist" - English Version
Portrait of the Developer As "The Artist" - English VersionPatrick Chanezon
 
10 reasons why Nuxeo is using GlassFish
10 reasons why Nuxeo is using GlassFish10 reasons why Nuxeo is using GlassFish
10 reasons why Nuxeo is using GlassFishNuxeo
 
Developing Custom Applications for SAP Enterprise Portal
Developing Custom Applications  for SAP Enterprise Portal Developing Custom Applications  for SAP Enterprise Portal
Developing Custom Applications for SAP Enterprise Portal Bordin Kijsirijareonchai
 
Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012
Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012
Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012Alexandre Morgaut
 
(How) Does VA Smalltalk fit into today's IT landscapes?
(How) Does VA Smalltalk fit into today's IT landscapes?(How) Does VA Smalltalk fit into today's IT landscapes?
(How) Does VA Smalltalk fit into today's IT landscapes?Joachim Tuchel
 
Memcached, presented to LCA2010
Memcached, presented to LCA2010Memcached, presented to LCA2010
Memcached, presented to LCA2010Mark Atwood
 

Ähnlich wie How Memcached Helps Web Sites Handle Rapid Growth (20)

Evolution of a Memcached Deployment Webinar 2010 01 13
Evolution of a Memcached Deployment Webinar 2010 01 13Evolution of a Memcached Deployment Webinar 2010 01 13
Evolution of a Memcached Deployment Webinar 2010 01 13
 
Cloud Scaling with Memcached
Cloud Scaling with MemcachedCloud Scaling with Memcached
Cloud Scaling with Memcached
 
FinCap Solutions Brochure
FinCap  Solutions BrochureFinCap  Solutions Brochure
FinCap Solutions Brochure
 
Cloud Foundry Introduction - Canada - October 2012
Cloud Foundry Introduction - Canada - October 2012Cloud Foundry Introduction - Canada - October 2012
Cloud Foundry Introduction - Canada - October 2012
 
Portrait of the developer as The Artist - SpringOne India 2012
Portrait of the developer as The Artist - SpringOne India 2012Portrait of the developer as The Artist - SpringOne India 2012
Portrait of the developer as The Artist - SpringOne India 2012
 
Introduction to First Commercial Memcached Service for Cloud
Introduction to First Commercial Memcached Service for CloudIntroduction to First Commercial Memcached Service for Cloud
Introduction to First Commercial Memcached Service for Cloud
 
Cloud Foundry Demo SD Forum Cloud Sig Feb09
Cloud Foundry Demo SD Forum Cloud Sig Feb09Cloud Foundry Demo SD Forum Cloud Sig Feb09
Cloud Foundry Demo SD Forum Cloud Sig Feb09
 
Lets make the web faster!
Lets make the web faster! Lets make the web faster!
Lets make the web faster!
 
Virtual Data Centers with OpenStack Quantum
Virtual Data Centers with OpenStack QuantumVirtual Data Centers with OpenStack Quantum
Virtual Data Centers with OpenStack Quantum
 
Virtual data centers with OpenStack Quantum
Virtual data centers with OpenStack QuantumVirtual data centers with OpenStack Quantum
Virtual data centers with OpenStack Quantum
 
ECM Technical Solution
ECM Technical SolutionECM Technical Solution
ECM Technical Solution
 
Mesh-Enabled Web Applications
Mesh-Enabled Web ApplicationsMesh-Enabled Web Applications
Mesh-Enabled Web Applications
 
OpenStack Quantum Network Service
OpenStack Quantum Network ServiceOpenStack Quantum Network Service
OpenStack Quantum Network Service
 
Portrait of the Developer as the Artist - OpenTour Sofia
Portrait of the Developer as the Artist - OpenTour SofiaPortrait of the Developer as the Artist - OpenTour Sofia
Portrait of the Developer as the Artist - OpenTour Sofia
 
Portrait of the Developer As "The Artist" - English Version
Portrait of the Developer As "The Artist" - English VersionPortrait of the Developer As "The Artist" - English Version
Portrait of the Developer As "The Artist" - English Version
 
10 reasons why Nuxeo is using GlassFish
10 reasons why Nuxeo is using GlassFish10 reasons why Nuxeo is using GlassFish
10 reasons why Nuxeo is using GlassFish
 
Developing Custom Applications for SAP Enterprise Portal
Developing Custom Applications  for SAP Enterprise Portal Developing Custom Applications  for SAP Enterprise Portal
Developing Custom Applications for SAP Enterprise Portal
 
Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012
Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012
Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012
 
(How) Does VA Smalltalk fit into today's IT landscapes?
(How) Does VA Smalltalk fit into today's IT landscapes?(How) Does VA Smalltalk fit into today's IT landscapes?
(How) Does VA Smalltalk fit into today's IT landscapes?
 
Memcached, presented to LCA2010
Memcached, presented to LCA2010Memcached, presented to LCA2010
Memcached, presented to LCA2010
 

Kürzlich hochgeladen

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 

Kürzlich hochgeladen (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 

How Memcached Helps Web Sites Handle Rapid Growth

  • 1. Why Memcached? Presented by: Bill Takacs – Director, Product Management September 2009
  • 2. Agenda • Ri of th dynamic web Rise f the d i b • Memcached • The web architecture • The evolution of a dynamic site and Memcached • Gear6 solution 2 : Copyright 2009 Gear6 Inc.
  • 3. The Web: What’s Changed? • Population • Traffic • Content and applications 3 : Copyright 2009 Gear6 Inc.
  • 4. Web Growth: Population Forrester: 2 2 billion people online globally by 2013 2.2 4 : Copyright 2009 Gear6 Inc.
  • 5. Web Growth: Traffic Cisco: “Annual global IP traffic Annual will exceed two-thirds of a zettabyte ( (667 exabytes) in four y y ) years” [by 2013] Source: Cisco Visual Networking Index, 9 June 2009 5 : Copyright 2009 Gear6 Inc.
  • 6. Web Growth: Application & Content Entertainment Social networking Static Media Dynamic Communication Community-generated content 6 : Copyright 2009 Gear6 Inc.
  • 7. But growth can be Growth can be painful painful (VERY)
  • 8. Clients Internet CDN ➜ Industry standard servers replaced proprietary SMP ➜ Shift to dynamic content puts strain on origin sites Interface ➜ Most sites (over 65%) based on LAMP or JAVA Balancer Proxy Load Net Web W Se ervers Apac che, Nginx, Lighttpd L Web Stack App A Se ervers Web Architecture PHP, Java, Rails, C C, ) Per Python rl, Database MySQL, M Pos stgreSQL ( 8 : Copyright 2009 Gear6 Inc. Stora Stora Stora Stora age Interfac age Interfac age Interfac age Interfac ce: ce: ce: ce: file, block, FC, SCS file, block, FC, SCS file, block, FC, SCS file, block, FC, SCS SI SI SI SI Storage
  • 9. What to do? 9 : Copyright 2009 Gear6 Inc.
  • 10. Clients Internet CDN Interface Balancer Proxy Load Net Webb Serve ers Cache Servers New Caching Architecture Memcached Apache, N Nginx, Lighttp pd Web S k W b Stack Appp Serve ers PHP, Java, R Rails, C, Perl, Pyt thon for Scaling Out Databa ase MySQL, PostgreS SQL 10 : Copyright 2009 Gear6 Inc. Storage Interface: Storage Interface: Storage Interface: Storage Interface: file, block, FC, SCSI Storage
  • 11. Memcached: Pillar of Web 2.0 Architecture “Everything runs from memory in Web 2.0” Evan Weaver, Twitter, March 2009 11 : Copyright 2009 Gear6 Inc.
  • 12. The Fix: Memcached “A high performance, distributed memory object caching g p , y j g system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load” Ref: http://www.danga.com/memcached/ • Big hash table • Created by Danga Interactive for LiveJournal • Significantly reduced database load • Perfect for web sites with high database load • In use by Facebook, Twitter, myYearbook, others 12 : Copyright 2009 Gear6 Inc.
  • 13. More on Memcached • Takes advantage of available DRAM • Open source Ope sou ce • Distributed under BSD license • Server - Current version is 1.2.8 » http://www.danga.com/memcached/download.bml • M Many clients li t » http://code.google.com/p/memcached/wiki/Clients 13 : Copyright 2009 Gear6 Inc.
  • 14. Why Memcached with MySQL? • Scale-out of dynamic web sites y • Page loads • Efficient resource utilization • Support for dozens to hundreds of nodes • Open source 14 : Copyright 2009 Gear6 Inc.
  • 15. How Does Memcached Work? • Client - Server • H h Function Hash F ti • Memcached » Two stage 15 : Copyright 2009 Gear6 Inc.
  • 16. Memcached Server • Slab allocator • Libevent based • Simple Protocol (no XML) • Server has internal hash table • Servers are dumb – they don’t know about each other 16 : Copyright 2009 Gear6 Inc.
  • 17. Memcached Server • Limits » Key size = (250 bytes) » 1MB Limit » 32bit/64bit (maximum size of process) • LRU » Least recently accessed items are cycled out » One LRU exists per “slab class” slab class » LRU “evictions” need not be common • Threads? Yes 17 : Copyright 2009 Gear6 Inc.
  • 18. Memcached Clients • Client hashes key to server list • Serializes t e object Se a es the • Many client libraries y • Authentication 18 : Copyright 2009 Gear6 Inc.
  • 19. What about….. • Redundancy • Failover 19 : Copyright 2009 Gear6 Inc.
  • 20. Consistent Hashing • Why? • How does it work? 20 : Copyright 2009 Gear6 Inc.
  • 21. Commands • Storage commands: » Set / Add / Replace / Append / Prepend / CAS • Retrieval commands: » Get / Gets • Delete / increment / decrement • Stats 21 : Copyright 2009 Gear6 Inc.
  • 22. Memcached UDFs for MySQL • Suite of functions that work with Memcached and MySQL • Leverage power of SQL Engine • Combine tasks mySQL • Open source application pp 22 : Copyright 2009 Gear6 Inc.
  • 23. Putting it all together Client 1 Client-1 Client 2 Client-2 Client 3 Client-3 C Server X Server Y Server Z Key = value y Foo = seattle 23 : Copyright 2009 Gear6 Inc.
  • 24. Evolution of a Dynamic Site #1 A day in the life of a growing web service Event: Site has growth in number of users, sessions, Action: Replicate database page views and apps, causing (and/or add more app servers) excessive read load on DB App Server App Server App Server App Server App Server App Server App Server App Server App Server write read write … write read read MySQL MySQL MySQL 24 : Copyright 2009 Gear6 Inc.
  • 25. Evolution of a Dynamic Site #2 A day in the life of a growing web service Event: Individual caches on the Action: Add memcached server app/db servers are on servers with underutilized overwhelmed from chaotic, non- memory resources… results in deterministic content access even fewer reads to database memcached memcached memcached App Server App Server App Server App Server App Server App Server memcached memcached memcached App Server App Server App Server App Server App Server App Server write it … write it write it … write it read read read read MySQL MySQL MySQL MySQL 25 : Copyright 2009 Gear6 Inc.
  • 26. Evolution of a Dynamic Site #3 A day in the life of a growing web service Event: Memcached needs more memory resources than Action: Move Memcached what are available on other servers to dedicated servers (shared) servers memcached memcached memcached App Server App Server App Server App Server App Server App Server memcached memcached memcached App Server App Server App Server App Server App Server App Server memcached memcached … memcached write … write write … write read read read read MySQL MySQL MySQL MySQL 26 : Copyright 2009 Gear6 Inc.
  • 27. What Memcached is NOT: A persistent data store A database Application-specific A large object cache Fault-tolerant or highly available 27 : Copyright 2009 Gear6 Inc.
  • 28. Memcached: Best Practices • Use with MySQL :-) y Q ) • Use on 64-bit servers • Cache “expensive operations” • Cache bi-directionally ( (read/write) ) • Design to withstand failures gracefully • Use consistent hashing 28 : Copyright 2009 Gear6 Inc.
  • 29. Memcached: Best Practices (cont’d) • Careful with numbers of connections » Peak » Transitions • Evictions » Segment Memcached data into separate pools • O ti i sizing: instances and pools Optimize i i i t d l • Instrumentation 29 : Copyright 2009 Gear6 Inc.
  • 30. Memcache Use Cases Site Type Repeatable Use Social networking Profile caching Content aggregation HTML/page caching Ad targeting Cookie/profile tracking Gaming and entertainment Session caching Location-based services DB query scaling Relationship R l ti hi Session caching S i hi E-commerce Session and HTML caching 30 : Copyright 2009 Gear6 Inc.
  • 31. Use Case Example: Session Management • 4m+ daily visitors Web Servers • 15k hits/sec • 6k updates/sec Application S Servers with • Tens of thousands of Memcached Clients concurrent connections Memcached Servers • S Session tracked and ads i t k d d d are placed in accordance to session MySQL Servers 31 : Copyright 2009 Gear6 Inc.
  • 32. Useful Memcached Tools p advanced reporter Track hot keys and clients in Memcached wireshark Dissect and analyze Memcached network traffic brutis Size and test changes to memcache clusters statsproxy View buffered Memcached stats in your browser cacti Graph and analyze Memcached statistics 32 : Copyright 2009 Gear6 Inc.
  • 33. Statsproxy + Cacti Templates To use the cacti templates for memcached with statsproxy, you either need to modify the templates to use port 8080 or change the statsproxy config to use port 11211 33 : Copyright 2009 Gear6 Inc.
  • 34. About Gear6 • First and leading provider of Memcached solutions • Memcached solution including • High density • High availability • Advanced memory management • Enhanced reporting capabilities biliti • Support for multi-tenancy • Disruption free software upgrades • 100% c e t co pat b e 00% client compatible 34 : Copyright 2009 Gear6 Inc.
  • 35. Questions? Thank you for attending our webinar “Why Memcached” Bill Takacs Gear6 salesinfo@gear6.com +1 650 587 7118 and please visit our web site at: www.gear6.com 35 : Copyright 2009 Gear6 Inc.
  • 36. References • Danga.com • Highscalability.com • Dev.gear6.com • Groups.google.com/group/memcached • Code.google.com/p/memcached • Twitter.com/gearsix • Cacti.net • Wireshark.org • http://dev.mysql.com/doc/mysql-ha-scalability/en/ha-memcached-using- deployment.html • http://dev.mysql.com/doc/mysql-ha-scalability/en/ha-memcached-using- hashtypes.html • http://jayant7k.blogspot.com/2009/04/memcached-replication.html • http://www.lexemetech.com/2007/11/consistent-hashing.html • http://www8.org/w8-papers/2a- webserver/caching/paper2.htmlhttp://www.last.fm/user/RJ/journal/2007/04/10/rz_l ibketama_-_a_consistent_hashing_algo_for_memcache_clients • http://bazaar.launchpad.net/~libmemcached- http://bazaar launchpad net/~libmemcached developers/libmemcached/trunk/revision/539 36 : Copyright 2009 Gear6 Inc.