scaling my sql_in_3d

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

Upload: sarahnovotny

Post on 08-May-2015

477 views

Category:

Technology


0 download

DESCRIPTION

Different organizations mean different things when they talk about scaling. Sarah will offer some tips about a few different ways that this term is thrown around for MySQL databases. Each different dimension – data volume, read volume, and write volume – present different challenges to the operations and development staff working with the system.

TRANSCRIPT

Page 1: Scaling my sql_in_3d

scaling MySQL in 3d

sarah novotny – [email protected] databases and LAMP services

www.BlueGecko.net

Page 2: Scaling my sql_in_3d

①large datasets②high volume reads③high volume writes

www.BlueGecko.net

http://www.flickr.com/photos/elbragon

Page 3: Scaling my sql_in_3d

things you’ve heard about scale

write 1 / read manypartitioning / shardingmultimaster / ringsmemcached / nosql

www.BlueGecko.net

Page 4: Scaling my sql_in_3d

storage choices

engine optionsstorage enginefilesystemvolume managerhardware

www.BlueGecko.net

http://www.flickr.com/photos/shuttercat7

Page 5: Scaling my sql_in_3d

①large datasets

large objectsmany rows

www.BlueGecko.net

http://www.flickr.com/photos/olivander

Page 6: Scaling my sql_in_3d

storage flexibility, reliability, clone-ability

www.BlueGecko.net

http://www.flickr.com/photos/wwworks

Page 7: Scaling my sql_in_3d

www.BlueGecko.net

http://www.flickr.com/photos/alreadytaken

Page 8: Scaling my sql_in_3d

②high volume reads

more memoryfast disksmore memory

www.BlueGecko.net

http://www.flickr.com/photos/teclasorg

Page 9: Scaling my sql_in_3d

www.BlueGecko.net

myisam vs innodb

http://www.flickr.com/photos/redjar

Page 10: Scaling my sql_in_3d

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 my sql_in_3d

use thoughtful primary keys

www.BlueGecko.net

Page 12: Scaling my sql_in_3d

ashortdiversion

to swap ornot to swap that is the question

www.BlueGecko.net

Page 13: Scaling my sql_in_3d

www.BlueGecko.net

http://www.flickr.com/photos/teclasorg

Page 14: Scaling my sql_in_3d

③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 my sql_in_3d

facebook game case:

highly concurrent writeslow risk of --omg, i lost my most recent score!

www.BlueGecko.net

Page 16: Scaling my sql_in_3d

shard datainnodb_log_flush_at_trx_commit=0benchmark i/o schedulers

www.BlueGecko.net

Page 17: Scaling my sql_in_3d

free tools

innotopmaatkitMySQL proxymonitoring/trending

cacti templates$monitoring_server – the one you know

www.BlueGecko.net

Page 18: Scaling my sql_in_3d

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 my sql_in_3d

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 my sql_in_3d

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.