SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
Scaling a Web Service
       BarCamp HK 2007
    Leon Ho, Stepcase Limited
Objective

• Sustaining the scale of the traffic
• Zero downtime
• High performance
• Squeezing every juice from the server
Why?
• Stepcase Lifehack (http://www.lifehack.org):
 • 1 million visits per month
 • 2 million pageviews per month
 • Those does not include images,
    javascript, stylesheets
  • We’ve done 5400 new connections per
    min
1. Hardware
Stage 1

Web Server              DB


       Shared Hosting
Stage 2

Web Server   DB
Stage 3
                      Slave
                       DB
             Master
Web Server
              DB
                      Slave
                       DB
Stage 4
                Master
                 DB

Web Server      Master
                 DB

             MySQL Cluster
Stage 5
           App Server
                           Master
                            DB
 Load
           App Server
Balancer                   Master
                            DB

                        MySQL Cluster
           App Server
Servers

•   Stage 2

•   Running 2 servers;
    each with 4 cores
    and 4GB RAM

•   Exposing only one
    server to public
    network
Remember the point is
to stay in early stages.
2. Reduce Connections
Static Files
• Moves out to a separate server
 • Consider Amazon S3
• Image - Decrease the number of images
  you need to load
 • CSS Spites
 • Use Firebug to benchmark
Amazon S3
• We moved our static images to S3
• files.lifehack.org CNAME
  s3.amazonaws.com
• use cronjob and s3sync to keep them in
  sync
• next, move js, css, and post images out
Feed


• 60,000 subscriptions daily
• We use external provider - Feedburner
3. Reduce File Size
Javascript

• Compress the javascript
 • JSMin, Dojo ShrinkSafe, Packer,YUI
    Compressor
• http://compressorrater.thruhere.net
4. Optimize and Cache
Web & DB Server


• Web: Moved to Lighttpd
• DB: MySQL. Increase query cache, max
  connection and wait timeout
Cache

• Cache, Cache, and Cache
 • Page level (wp-cache)
 • DB queries (memcache, or any object
    caches)
 • PHP opcode - xcache, e-accelerator
What else?

• Eliminate bottleneck
• Hard drive > Memory > CPU
• Reduce Abuse and Spam
Next

• Adding more comprehensive monitoring
 • Munin
• More scaling - this time - on Rails
Questions?
                             Visit Us:
    Contact Me:
                    http://www.stepcase.com
leon@stepcase.com
                     http://www.lifehack.org
                              P.S. We are hiring!

Contenu connexe

Tendances

Windows Azure Service Bus
Windows Azure Service BusWindows Azure Service Bus
Windows Azure Service BusPavel Revenkov
 
WebAssembly vs JavaScript: What is faster?
WebAssembly vs JavaScript: What is faster?WebAssembly vs JavaScript: What is faster?
WebAssembly vs JavaScript: What is faster?Alexandr Skachkov
 
Phorum MySQL tricks
Phorum MySQL tricksPhorum MySQL tricks
Phorum MySQL tricksguestd34230
 
Apply cache for beginner#1
Apply cache for beginner#1Apply cache for beginner#1
Apply cache for beginner#1DaeMyung Kang
 
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
 
Website performance optimization QA
Website performance optimization QAWebsite performance optimization QA
Website performance optimization QADenis Dudaev
 
Server modeling with mysql
Server modeling with mysqlServer modeling with mysql
Server modeling with mysqlDaeMyung Kang
 
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
 
Web Optimization Level: Paranoid
Web Optimization Level: ParanoidWeb Optimization Level: Paranoid
Web Optimization Level: Paranoidrobin_sy
 
High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010Barry Abrahamson
 
Cdn slides
Cdn slidesCdn slides
Cdn slidesmasmanx
 
Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012eballisty
 
Php & web server performace
Php & web server performacePhp & web server performace
Php & web server performaceTuyển Đoàn
 
Apache james more than emails in the cloud
Apache james  more than emails in the cloudApache james  more than emails in the cloud
Apache james more than emails in the cloudIoan Eugen Stan
 

Tendances (18)

Windows Azure Service Bus
Windows Azure Service BusWindows Azure Service Bus
Windows Azure Service Bus
 
WebAssembly vs JavaScript: What is faster?
WebAssembly vs JavaScript: What is faster?WebAssembly vs JavaScript: What is faster?
WebAssembly vs JavaScript: What is faster?
 
Phorum MySQL tricks
Phorum MySQL tricksPhorum MySQL tricks
Phorum MySQL tricks
 
Scaling the Rails
Scaling the RailsScaling the Rails
Scaling the Rails
 
Apply cache for beginner#1
Apply cache for beginner#1Apply cache for beginner#1
Apply cache for beginner#1
 
Metarefresh
MetarefreshMetarefresh
Metarefresh
 
Meta Refresh 2014
Meta Refresh 2014Meta Refresh 2014
Meta Refresh 2014
 
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
 
Website performance optimization QA
Website performance optimization QAWebsite performance optimization QA
Website performance optimization QA
 
Server modeling with mysql
Server modeling with mysqlServer modeling with mysql
Server modeling with mysql
 
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
 
Web Optimization Level: Paranoid
Web Optimization Level: ParanoidWeb Optimization Level: Paranoid
Web Optimization Level: Paranoid
 
High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010High Performance WordPress - WordCamp Jerusalem 2010
High Performance WordPress - WordCamp Jerusalem 2010
 
Cdn slides
Cdn slidesCdn slides
Cdn slides
 
Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012Performance Tuning - MuraCon 2012
Performance Tuning - MuraCon 2012
 
Php & web server performace
Php & web server performacePhp & web server performace
Php & web server performace
 
Apache james more than emails in the cloud
Apache james  more than emails in the cloudApache james  more than emails in the cloud
Apache james more than emails in the cloud
 
Memcache d
Memcache dMemcache d
Memcache d
 

En vedette

Leon Ho: My path to Entrepreneurship
Leon Ho: My path to EntrepreneurshipLeon Ho: My path to Entrepreneurship
Leon Ho: My path to EntrepreneurshipLeon Ho
 
Phototreats - A case study to get 200,000 downloads in 9 days
Phototreats - A case study to get 200,000 downloads in 9 daysPhototreats - A case study to get 200,000 downloads in 9 days
Phototreats - A case study to get 200,000 downloads in 9 daysLeon Ho
 
Пет неща, които всеки програмист трябва да знае
Пет неща, които всеки програмист трябва да знаеПет неща, които всеки програмист трябва да знае
Пет неща, които всеки програмист трябва да знаеNikolay Bachiyski
 
Wordpress Multi Authors Management
Wordpress Multi Authors ManagementWordpress Multi Authors Management
Wordpress Multi Authors ManagementLeon Ho
 
Lessons of Startup
Lessons of StartupLessons of Startup
Lessons of StartupLeon Ho
 
Contabilidad ,Finanzas Y Tributacion
Contabilidad ,Finanzas Y TributacionContabilidad ,Finanzas Y Tributacion
Contabilidad ,Finanzas Y Tributacionguest24793b
 
За WordPress и Automattic
За WordPress и AutomatticЗа WordPress и Automattic
За WordPress и AutomatticNikolay Bachiyski
 
A Startup Case Study of Open Source Software
A Startup Case Study of Open Source SoftwareA Startup Case Study of Open Source Software
A Startup Case Study of Open Source SoftwareLeon Ho
 
Щастливият програмист
Щастливият програмистЩастливият програмист
Щастливият програмистNikolay Bachiyski
 
India in 30 Minutes
India in 30 MinutesIndia in 30 Minutes
India in 30 MinutesShubhaBala
 

En vedette (16)

A D V410 H P V C Uad
A D V410  H P V C UadA D V410  H P V C Uad
A D V410 H P V C Uad
 
挪威峽灣
挪威峽灣挪威峽灣
挪威峽灣
 
Beca1
Beca1Beca1
Beca1
 
Venezia
VeneziaVenezia
Venezia
 
Leon Ho: My path to Entrepreneurship
Leon Ho: My path to EntrepreneurshipLeon Ho: My path to Entrepreneurship
Leon Ho: My path to Entrepreneurship
 
Phototreats - A case study to get 200,000 downloads in 9 days
Phototreats - A case study to get 200,000 downloads in 9 daysPhototreats - A case study to get 200,000 downloads in 9 days
Phototreats - A case study to get 200,000 downloads in 9 days
 
Пет неща, които всеки програмист трябва да знае
Пет неща, които всеки програмист трябва да знаеПет неща, които всеки програмист трябва да знае
Пет неща, които всеки програмист трябва да знае
 
Wordpress Multi Authors Management
Wordpress Multi Authors ManagementWordpress Multi Authors Management
Wordpress Multi Authors Management
 
Lessons of Startup
Lessons of StartupLessons of Startup
Lessons of Startup
 
Contabilidad ,Finanzas Y Tributacion
Contabilidad ,Finanzas Y TributacionContabilidad ,Finanzas Y Tributacion
Contabilidad ,Finanzas Y Tributacion
 
За WordPress и Automattic
За WordPress и AutomatticЗа WordPress и Automattic
За WordPress и Automattic
 
A Startup Case Study of Open Source Software
A Startup Case Study of Open Source SoftwareA Startup Case Study of Open Source Software
A Startup Case Study of Open Source Software
 
Venezia
VeneziaVenezia
Venezia
 
Щастливият програмист
Щастливият програмистЩастливият програмист
Щастливият програмист
 
Notigaertnerbiografiagag
NotigaertnerbiografiagagNotigaertnerbiografiagag
Notigaertnerbiografiagag
 
India in 30 Minutes
India in 30 MinutesIndia in 30 Minutes
India in 30 Minutes
 

Similaire à Scaling a Web Service for High Traffic

Tips for a Faster Website
Tips for a Faster WebsiteTips for a Faster Website
Tips for a Faster WebsiteRayed Alrashed
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & ScalabilityJoseph Scott
 
WordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfWordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfcodearachnid_test
 
WordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfWordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfcodearachnid_test
 
초보자를 위한 분산 캐시 이야기
초보자를 위한 분산 캐시 이야기초보자를 위한 분산 캐시 이야기
초보자를 위한 분산 캐시 이야기OnGameServer
 
Architectures For Scaling Ajax
Architectures For Scaling AjaxArchitectures For Scaling Ajax
Architectures For Scaling Ajaxwolframkriesing
 
WordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningWordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningTimothy Wood
 
Gear6 and Scaling Website Performance: Caching Session and Profile Data with...
Gear6 and Scaling Website Performance:  Caching Session and Profile Data with...Gear6 and Scaling Website Performance:  Caching Session and Profile Data with...
Gear6 and Scaling Website Performance: Caching Session and Profile Data with...Gear6
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 SystemsDavid Newman
 
Memcached, presented to LCA2010
Memcached, presented to LCA2010Memcached, presented to LCA2010
Memcached, presented to LCA2010Mark Atwood
 
High Performance Drupal Sites
High Performance Drupal SitesHigh Performance Drupal Sites
High Performance Drupal SitesAbayomi Ayoola
 
The New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and moreThe New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and moreMariaDB Corporation
 
Cache hcm-topdev
Cache hcm-topdevCache hcm-topdev
Cache hcm-topdevChau Thanh
 

Similaire à Scaling a Web Service for High Traffic (20)

20080528dublinpt1
20080528dublinpt120080528dublinpt1
20080528dublinpt1
 
Tips for a Faster Website
Tips for a Faster WebsiteTips for a Faster Website
Tips for a Faster Website
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & Scalability
 
20080611accel
20080611accel20080611accel
20080611accel
 
WordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfWordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdf
 
WordCamp RVA
WordCamp RVAWordCamp RVA
WordCamp RVA
 
WordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdfWordCamp RVA 2011 - Performance & Tuning.pdf
WordCamp RVA 2011 - Performance & Tuning.pdf
 
초보자를 위한 분산 캐시 이야기
초보자를 위한 분산 캐시 이야기초보자를 위한 분산 캐시 이야기
초보자를 위한 분산 캐시 이야기
 
Architectures For Scaling Ajax
Architectures For Scaling AjaxArchitectures For Scaling Ajax
Architectures For Scaling Ajax
 
WordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & TuningWordCamp RVA 2011 - Performance & Tuning
WordCamp RVA 2011 - Performance & Tuning
 
Qcon
QconQcon
Qcon
 
Gear6 and Scaling Website Performance: Caching Session and Profile Data with...
Gear6 and Scaling Website Performance:  Caching Session and Profile Data with...Gear6 and Scaling Website Performance:  Caching Session and Profile Data with...
Gear6 and Scaling Website Performance: Caching Session and Profile Data with...
 
23 Ways To Speed Up WordPress
23 Ways To Speed Up WordPress23 Ways To Speed Up WordPress
23 Ways To Speed Up WordPress
 
Magee Dday2 Fixing App Performance Italiano
Magee Dday2 Fixing App Performance ItalianoMagee Dday2 Fixing App Performance Italiano
Magee Dday2 Fixing App Performance Italiano
 
MySQL Aquarium Paris
MySQL Aquarium ParisMySQL Aquarium Paris
MySQL Aquarium Paris
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 Systems
 
Memcached, presented to LCA2010
Memcached, presented to LCA2010Memcached, presented to LCA2010
Memcached, presented to LCA2010
 
High Performance Drupal Sites
High Performance Drupal SitesHigh Performance Drupal Sites
High Performance Drupal Sites
 
The New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and moreThe New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and more
 
Cache hcm-topdev
Cache hcm-topdevCache hcm-topdev
Cache hcm-topdev
 

Dernier

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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
 
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
 

Dernier (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 

Scaling a Web Service for High Traffic

  • 1. Scaling a Web Service BarCamp HK 2007 Leon Ho, Stepcase Limited
  • 2. Objective • Sustaining the scale of the traffic • Zero downtime • High performance • Squeezing every juice from the server
  • 3. Why? • Stepcase Lifehack (http://www.lifehack.org): • 1 million visits per month • 2 million pageviews per month • Those does not include images, javascript, stylesheets • We’ve done 5400 new connections per min
  • 5. Stage 1 Web Server DB Shared Hosting
  • 7. Stage 3 Slave DB Master Web Server DB Slave DB
  • 8. Stage 4 Master DB Web Server Master DB MySQL Cluster
  • 9. Stage 5 App Server Master DB Load App Server Balancer Master DB MySQL Cluster App Server
  • 10. Servers • Stage 2 • Running 2 servers; each with 4 cores and 4GB RAM • Exposing only one server to public network
  • 11. Remember the point is to stay in early stages.
  • 13. Static Files • Moves out to a separate server • Consider Amazon S3 • Image - Decrease the number of images you need to load • CSS Spites • Use Firebug to benchmark
  • 14. Amazon S3 • We moved our static images to S3 • files.lifehack.org CNAME s3.amazonaws.com • use cronjob and s3sync to keep them in sync • next, move js, css, and post images out
  • 15. Feed • 60,000 subscriptions daily • We use external provider - Feedburner
  • 17. Javascript • Compress the javascript • JSMin, Dojo ShrinkSafe, Packer,YUI Compressor • http://compressorrater.thruhere.net
  • 19. Web & DB Server • Web: Moved to Lighttpd • DB: MySQL. Increase query cache, max connection and wait timeout
  • 20. Cache • Cache, Cache, and Cache • Page level (wp-cache) • DB queries (memcache, or any object caches) • PHP opcode - xcache, e-accelerator
  • 21. What else? • Eliminate bottleneck • Hard drive > Memory > CPU • Reduce Abuse and Spam
  • 22. Next • Adding more comprehensive monitoring • Munin • More scaling - this time - on Rails
  • 23. Questions? Visit Us: Contact Me: http://www.stepcase.com leon@stepcase.com http://www.lifehack.org P.S. We are hiring!