SlideShare a Scribd company logo
1 of 19
Download to read offline
From One to a Cluster
 Brian Moon, Senior Developer - dealnews.com
       2008 MySQL Conference & Expo
        http://dealnews.com/developers/
The Early Years
• 1997 - 1999 Shared Account
   • Hand edited HTML
   • Perl, PHP, msql
• 1999 - 2000 Dedicated Servers
   • Developed custom CMS
   • Dynamic content with PHP and MySQL
The first cluster

• 3-5 Web servers
• 1 NFS server
• 1 MySQL server
• 1 mail server
Bottlenecks
• Software load balancing
 • Wave effect
 • Closed, required specific OS version
• NFS did not scale
 • Disk Cache
 • Code on NFS
Solutions
• Hardware load balancing
 • Arrowpoint/Cisco (from eBay)
 • F5 BIG-IP (not cheap)
• Drop NFS
 • Memcached - distributed memory cache
 • Use rsync to push changes to production
Status in 2006
• 5 web nodes w/ hardware lb
• Using rsync to put code on
  servers
• 1 MySQL server
• memcached to cache data
  from database
• All pages built “on the fly”
  from cache (hopefully)
Yahoo! Effect
                                                    2nd Yahoo!

         Digg
Radio Tour      “Cyber Monday”   Yahoo Front Page
First Yahoo!
Yahoo! Effect
                                                    2nd Yahoo!

         Digg
Radio Tour      “Cyber Monday”   Yahoo Front Page
Second Yahoo!
New Bottlenecks

• Cache stampede
 • 1000 requests for the same thing
• Bandwidth
 • Image bandwidth alone hit 60Mb/s
