scaling mysql in 3d sarah novotny – [email protected] [email protected] open databases and...
TRANSCRIPT
![Page 2: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/2.jpg)
things you’ve heard about scale
write 1 / read manypartitioning / shardingmultimaster / ringsmemcached / nosql
www.BlueGecko.net
![Page 3: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/3.jpg)
①large datasets②high volume reads③high volume writes
www.BlueGecko.net
http://www.flickr.com/photos/elbragon
![Page 4: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/4.jpg)
storage choices
engine optionsstorage enginefilesystemvolume managerhardware
www.BlueGecko.net
http://www.flickr.com/photos/shuttercat7
![Page 5: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/5.jpg)
①large datasets
large objectsmany rows
www.BlueGecko.net
http://www.flickr.com/photos/olivander
![Page 6: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/6.jpg)
storage flexibility, reliability, clone-ability
www.BlueGecko.net
http://www.flickr.com/photos/wwworks
![Page 7: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/7.jpg)
www.BlueGecko.net
http://www.flickr.com/photos/alreadytaken
![Page 8: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/8.jpg)
②high volume reads
more memoryfast disksmore memory
www.BlueGecko.net
http://www.flickr.com/photos/teclasorg
![Page 9: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/9.jpg)
www.BlueGecko.net
myisam vs innodb
http://www.flickr.com/photos/redjar
![Page 10: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/10.jpg)
www.BlueGecko.net
not to be obvious, but -- read less data!
compress data (if you can)
don’t use limit
http://www.flickr.com/photos/rogersmith
![Page 11: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/11.jpg)
use thoughtful primary keys
www.BlueGecko.net
![Page 12: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/12.jpg)
ashortdiversion
to swap ornot to swap that is the question
www.BlueGecko.net
![Page 13: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/13.jpg)
www.BlueGecko.net
http://www.flickr.com/photos/teclasorg
![Page 14: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/14.jpg)
③high volume writes
choose your filesystem wellunderstand how your filesystem and raid controller work togethertune them to work in concert
www.BlueGecko.net
![Page 15: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/15.jpg)
facebook game case:
highly concurrent writeslow risk of --omg, i lost my most recent score!
www.BlueGecko.net
![Page 16: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/16.jpg)
shard datainnodb_log_flush_at_trx_commit=0benchmark i/o schedulers
www.BlueGecko.net
![Page 17: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/17.jpg)
free tools
innotopmaatkitMySQL proxymonitoring/trending
cacti templates$monitoring_server – the one you know
www.BlueGecko.net
![Page 18: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/18.jpg)
additional resources
• irc.freenode.org– #mysql– #maatkit
• mysql.com• HPM2e -Baron Schwartz,
Peter Zaitsev, Vadim Tkachenko, and Jeremy Zawodny
www.BlueGecko.net
![Page 19: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/19.jpg)
credits• swap image
– http://www.vocw.edu.vn/content/m10106/latest/
• special thanks to gabriel cain and mike hamrick for suggestions on content and slides
www.BlueGecko.net
![Page 20: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net](https://reader035.vdocuments.site/reader035/viewer/2022062222/5697bfc31a28abf838ca58d3/html5/thumbnails/20.jpg)
Blue Gecko and contact info
• [email protected]• [email protected]• @sarahnovotny• @bluegecko• senk on #mysql
www.BlueGecko.net
Blue Gecko provides Remote DBA services for companies around the world
7x24x365 support including monitoring, performance analysis, proactive maintenance and architectural guidance for small and large datasets.