SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
Scaling Website Performance:
Caching Session and Profile Data with Memcached
Presented by:
         Joaquín Ruiz – EVP Products
         Perry Krug – Systems Engineer
14 April 2009
About Gear6


  • First and leading provider of scalable Memcached solutions


  • Enabling high-growth web sites to deliver and scale dynamic
              high growth
    applications and content


  • Memcached contributor on Github and Google Code


  • Customers are leaders in media, social networking and content
    aggregation


  • Privately held; Headquartered in Mountain View, California


2 : Copyright 2009 Gear6 Inc.
The Web Has Changed
     • It’s Dynamic, It’s Mobile, It’s High Speed
           » Consumer internet traffic surpassed business traffic in 2008
           » Dynamic (Social Aggregation Media) sites/services are the driving web growth
                     (Social, Aggregation,


     So…
     • A distributed caching tier has become necessary and ubiquitous
           » Approximately 70% of websites are Linux-based (typically LAMP/Java) and are not
             scalable without a distributed caching tier

     Because…
     • Without a distributed caching tier you have no good options
               SCALE VERTICALLY: $$$ It’s very expensive to do this $$$
           »
               ADD LARGE AMOUNTS OF WEB, APP AND DB SERVERS: $$$ OPEX $$$
           »
               MOVE TO A DIFFENT STACK: “No way!
                                            No way!”
           »
               GET CRUSHED/SLOW RESPONSE TIMES: “It’s gone from bad to worse”
           »

    “Digital Consumer – Undermonetized social networks / video / VoIP driving powerful usage
    growth
    growth” – Morgan Stanley Tech Research, 5 Nov 2008, Web 2.0 Summit, San Francisco



3 : Copyright 2009 Gear6 Inc.
Web Architecture with No Cache

                                                              Web / Application Servers
                   MySQL
                  Databases




                                            Ad Load
                                            Add Load
                                             dd
                                             d
                                                                           Web / Application Servers



                                 MySQL
                                Databases




                                                       Every request must hit the database servers and/or
                                                       E           t     t    th d t b               d/
                                                               re-
                                                               re-execute on application servers


4 : Copyright 2009 Gear6 Inc.
Memcached to the Rescue
     • Memcached: a distributed memory object caching system intended
       for use in speeding up dynamic web applications by alleviating
       database load

     • Memcached is an open source project that developed around the
       need for dynamic web sites to have a distributed caching tier
           » Technology: Memcached is a generic two stage hashing system (clients and
             servers). Clients are written for specific application languages. Server is
             written in C
           » U cases: HTML MySQL, Session/profile caching
             Use         HTML, M SQL S       i/      fil    hi


     • Memcached is de facto solution
           » 85% of top 20 sites use memcached; 50%+ of top 5k sites uses Memcached
           » Memcached has client libraries in all major languages
           » Memcached has application level plug-ins for apps like WordPress and
             Drupal


5 : Copyright 2009 Gear6 Inc.
Why should I use Memcache?



     • Enables scale-out of dynamic websites
     • Faster page loads
              pg
     • Allows for efficient use of your database
     • Can utilize existing network infrastructure
     • Very flexible – architect for your workload & resources




6 : Copyright 2009 Gear6 Inc.
Web Architecture with Memcached
                                                                      Web / Application Servers
      Without Memcached

                                 MySQL
                                Databases




                                                                  Web / Application Servers
      With Memcached


                                                                                Perfect for
                                                                             dynamic website
                                            Memcached
                                                                              that generate a
                                                        Memcache Server(s)
                                             e cac ed
                                            Memcached
                                                                             high load on their
                                                                             hi h l d     th i
           MySQL
                                            Memcached                            database
          Databases
7 : Copyright 2009 Gear6 Inc.
Challenges of Memcached


 Challenges:
       » Many web implementations require lots of
         memory and lots of servers for memcache:
               • Ad i i t ti
                 Administration, power, cooling and
                                           li     d
                 rackspace challenge
       » No built-in failover or replication
       » Instances managed individually
               • Lack of consolidated management and
                 aggregated statistic gathering
               • Can be challenging to troubleshoot client,
                 service, instance and key relationships


                                                              Source: “MySQL and memcached” May 2008 seminar




8 : Copyright 2009 Gear6 Inc.
What is a Session?


     • Al
       Almost always l
             tl      larger th
                            than 250 b t
                                      bytes, and almost
                                               dl     t
       always smaller than 5 kilobytes
     • Read from datastore for every logged in user for
       every dynamic page load
     • Written to the datastore for every dynamic page
       load
     • Eventually reaped from the database after N
       minutes of inactivity

                                Credits: “Cache your sessions. Don't piss off your users” by Dormando


9 : Copyright 2009 Gear6 Inc.
Example: Scaling the User Profile
     • Too many users creates a load on the database
     • Replicating the database will help this
         p       g                      p
           » Will quickly experience DB replication lag




                                               Source: “”Scaling and Tuning MySQL.com” Jan 2009



10 : Copyright 2009 Gear6 Inc.
Where do you keep your Sessions?
     • Bad: Local sessions (on disk or in memory)
           » Can’t move users
             Can t
           » Can’t avoid hotspots
           » Not fault tolerant


     • Good: Centralized sessions (in a central
       database or in-memory)
                   in memor )
           » No porting around of session data
           » No need for sticky sessions
           » No hot spots

                                 Credits: “Scalable Web Architectures” by Cal Henderson