• Hundreds of lines of code =(
Solutions
• Offload CSS, Javascript and images
  bandwidth to CDN
• Cache content in memory at the forward
  facing servers
• Use a “Pushed Cache”
• Refactor all the code
Using a CDN
Pros
• Offloads bandwidth
• Many locations, hopefully near your users
• Bandwidth is cheaper than you can buy it
Cons
• Out of your control
• More complicated to invalidate objects
Caching Proxy
• Custom PHP script
 • Researched Squid and wrote Perl and
    Python versions too.
• Uses memcached for cache storage
 • One copy of an item in cache, not several
• Apache 2 worker MPM (Yes, it does work!)
 • Tried lighttpd with FastCGI as well
Pushed Cache
• User requests can never cause database load
 • No cache stampede
• Data can be prepared when we are ready
 • De-normalized to be ready for the site
• Data can come straight from MySQL
• Scales out with MySQL Replication
Straight from the DB?

• Use EXPLAIN a lot
• Avoid filesort and temporary
• Avoid complex joins (or any)
• Use InnoDB (row locking / transactions)
• Write a library/object for code to use
Current Architecture Overview


                 Internet
                             Main DB




Proxy    App    Replicated   Process
                   DB
Load balancing
We cheat a lot with F5 BIG-IP
• Balances incoming traffic
• Balances internal services
• Not cheap, but worth it for us
Linux Virtual Server
•   Open source
•   Up/Down monitoring is not built in
From One to a Cluster
               Not MySQL Cluster, sorry =(

 Brian Moon, Senior Developer - dealnews.com
       2008 MySQL Conference & Expo
        http://dealnews.com/developers/

More Related Content

What's hot

Rails hosting
Rails hostingRails hosting
Rails hostingwonko
 
Massively Scaled High Performance Web Services with PHP
Massively Scaled High Performance Web Services with PHPMassively Scaled High Performance Web Services with PHP
Massively Scaled High Performance Web Services with PHPDemin Yin
 
Magento Meetup Wrocław 6. "Docker for Mac - possible solutions to performance...
Magento Meetup Wrocław 6. "Docker for Mac - possible solutions to performance...Magento Meetup Wrocław 6. "Docker for Mac - possible solutions to performance...
Magento Meetup Wrocław 6. "Docker for Mac - possible solutions to performance...Magento Meetup Wrocław
 
Design a scalable site: Problem and solutions
Design a scalable site: Problem and solutionsDesign a scalable site: Problem and solutions
Design a scalable site: Problem and solutionsChau Thanh
 
Erlang vs Ruby SOA Scheduling
Erlang vs Ruby SOA SchedulingErlang vs Ruby SOA Scheduling
Erlang vs Ruby SOA Schedulingmarfeyh
 
Distributed computing in browsers as client side attack
Distributed computing in browsers as client side attackDistributed computing in browsers as client side attack
Distributed computing in browsers as client side attackIvan Novikov
 
MongoDB backup service overview Boston MUG
MongoDB backup service overview Boston MUGMongoDB backup service overview Boston MUG
MongoDB backup service overview Boston MUGMongoDB
 
Native Clients, more the merrier with GFProxy!
Native Clients, more the merrier with GFProxy!Native Clients, more the merrier with GFProxy!
Native Clients, more the merrier with GFProxy!Gluster.org
 
Web Performance Part 3 "Server-side tips"
Web Performance Part 3  "Server-side tips"Web Performance Part 3  "Server-side tips"
Web Performance Part 3 "Server-side tips"Binary Studio
 
Ruby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdxRuby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdxMathieu Elie
 
RabbitMQ + CouchDB = Awesome
RabbitMQ + CouchDB = AwesomeRabbitMQ + CouchDB = Awesome
RabbitMQ + CouchDB = AwesomeLenz Gschwendtner
 
Caching Data For Performance
Caching Data For PerformanceCaching Data For Performance
Caching Data For PerformanceDave Ross
 
Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"
Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"
Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"Fwdays
 
Cache hcm-topdev
Cache hcm-topdevCache hcm-topdev
Cache hcm-topdevThanh Chau
 
Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"
Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"
Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"Fwdays
 

What's hot (17)

Velocity 2010 - ATS
Velocity 2010 - ATSVelocity 2010 - ATS
Velocity 2010 - ATS
 
Rails hosting
Rails hostingRails hosting
Rails hosting
 
Massively Scaled High Performance Web Services with PHP
Massively Scaled High Performance Web Services with PHPMassively Scaled High Performance Web Services with PHP
Massively Scaled High Performance Web Services with PHP
 
Magento Meetup Wrocław 6. "Docker for Mac - possible solutions to performance...
Magento Meetup Wrocław 6. "Docker for Mac - possible solutions to performance...Magento Meetup Wrocław 6. "Docker for Mac - possible solutions to performance...
Magento Meetup Wrocław 6. "Docker for Mac - possible solutions to performance...
 
Design a scalable site: Problem and solutions
Design a scalable site: Problem and solutionsDesign a scalable site: Problem and solutions
Design a scalable site: Problem and solutions
 
Erlang vs Ruby SOA Scheduling
Erlang vs Ruby SOA SchedulingErlang vs Ruby SOA Scheduling
Erlang vs Ruby SOA Scheduling
 
Distributed computing in browsers as client side attack
Distributed computing in browsers as client side attackDistributed computing in browsers as client side attack
Distributed computing in browsers as client side attack
 
MongoDB backup service overview Boston MUG
MongoDB backup service overview Boston MUGMongoDB backup service overview Boston MUG
MongoDB backup service overview Boston MUG
 
Native Clients, more the merrier with GFProxy!
Native Clients, more the merrier with GFProxy!Native Clients, more the merrier with GFProxy!
Native Clients, more the merrier with GFProxy!
 
Web Performance Part 3 "Server-side tips"
Web Performance Part 3  "Server-side tips"Web Performance Part 3  "Server-side tips"
Web Performance Part 3 "Server-side tips"
 
04 web optimization
04 web optimization04 web optimization
04 web optimization
 
Ruby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdxRuby eventmachine pres at rubybdx
Ruby eventmachine pres at rubybdx
 
RabbitMQ + CouchDB = Awesome
RabbitMQ + CouchDB = AwesomeRabbitMQ + CouchDB = Awesome
RabbitMQ + CouchDB = Awesome
 
Caching Data For Performance
Caching Data For PerformanceCaching Data For Performance
Caching Data For Performance
 
Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"
Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"
Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"
 
Cache hcm-topdev
Cache hcm-topdevCache hcm-topdev
Cache hcm-topdev
 
Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"
Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"
Алексей Петров "PHP at Scale: Knowing enough to be dangerous!"
 

Viewers also liked

Lifelong Learning and Museums
Lifelong Learning and MuseumsLifelong Learning and Museums
Lifelong Learning and MuseumsLynda Kelly
 
PresentacióN1
PresentacióN1PresentacióN1
PresentacióN1sandracpa
 
OWASP PHPIDS talk slides
OWASP PHPIDS talk slidesOWASP PHPIDS talk slides
OWASP PHPIDS talk slidesguestd34230
 
CONVIVENCIA
CONVIVENCIACONVIVENCIA
CONVIVENCIAguisse21
 

Viewers also liked (6)

Lifelong Learning and Museums
Lifelong Learning and MuseumsLifelong Learning and Museums
Lifelong Learning and Museums
 
PresentacióN1
PresentacióN1PresentacióN1
PresentacióN1
 
Palabras
PalabrasPalabras
Palabras
 
Security @ work
Security @ workSecurity @ work
Security @ work
 
OWASP PHPIDS talk slides
OWASP PHPIDS talk slidesOWASP PHPIDS talk slides
OWASP PHPIDS talk slides
 
CONVIVENCIA
CONVIVENCIACONVIVENCIA
CONVIVENCIA
 

Similar to From One to a Cluster

Scaling a Web Service
Scaling a Web ServiceScaling a Web Service
Scaling a Web ServiceLeon Ho
 
Cache hcm-topdev
Cache hcm-topdevCache hcm-topdev
Cache hcm-topdevChau Thanh
 
Extending The My Sql Data Landscape
Extending The My Sql Data LandscapeExtending The My Sql Data Landscape
Extending The My Sql Data LandscapeRonald Bradford
 
Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)WordCamp Cape Town
 
Xen_and_Rails_deployment
Xen_and_Rails_deploymentXen_and_Rails_deployment
Xen_and_Rails_deploymentAbhishek Singh
 
Deploying And Monitoring Rails
Deploying And Monitoring RailsDeploying And Monitoring Rails
Deploying And Monitoring RailsJonathan Weiss
 
Scaling Drupal: Not IF... HOW
Scaling Drupal: Not IF... HOWScaling Drupal: Not IF... HOW
Scaling Drupal: Not IF... HOWTreehouse Agency
 
2008 MySQL Conference Recap
2008 MySQL Conference Recap2008 MySQL Conference Recap
2008 MySQL Conference RecapChris Barber
 
Development to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB ClustersDevelopment to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB ClustersSeveralnines
 
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...Nexcess.net LLC
 
Xen Virtualization 2008
Xen Virtualization 2008Xen Virtualization 2008
Xen Virtualization 2008mwlang88
 
Deployment with Ruby on Rails
Deployment with Ruby on RailsDeployment with Ruby on Rails
Deployment with Ruby on RailsJonathan Weiss
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 SystemsDavid Newman
 

Similar to From One to a Cluster (20)

Scaling a Web Service
Scaling a Web ServiceScaling a Web Service
Scaling a Web Service
 
Advanced Deployment
Advanced DeploymentAdvanced Deployment
Advanced Deployment
 
Cache hcm-topdev
Cache hcm-topdevCache hcm-topdev
Cache hcm-topdev
 
Qcon
QconQcon
Qcon
 
MySQL Aquarium Paris
MySQL Aquarium ParisMySQL Aquarium Paris
MySQL Aquarium Paris
 
re7jweiss
re7jweissre7jweiss
re7jweiss
 
Extending The My Sql Data Landscape
Extending The My Sql Data LandscapeExtending The My Sql Data Landscape
Extending The My Sql Data Landscape
 
Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)Roy foubister (hosting high traffic sites on a tight budget)
Roy foubister (hosting high traffic sites on a tight budget)
 
