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
0 comments
Post a comment