11 : Copyright 2009 Gear6 Inc.
Caching Sessions with Memcached

     • Common Wisdom: You Don’t
           » Users will get logged out if anything goes wrong with
             memcached
           » Evictions means that people are logged out of your site
           » If you upgrade memcached, OS, hardware etc., everyone will
             be logged off
           » Addi /
             Adding/removing memcached servers ki k people off site
                         i         hd          kicks    l ff it


     • BUT the benefit of caching sessions is HUGE
           » It is VERY FAST - Zero reads or writes to the database
           … so people do!
                                 Credits: “Cache your sessions. Don't piss off your users” by Dormando

12 : Copyright 2009 Gear6 Inc.
Session Caching Options
     Approach 1:
           » Memcached / MySQL hybrid ! Run batch/cron jobs to store session data in
               both database and memcached

           » Good for smaller sites or sites where it doesn’t matter as much if session
               data is lost



                             (Gear6 Approach):
     Approach 2
           » Store session in memcached space only

           » Provide sufficient memory space to eliminate evictions

                   • Leverage flash density to reduce space and costs

                   • Use DRAM to provide low latency

           » Use server-based replication to eliminate memcached misses
                        b   d    l            l              hd

13 : Copyright 2009 Gear6 Inc.
Gear6: Session Caching Customer Case
     Production Customer Stats:
               Alexa rank: top 150 worldwide
           »
               10’s of millions of page views per day
           »
               28 million unique users per month in 2008
           »
               Previously used memcached v 1.2.6 to cache sessions
           »
               About 120GB of memcache data used
           »


     Customer challenges:
                     g
           » Need to provide very fast access to use profile information in order
             to present user with appropriate content (based on user ratings)
           » Customer: rack space limited and cost sensitive
           » Need to increase administrative efficiency for memcached tier
           » Memcached reload can take several hours if failure occurs during
             which DB load is very high and service latency increased


14 : Copyright 2009 Gear6 Inc.
Gear6: Session Caching Customer Case

     • Without Gear6:
           Zero High Availability / Redundancy
               Slower user experience
           »
               4 U rack space
           »
               ~800W power consumption
                800W
           »
               Zero configuration management
           »
               Minimal statistics (Cacti)
           »
               Cost per Gig = $100 for hardware only
           »
           Double everything for redundancy



         32GB                    32GB           32GB   32GB



15 : Copyright 2009 Gear6 Inc.
Gear6: Session Caching Customer Case

     • With Gear6:
           Fully redundant / cache data protection
               y                        p
           » 2 U rack space
           » ~400W power consumption
           » Single point for management
                 gp               g
           » Enhanced stream analysis and statistics
           » Cost per Gig = $70 for entire solution

     Savings & benefits of Gear6 solution vs. without Gear6:
             Over $8k/year in power savings
           »
             Immediately deployable with no code changes
           »
             1/4th the rack space
           »
             Customers immediately presented with high-affinity content based
           »
             on profile and rating history
                p                g       y
           » Less expensive to deploy with Gear6 than without!