20080611accel
20080611accel20080611accel
20080611accel
 
Scaling the Rails
Scaling the RailsScaling the Rails
Scaling the Rails
 
Xen_and_Rails_deployment
Xen_and_Rails_deploymentXen_and_Rails_deployment
Xen_and_Rails_deployment
 
20080528dublinpt1
20080528dublinpt120080528dublinpt1
20080528dublinpt1
 
Deploying And Monitoring Rails
Deploying And Monitoring RailsDeploying And Monitoring Rails
Deploying And Monitoring Rails
 
Scaling Drupal: Not IF... HOW
Scaling Drupal: Not IF... HOWScaling Drupal: Not IF... HOW
Scaling Drupal: Not IF... HOW
 
2008 MySQL Conference Recap
2008 MySQL Conference Recap2008 MySQL Conference Recap
2008 MySQL Conference Recap
 
Development to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB ClustersDevelopment to Production with Sharded MongoDB Clusters
Development to Production with Sharded MongoDB Clusters
 
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...
EECI 2013 - ExpressionEngine Performance & Optimization - Laying a Solid Foun...
 
Xen Virtualization 2008
Xen Virtualization 2008Xen Virtualization 2008
Xen Virtualization 2008
 
Deployment with Ruby on Rails
Deployment with Ruby on RailsDeployment with Ruby on Rails
Deployment with Ruby on Rails
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 Systems
 

