Professional Documents
Culture Documents
Performance
TechWeekend #3
5th September 2009
Mukul Kumar
Co-Founder & VP Engineering at
PubMatic
mukul@pubmatic.com
http://twitter.com/mukulneetika
Agenda
• Application Scalability
• System Scalability
• Application Performance
• System Performance
• Hard Learnt Lessons
I will not talk about
• Cloud Computing
• MySQL tuning
Ideas for Scalability
• Keep it simple
• Make it light
• Cache Aggressively
• Don’t invalidate cache too often
• Should you keep cache centralized?
– Single point of failure
– Bottleneck
Loosely Coupled
Distributed Architecture
• Shared nothing
• Stateless apps
• MySQL
– Use replication extensively
– Master Slave
– Master Slave Slave
– Don’t use your master DB for running all
queries
– Use new features and versions with care
– or don’t use them
Tiered architecture
• Memcached
• Read Only DB
• Master-DB
• Think global
– X servers in San Jose, Y in Texas, Z in
London
• Think – Horizontal scaling vs. vertical
scaling
Hardware load balancer
• Get a hardware load balancer
• Algorithms
• Session persistence
• Header passing
• Timeout values
Recipe for handling rapid
growth
Source – http://highscalability.com/youtube-architecture
while (true) {
identify_and_fix_bottlenecks();
eat_drink();
sleep();
notice_new_bottleneck();
}
This loop runs many times.
mukul@pubmatic.com
twitter.com/mukulneetika