16 : Copyright 2009 Gear6 Inc.
Gear6 Web Cache Specifications

 Gear6 Web Cache Software                                Gear6 Web Cache Module

 • High memory density &
   advance memory allocation
       » Best-in-class hybrid RAM-Flash
         Best in class         RAM Flash
         configurations
       » Advanced memory management
       » Most efficient object eviction implementation
                                                         Gear6 software delivered on best-of-breed,
       » High bandwidth support                          industry standard servers, DRAM and Flash
 • High availability
                                                         Module specs:
       » Rich cluster functionality
                                                         •1 U rack profile with four flash drive bays
       » Failover configurations
                                                         •Minimum of two modules per appliance
       » Cache replication options
                                                         •Two power supplies per module
 • Advanced management                                   •Four bonded GE ports per module
       » Hot key and client analysis                     •Two Quad Core processors
       » Service-wide diagnostics                        •Up to 300GB per rack unit
       » Aggregated physical and logical views




17 : Copyright 2009 Gear6 Inc.
Resources
     • www.gear6.com

     • Twitter
           » twitter.com/memcached


     • Github
           » http://github.com/zyounker/brutis/tree/master
                p //g         /y       /      /    /
           » http://github.com/rama/statsproxy/tree/master


     • Google code
           » http://code.google.com/p/brutis/wiki/Readme
           » http://code.google.com/p/statsproxy/


18 : Copyright 2009 Gear6 Inc.
April 14, 2009 Webinar Poll Results
                          If you do use memcached, do you use it for:
                                         None of the above     0%

                                            All of the above        8%

                                 Session and profile caching   0%

                                  Caching HTML web pages                  42%

                             MySQL or other data caching                        67%




                           What client are you using for memcached?

                                            Other                        44%

                                              Perl   0%

                                       Java Based          11%

                                              PHP                        44%




19 : Copyright 2009 Gear6 Inc.
Questions?



                        Thank you for attending
           “Scaling Website Performance: Caching Session and
                      Profile D
                      P fil Data with Memcached”
                                    ihM       h d”
                           presented by Gear6




                                     Joaquin Ruiz
                                         Gear6
                                 salesinfo@gear6.com
                                    +1 650 587 7116

20 : Copyright 2009 Gear6 Inc.

Más contenido relacionado

La actualidad más candente

Contributing to OSS in a commercial non-OSS environment
Contributing to OSS in a commercial non-OSS environmentContributing to OSS in a commercial non-OSS environment
Contributing to OSS in a commercial non-OSS environmentFunambol
 
Presentation building your cloud with v mware
Presentation   building your cloud with v mwarePresentation   building your cloud with v mware
Presentation building your cloud with v mwarexKinAnx
 
Liberty dynacache ffw_iea_ste
Liberty dynacache ffw_iea_steLiberty dynacache ffw_iea_ste
Liberty dynacache ffw_iea_steRohit Kelapure
 
Hyper-V’s Virtualization Enhancements - EPC Group
Hyper-V’s Virtualization Enhancements - EPC GroupHyper-V’s Virtualization Enhancements - EPC Group
Hyper-V’s Virtualization Enhancements - EPC GroupEPC Group
 
"Achieving Flash Memory's Full Potential" @ Flash Memory Summit 2012
"Achieving Flash Memory's Full Potential" @ Flash Memory Summit 2012"Achieving Flash Memory's Full Potential" @ Flash Memory Summit 2012
"Achieving Flash Memory's Full Potential" @ Flash Memory Summit 2012Darpan Dinker
 
Oracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningOracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningBrian Huff
 
Brian Oliver Pimp My Data Grid
Brian Oliver  Pimp My Data GridBrian Oliver  Pimp My Data Grid
Brian Oliver Pimp My Data Griddeimos
 
The Sametime Mobile Experience
The Sametime Mobile ExperienceThe Sametime Mobile Experience
The Sametime Mobile ExperienceGabriella Davis
 
Microsoft SQL Server Flash Storage
Microsoft SQL Server Flash StorageMicrosoft SQL Server Flash Storage
Microsoft SQL Server Flash StorageMark Ginnebaugh
 
20191201 kubernetes managed weblogic revival - part 1
20191201 kubernetes managed weblogic revival - part 120191201 kubernetes managed weblogic revival - part 1
20191201 kubernetes managed weblogic revival - part 1makker_nl
 