Recently uploaded

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
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
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Recently uploaded (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
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
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

From One to a Cluster

  • 1. From One to a Cluster Brian Moon, Senior Developer - dealnews.com 2008 MySQL Conference & Expo http://dealnews.com/developers/
  • 2. The Early Years • 1997 - 1999 Shared Account • Hand edited HTML • Perl, PHP, msql • 1999 - 2000 Dedicated Servers • Developed custom CMS • Dynamic content with PHP and MySQL
  • 3. The first cluster • 3-5 Web servers • 1 NFS server • 1 MySQL server • 1 mail server
  • 4. Bottlenecks • Software load balancing • Wave effect • Closed, required specific OS version • NFS did not scale • Disk Cache • Code on NFS
  • 5. Solutions • Hardware load balancing • Arrowpoint/Cisco (from eBay) • F5 BIG-IP (not cheap) • Drop NFS • Memcached - distributed memory cache • Use rsync to push changes to production
  • 6. Status in 2006 • 5 web nodes w/ hardware lb • Using rsync to put code on servers • 1 MySQL server • memcached to cache data from database • All pages built “on the fly” from cache (hopefully)
  • 7. Yahoo! Effect 2nd Yahoo! Digg Radio Tour “Cyber Monday” Yahoo Front Page
  • 9. Yahoo! Effect 2nd Yahoo! Digg Radio Tour “Cyber Monday” Yahoo Front Page
  • 11. New Bottlenecks • Cache stampede • 1000 requests for the same thing • Bandwidth • Image bandwidth alone hit 60Mb/s • Hundreds of lines of code =(
  • 12. Solutions • Offload CSS, Javascript and images bandwidth to CDN • Cache content in memory at the forward facing servers • Use a “Pushed Cache” • Refactor all the code
  • 13. Using a CDN Pros • Offloads bandwidth • Many locations, hopefully near your users • Bandwidth is cheaper than you can buy it Cons • Out of your control • More complicated to invalidate objects
  • 14. Caching Proxy • Custom PHP script • Researched Squid and wrote Perl and Python versions too. • Uses memcached for cache storage • One copy of an item in cache, not several • Apache 2 worker MPM (Yes, it does work!) • Tried lighttpd with FastCGI as well
  • 15. Pushed Cache • User requests can never cause database load • No cache stampede • Data can be prepared when we are ready • De-normalized to be ready for the site • Data can come straight from MySQL • Scales out with MySQL Replication
  • 16. Straight from the DB? • Use EXPLAIN a lot • Avoid filesort and temporary • Avoid complex joins (or any) • Use InnoDB (row locking / transactions) • Write a library/object for code to use
  • 17. Current Architecture Overview Internet Main DB Proxy App Replicated Process DB
  • 18. Load balancing We cheat a lot with F5 BIG-IP • Balances incoming traffic • Balances internal services • Not cheap, but worth it for us Linux Virtual Server • Open source • Up/Down monitoring is not built in
  • 19. From One to a Cluster Not MySQL Cluster, sorry =( Brian Moon, Senior Developer - dealnews.com 2008 MySQL Conference & Expo http://dealnews.com/developers/