MySQLConf2007 Capacity
MySQLConf2007 Capacity
LAMP
what happens after you’re scalable
• (right ?)
• But:
• How many servers ?
BUT, um, wait....
• How many databases ?
• How many webservers ?
• How much shared storage ?
• How many network switches ?
• What about caching ?
• How many CPUs in all of these ?
• How much RAM ?
• How many drives in each ?
• WHEN should we order all of these ?
some stats
• - ~35M photos in squid cache (total)
• - ~2M photos in squid’s RAM
• - ~470M photos, 4 or 5 sizes of each
• - 38k req/sec to memcached (12M
objects)
• - 2 PB raw storage (consumed about
~1.5TB on Sunday)
•
capacity
capacity
doesn’t
mean
speed
capacity is for business
too much
Buying enough
for now
enough
not
• Examples:
•
What do you have
NOW ?
• MySQL (disk IO ?)
• SQUID (disk IO ? or CPU ?)
• memcached (CPU ? or network ?)
forget benchmarks
• boring
• to use in capacity planning...not usually
worth the time
• not representative of real load
• test in production
what do you expect ?
• define what is acceptable
• examples:
• squid hits should take less than X
milliseconds
• SQL queries less than Y
milliseconds, and also keep up with
replication
measurement
accept the
observer effect
• measurement is a necessity.
• it’s not optional.
http://ganglia.sf.net
gmetad
• #!/bin/sh
• /usr/bin/iostat -x 4 2 sda | grep -v ^$ | tail -4 > /tmp/
disk-io.tmp
• UTIL=`grep sda /tmp/disk-io.tmp | awk '{print $14}'`
• /usr/bin/gmetric -t uint16 -n disk-util -v$UTIL -u '%'
memcached
what if you have graphs
but no raw data ?
• GraphClick
• http://www.arizona-software.ch/
applications/graphclick/en/
•
application usage
• Usage stats are just as important
• as server stats!
• Examples:
• # of user registrations
• # of photos uploaded every hour
not a straight line
another not straight line
but straight relationships!
measurement examples
queries
disk I/O
What we know now
• Ceilings at:
• - LRU ref age small enough to affect
hit ratio too much
• - Request rate large enough to affect
disk IO (to 100%)
squid requests and hits
squid hit ratio
LRU reference age
hit response times
What we know now
•http://flickr.com/photos/gaspi/62165296/
•http://flickr.com/photos/marksetchell/27964330/
•http://flickr.com/photos/sheeshoo/72709413/
•http://flickr.com/photos/jaxxon/165559708/
•http://flickr.com/photos/bambooly/298632541/
•http://flickr.com/photos/colloidfarl/81564759/
•http://flickr.com/photos/sparktography/75499095/