WebSphere Liberty and IBM Containers: The Perfect Combination for Java Micros...
WebSphere Liberty and IBM Containers: The Perfect Combination for Java Micros...WebSphere Liberty and IBM Containers: The Perfect Combination for Java Micros...
WebSphere Liberty and IBM Containers: The Perfect Combination for Java Micros...David Currie
 
DOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersDOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersYoav Avrahami
 
WSI35 - WebSphere Extreme Scale Customer Scenarios and Use Cases
WSI35 - WebSphere Extreme Scale Customer Scenarios and Use CasesWSI35 - WebSphere Extreme Scale Customer Scenarios and Use Cases
WSI35 - WebSphere Extreme Scale Customer Scenarios and Use CasesHendrik van Run
 
Building a Scalable Architecture for web apps
Building a Scalable Architecture for web appsBuilding a Scalable Architecture for web apps
Building a Scalable Architecture for web appsDirecti Group
 
WSI33 - Advanced Performance Tactics for IBM WebSphere Application Server
WSI33 - Advanced Performance Tactics for IBM WebSphere Application ServerWSI33 - Advanced Performance Tactics for IBM WebSphere Application Server
WSI33 - Advanced Performance Tactics for IBM WebSphere Application ServerHendrik van Run
 
System Center Virtual Machine Manager 2008 R2
System Center Virtual Machine Manager 2008 R2System Center Virtual Machine Manager 2008 R2
System Center Virtual Machine Manager 2008 R2aralves
 

La actualidad más candente (20)

Contributing to OSS in a commercial non-OSS environment
Contributing to OSS in a commercial non-OSS environmentContributing to OSS in a commercial non-OSS environment
Contributing to OSS in a commercial non-OSS environment
 
Presentation building your cloud with v mware
Presentation   building your cloud with v mwarePresentation   building your cloud with v mware
Presentation building your cloud with v mware
 
Liberty dynacache ffw_iea_ste
Liberty dynacache ffw_iea_steLiberty dynacache ffw_iea_ste
Liberty dynacache ffw_iea_ste
 
Hyper-V’s Virtualization Enhancements - EPC Group
Hyper-V’s Virtualization Enhancements - EPC GroupHyper-V’s Virtualization Enhancements - EPC Group
Hyper-V’s Virtualization Enhancements - EPC Group
 
"Achieving Flash Memory's Full Potential" @ Flash Memory Summit 2012
"Achieving Flash Memory's Full Potential" @ Flash Memory Summit 2012"Achieving Flash Memory's Full Potential" @ Flash Memory Summit 2012
"Achieving Flash Memory's Full Potential" @ Flash Memory Summit 2012
 
Hyper-V Dynamic Memory in Depth
Hyper-V Dynamic Memory in Depth Hyper-V Dynamic Memory in Depth
Hyper-V Dynamic Memory in Depth
 
Oracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningOracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance Tuning
 
Brian Oliver Pimp My Data Grid
Brian Oliver  Pimp My Data GridBrian Oliver  Pimp My Data Grid
Brian Oliver Pimp My Data Grid
 
The Sametime Mobile Experience
The Sametime Mobile ExperienceThe Sametime Mobile Experience
The Sametime Mobile Experience
 
Microsoft SQL Server Flash Storage
Microsoft SQL Server Flash StorageMicrosoft SQL Server Flash Storage
Microsoft SQL Server Flash Storage
 
20191201 kubernetes managed weblogic revival - part 1
20191201 kubernetes managed weblogic revival - part 120191201 kubernetes managed weblogic revival - part 1
20191201 kubernetes managed weblogic revival - part 1
 
WebSphere Liberty and IBM Containers: The Perfect Combination for Java Micros...
WebSphere Liberty and IBM Containers: The Perfect Combination for Java Micros...WebSphere Liberty and IBM Containers: The Perfect Combination for Java Micros...
WebSphere Liberty and IBM Containers: The Perfect Combination for Java Micros...
 
DOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M usersDOs and DONTs on the way to 10M users
DOs and DONTs on the way to 10M users
 
WSI35 - WebSphere Extreme Scale Customer Scenarios and Use Cases
WSI35 - WebSphere Extreme Scale Customer Scenarios and Use CasesWSI35 - WebSphere Extreme Scale Customer Scenarios and Use Cases
WSI35 - WebSphere Extreme Scale Customer Scenarios and Use Cases
 
Bca1931 final
Bca1931 finalBca1931 final
Bca1931 final
 
