Scaling MySQL in 3d sarah novotny – [email protected] [email protected] open databases and...

20
scaling MySQL in 3d sarah novotny – [email protected] open databases and LAMP services www.BlueGecko.net

Transcript of Scaling MySQL in 3d sarah novotny – [email protected] [email protected] open databases and...

Page 1: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net.

scaling MySQL in 3d

sarah novotny – [email protected] databases and LAMP services

www.BlueGecko.net

Page 2: Scaling MySQL in 3d sarah novotny – sarah@bluegecko.net sarah@bluegecko.net open databases and LAMP services . net.

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.

①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.

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.

①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.

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.

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.

②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.

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.

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.

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.

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.

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.

③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.

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.

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.

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.

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.

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.

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.