SlideShare uma empresa Scribd logo
1 de 36
Baixar para ler offline
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.

Mais conteúdo relacionado

Destaque

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
 

Destaque (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
 

Semelhante a Why Memcached?

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 QuantumLew Tucker
 
Virtual Data Centers with OpenStack Quantum
Virtual Data Centers with OpenStack QuantumVirtual Data Centers with OpenStack Quantum
Virtual Data Centers with OpenStack Quantumlaurabeckcahoon
 
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
 

Semelhante a Why Memcached? (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
 

Último

Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 

Último (20)

Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 

Why Memcached?

  • 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.