Scaling a Web Service

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Scaling a Web Service - Presentation Transcript

    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
    4. 1. Hardware
    5. Stage 1 Web Server DB Shared Hosting
    6. Stage 2 Web Server DB
    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.
    12. 2. Reduce Connections
    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
    16. 3. Reduce File Size
    17. Javascript • Compress the javascript • JSMin, Dojo ShrinkSafe, Packer,YUI Compressor • http://compressorrater.thruhere.net
    18. 4. Optimize and Cache
    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!

    + llchllch, 2 years ago

    custom

    1446 views, 1 favs, 0 embeds more stats

    More Info

    © All Rights Reserved

    Go to text version
    • Total Views 1446
      • 1446 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 68
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as innappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel

    Categories