Building a Scalable Architecture for web apps
Building a Scalable Architecture for web appsBuilding a Scalable Architecture for web apps
Building a Scalable Architecture for web apps
 
Samba management Console
Samba management ConsoleSamba management Console
Samba management Console
 
WSI33 - Advanced Performance Tactics for IBM WebSphere Application Server
WSI33 - Advanced Performance Tactics for IBM WebSphere Application ServerWSI33 - Advanced Performance Tactics for IBM WebSphere Application Server
WSI33 - Advanced Performance Tactics for IBM WebSphere Application Server
 
System Center Virtual Machine Manager 2008 R2
System Center Virtual Machine Manager 2008 R2System Center Virtual Machine Manager 2008 R2
System Center Virtual Machine Manager 2008 R2
 
Apache performance
Apache performanceApache performance
Apache performance
 

Destacado

A301 ctu madrid2016-monitoring
A301 ctu madrid2016-monitoringA301 ctu madrid2016-monitoring
A301 ctu madrid2016-monitoringMichael Dawson
 
10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App TodayChris Love
 
Best Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web SitesBest Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web SitesCraig Dickson
 
Zingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPZingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPChau Thanh
 
Deep Dive: Scaling Up to Your First 10 Million Users
Deep Dive: Scaling Up to Your First 10 Million UsersDeep Dive: Scaling Up to Your First 10 Million Users
Deep Dive: Scaling Up to Your First 10 Million UsersAmazon Web Services
 
7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications7 Stages of Scaling Web Applications
7 Stages of Scaling Web ApplicationsDavid Mitzenmacher
 
Architecture of a Modern Web App
Architecture of a Modern Web AppArchitecture of a Modern Web App
Architecture of a Modern Web Appscothis
 
10 Best Practices of a Best Company to Work For
10 Best Practices of a Best Company to Work For10 Best Practices of a Best Company to Work For
10 Best Practices of a Best Company to Work ForO.C. Tanner
 

Destacado (10)

A301 ctu madrid2016-monitoring
A301 ctu madrid2016-monitoringA301 ctu madrid2016-monitoring
A301 ctu madrid2016-monitoring
 
Scaling your website
Scaling your websiteScaling your website
Scaling your website
 
10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today
 
Best Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web SitesBest Practices for Large-Scale Web Sites
Best Practices for Large-Scale Web Sites
 
Zingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPZingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHP
 
Deep Dive: Scaling Up to Your First 10 Million Users
Deep Dive: Scaling Up to Your First 10 Million UsersDeep Dive: Scaling Up to Your First 10 Million Users
Deep Dive: Scaling Up to Your First 10 Million Users
 
IoC and Mapper in C#
IoC and Mapper in C#IoC and Mapper in C#
IoC and Mapper in C#
 
7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications7 Stages of Scaling Web Applications
7 Stages of Scaling Web Applications
 
Architecture of a Modern Web App
Architecture of a Modern Web AppArchitecture of a Modern Web App
Architecture of a Modern Web App
 
10 Best Practices of a Best Company to Work For
10 Best Practices of a Best Company to Work For10 Best Practices of a Best Company to Work For
10 Best Practices of a Best Company to Work For
 

Similar a Gear6 and Scaling Website Performance: Caching Session and Profile Data with Memcached

Gear6 Webinar - MySQL Scaling with Memcached
Gear6 Webinar - MySQL Scaling with MemcachedGear6 Webinar - MySQL Scaling with Memcached
Gear6 Webinar - MySQL Scaling with MemcachedGear6
 
Memcached, presented to LCA2010
Memcached, presented to LCA2010Memcached, presented to LCA2010
Memcached, presented to LCA2010Mark Atwood
 
Gear6 Web Cache Overview
Gear6 Web Cache OverviewGear6 Web Cache Overview
Gear6 Web Cache OverviewGear6
 
Implementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedImplementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedGear6
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetAchieve Internet
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetAchieve Internet
 
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Andrew Miller
 
Improving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedImproving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedAcquia
 
Virtualizing Tier One Applications - Varrow
Virtualizing Tier One Applications - VarrowVirtualizing Tier One Applications - Varrow
Virtualizing Tier One Applications - VarrowAndrew Miller
 
Jcon2020 keynote-high-performance-java-cloud-native
Jcon2020 keynote-high-performance-java-cloud-nativeJcon2020 keynote-high-performance-java-cloud-native
Jcon2020 keynote-high-performance-java-cloud-nativeMarkus Kett
 
Geographic Distribution for Global Web Application Performance
Geographic Distribution for Global Web Application PerformanceGeographic Distribution for Global Web Application Performance
Geographic Distribution for Global Web Application Performancekkjjkevin03
 
Mysql wp memcached
Mysql wp memcachedMysql wp memcached
Mysql wp memcachedkbour23
 
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008codebits
 
vFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsvFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsVMware vFabric
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svenssonrajivmordani
 
Tricks And Tradeoffs Of Deploying My Sql Clusters In The Cloud
Tricks And Tradeoffs Of Deploying My Sql Clusters In The CloudTricks And Tradeoffs Of Deploying My Sql Clusters In The Cloud
Tricks And Tradeoffs Of Deploying My Sql Clusters In The CloudMySQLConference
 

Similar a Gear6 and Scaling Website Performance: Caching Session and Profile Data with Memcached (20)

Gear6 Webinar - MySQL Scaling with Memcached
Gear6 Webinar - MySQL Scaling with MemcachedGear6 Webinar - MySQL Scaling with Memcached
Gear6 Webinar - MySQL Scaling with Memcached
 
Memcached, presented to LCA2010
Memcached, presented to LCA2010Memcached, presented to LCA2010
Memcached, presented to LCA2010
 
Gear6 Web Cache Overview
Gear6 Web Cache OverviewGear6 Web Cache Overview
Gear6 Web Cache Overview
 
Implementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedImplementing High Availability Caching with Memcached
Implementing High Availability Caching with Memcached
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
Cloud Time
Cloud TimeCloud Time
Cloud Time
 
MySQL Aquarium Paris
MySQL Aquarium ParisMySQL Aquarium Paris
MySQL Aquarium Paris
 
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
Varrow Q4 Lunch & Learn Presentation - Virtualizing Business Critical Applica...
 
Improving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with MemcachedImproving Website Performance and Scalability with Memcached
Improving Website Performance and Scalability with Memcached
 
Virtualizing Tier One Applications - Varrow
Virtualizing Tier One Applications - VarrowVirtualizing Tier One Applications - Varrow
Virtualizing Tier One Applications - Varrow
 
Jcon2020 keynote-high-performance-java-cloud-native
Jcon2020 keynote-high-performance-java-cloud-nativeJcon2020 keynote-high-performance-java-cloud-native
Jcon2020 keynote-high-performance-java-cloud-native
 
Geographic Distribution for Global Web Application Performance
Geographic Distribution for Global Web Application PerformanceGeographic Distribution for Global Web Application Performance
Geographic Distribution for Global Web Application Performance
 
Qcon
QconQcon
Qcon
 
Mysql wp memcached
Mysql wp memcachedMysql wp memcached
Mysql wp memcached
 
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008Practical Thin Server Architecture With Dojo Sapo Codebits 2008
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
 
vFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS AppsvFabric - Ideal Platform for SaaS Apps
vFabric - Ideal Platform for SaaS Apps
 
Practical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter SvenssonPractical Thin Server Architecture With Dojo Peter Svensson
Practical Thin Server Architecture With Dojo Peter Svensson
 
My Sql Presentation
My Sql PresentationMy Sql Presentation
My Sql Presentation
 
Tricks And Tradeoffs Of Deploying My Sql Clusters In The Cloud
Tricks And Tradeoffs Of Deploying My Sql Clusters In The CloudTricks And Tradeoffs Of Deploying My Sql Clusters In The Cloud
Tricks And Tradeoffs Of Deploying My Sql Clusters In The Cloud
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Último (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Gear6 and Scaling Website Performance: Caching Session and Profile Data with Memcached

  • 1. Scaling Website Performance: Caching Session and Profile Data with Memcached Presented by: Joaquín Ruiz – EVP Products Perry Krug – Systems Engineer 14 April 2009
  • 2. About Gear6 • First and leading provider of scalable Memcached solutions • Enabling high-growth web sites to deliver and scale dynamic high growth applications and content • Memcached contributor on Github and Google Code • Customers are leaders in media, social networking and content aggregation • Privately held; Headquartered in Mountain View, California 2 : Copyright 2009 Gear6 Inc.
  • 3. The Web Has Changed • It’s Dynamic, It’s Mobile, It’s High Speed » Consumer internet traffic surpassed business traffic in 2008 » Dynamic (Social Aggregation Media) sites/services are the driving web growth (Social, Aggregation, So… • A distributed caching tier has become necessary and ubiquitous » Approximately 70% of websites are Linux-based (typically LAMP/Java) and are not scalable without a distributed caching tier Because… • Without a distributed caching tier you have no good options SCALE VERTICALLY: $$$ It’s very expensive to do this $$$ » ADD LARGE AMOUNTS OF WEB, APP AND DB SERVERS: $$$ OPEX $$$ » MOVE TO A DIFFENT STACK: “No way! No way!” » GET CRUSHED/SLOW RESPONSE TIMES: “It’s gone from bad to worse” » “Digital Consumer – Undermonetized social networks / video / VoIP driving powerful usage growth growth” – Morgan Stanley Tech Research, 5 Nov 2008, Web 2.0 Summit, San Francisco 3 : Copyright 2009 Gear6 Inc.
  • 4. Web Architecture with No Cache Web / Application Servers MySQL Databases Ad Load Add Load dd d Web / Application Servers MySQL Databases Every request must hit the database servers and/or E t t th d t b d/ re- re-execute on application servers 4 : Copyright 2009 Gear6 Inc.
  • 5. Memcached to the Rescue • Memcached: a distributed memory object caching system intended for use in speeding up dynamic web applications by alleviating database load • Memcached is an open source project that developed around the need for dynamic web sites to have a distributed caching tier » Technology: Memcached is a generic two stage hashing system (clients and servers). Clients are written for specific application languages. Server is written in C » U cases: HTML MySQL, Session/profile caching Use HTML, M SQL S i/ fil hi • Memcached is de facto solution » 85% of top 20 sites use memcached; 50%+ of top 5k sites uses Memcached » Memcached has client libraries in all major languages » Memcached has application level plug-ins for apps like WordPress and Drupal 5 : Copyright 2009 Gear6 Inc.
  • 6. Why should I use Memcache? • Enables scale-out of dynamic websites • Faster page loads pg • Allows for efficient use of your database • Can utilize existing network infrastructure • Very flexible – architect for your workload & resources 6 : Copyright 2009 Gear6 Inc.
  • 7. Web Architecture with Memcached Web / Application Servers Without Memcached MySQL Databases Web / Application Servers With Memcached Perfect for dynamic website Memcached that generate a Memcache Server(s) e cac ed Memcached high load on their hi h l d th i MySQL Memcached database Databases 7 : Copyright 2009 Gear6 Inc.
  • 8. Challenges of Memcached Challenges: » Many web implementations require lots of memory and lots of servers for memcache: • Ad i i t ti Administration, power, cooling and li d rackspace challenge » No built-in failover or replication » Instances managed individually • Lack of consolidated management and aggregated statistic gathering • Can be challenging to troubleshoot client, service, instance and key relationships Source: “MySQL and memcached” May 2008 seminar 8 : Copyright 2009 Gear6 Inc.
  • 9. What is a Session? • Al Almost always l tl larger th than 250 b t bytes, and almost dl t always smaller than 5 kilobytes • Read from datastore for every logged in user for every dynamic page load • Written to the datastore for every dynamic page load • Eventually reaped from the database after N minutes of inactivity Credits: “Cache your sessions. Don't piss off your users” by Dormando 9 : Copyright 2009 Gear6 Inc.
  • 10. Example: Scaling the User Profile • Too many users creates a load on the database • Replicating the database will help this p g p » Will quickly experience DB replication lag Source: “”Scaling and Tuning MySQL.com” Jan 2009 10 : Copyright 2009 Gear6 Inc.
  • 11. Where do you keep your Sessions? • Bad: Local sessions (on disk or in memory) » Can’t move users Can t » Can’t avoid hotspots » Not fault tolerant • Good: Centralized sessions (in a central database or in-memory) in memor ) » No porting around of session data » No need for sticky sessions » No hot spots Credits: “Scalable Web Architectures” by Cal Henderson 11 : Copyright 2009 Gear6 Inc.
  • 12. Caching Sessions with Memcached • Common Wisdom: You Don’t » Users will get logged out if anything goes wrong with memcached » Evictions means that people are logged out of your site » If you upgrade memcached, OS, hardware etc., everyone will be logged off » Addi / Adding/removing memcached servers ki k people off site i hd kicks l ff it • BUT the benefit of caching sessions is HUGE » It is VERY FAST - Zero reads or writes to the database … so people do! Credits: “Cache your sessions. Don't piss off your users” by Dormando 12 : Copyright 2009 Gear6 Inc.
  • 13. Session Caching Options Approach 1: » Memcached / MySQL hybrid ! Run batch/cron jobs to store session data in both database and memcached » Good for smaller sites or sites where it doesn’t matter as much if session data is lost (Gear6 Approach): Approach 2 » Store session in memcached space only » Provide sufficient memory space to eliminate evictions • Leverage flash density to reduce space and costs • Use DRAM to provide low latency » Use server-based replication to eliminate memcached misses b d l l hd 13 : Copyright 2009 Gear6 Inc.
  • 14. Gear6: Session Caching Customer Case Production Customer Stats: Alexa rank: top 150 worldwide » 10’s of millions of page views per day » 28 million unique users per month in 2008 » Previously used memcached v 1.2.6 to cache sessions » About 120GB of memcache data used » Customer challenges: g » Need to provide very fast access to use profile information in order to present user with appropriate content (based on user ratings) » Customer: rack space limited and cost sensitive » Need to increase administrative efficiency for memcached tier » Memcached reload can take several hours if failure occurs during which DB load is very high and service latency increased 14 : Copyright 2009 Gear6 Inc.
  • 15. Gear6: Session Caching Customer Case • Without Gear6: Zero High Availability / Redundancy Slower user experience » 4 U rack space » ~800W power consumption 800W » Zero configuration management » Minimal statistics (Cacti) » Cost per Gig = $100 for hardware only » Double everything for redundancy 32GB 32GB 32GB 32GB 15 : Copyright 2009 Gear6 Inc.
  • 16. Gear6: Session Caching Customer Case • With Gear6: Fully redundant / cache data protection y p » 2 U rack space » ~400W power consumption » Single point for management gp g » Enhanced stream analysis and statistics » Cost per Gig = $70 for entire solution Savings & benefits of Gear6 solution vs. without Gear6: Over $8k/year in power savings » Immediately deployable with no code changes » 1/4th the rack space » Customers immediately presented with high-affinity content based » on profile and rating history p g y » Less expensive to deploy with Gear6 than without! 16 : Copyright 2009 Gear6 Inc.
  • 17. Gear6 Web Cache Specifications Gear6 Web Cache Software Gear6 Web Cache Module • High memory density & advance memory allocation » Best-in-class hybrid RAM-Flash Best in class RAM Flash configurations » Advanced memory management » Most efficient object eviction implementation Gear6 software delivered on best-of-breed, » High bandwidth support industry standard servers, DRAM and Flash • High availability Module specs: » Rich cluster functionality •1 U rack profile with four flash drive bays » Failover configurations •Minimum of two modules per appliance » Cache replication options •Two power supplies per module • Advanced management •Four bonded GE ports per module » Hot key and client analysis •Two Quad Core processors » Service-wide diagnostics •Up to 300GB per rack unit » Aggregated physical and logical views 17 : Copyright 2009 Gear6 Inc.
  • 18. Resources • www.gear6.com • Twitter » twitter.com/memcached • Github » http://github.com/zyounker/brutis/tree/master p //g /y / / / » http://github.com/rama/statsproxy/tree/master • Google code » http://code.google.com/p/brutis/wiki/Readme » http://code.google.com/p/statsproxy/ 18 : Copyright 2009 Gear6 Inc.
  • 19. April 14, 2009 Webinar Poll Results If you do use memcached, do you use it for: None of the above 0% All of the above 8% Session and profile caching 0% Caching HTML web pages 42% MySQL or other data caching 67% What client are you using for memcached? Other 44% Perl 0% Java Based 11% PHP 44% 19 : Copyright 2009 Gear6 Inc.
  • 20. Questions? Thank you for attending “Scaling Website Performance: Caching Session and Profile D P fil Data with Memcached” ihM h d” presented by Gear6 Joaquin Ruiz Gear6 salesinfo@gear6.com +1 650 587 7116 20 : Copyright 2009 Gear6 Inc.