where is your data cached?

25
where is your data cached? (and where should it be cached?) sarah novotny [email protected]

description

Taking a look at the many layers of caching in the modern webstack can lead to some interesting optimizations. We know that raid card caches, disk caches and CPU caches all exist at the hardware level, but how do they interact with database caching, application code caching and rendered page caching. Where are the redundancies and where is the most optimal location for your services to cache? Are you risking data integrity by using both disk and raid card caching? Is there a similar risk in using both filesystem and database caching? These are hard won lessons if you have to learn them during an outage. they can be avoided with some forethought and benchmarking. I’ll call out the many layers where data is cached and talk about some of the risks and potential performance gains that we’ve found by selectively disabling and adding particular caching layers.

Transcript of where is your data cached?

Page 1: where is your data cached?

where is your data cached?

(and where should it be cached?)

sarah [email protected]

Page 2: where is your data cached?

①why do we cache?②count them③which are redundant?④which are a risk?⑤benchmarking ⑥monitoring

Page 3: where is your data cached?

①why do we cache

cache: a component that transparently stores data so that future requests for that data can be served faster

Page 4: where is your data cached?

CPU caches (L1, L2, L3)

disk caches

disk controller caches

database caches

memcached layer

application code caches

http cache

edge cache or CDN

operating system caches

② count them

Page 5: where is your data cached?

and then there were more

DNS caching (ISP and client side)

web proxies

client side application caches

and all the hardware caching again

Page 6: where is your data cached?

a short diversion:

my background is as an SA and DBA. i’ll be focusing data safety facets of caching

Page 7: where is your data cached?
Page 8: where is your data cached?

disk caches

disk controller caches

database caches

memcached layer

operating system caches

Page 9: where is your data cached?

③which are redundant?

Page 10: where is your data cached?

get moving!

Page 11: where is your data cached?
Page 12: where is your data cached?

④which are a risk?

Page 13: where is your data cached?

disks lie

Page 14: where is your data cached?

raid controllers lie (sometimes)

Page 15: where is your data cached?
Page 16: where is your data cached?

⑤ benchmarking

Page 17: where is your data cached?
Page 18: where is your data cached?

every infrastructure is different

every benchmarkhas to take that intoaccount

Page 19: where is your data cached?
Page 20: where is your data cached?

⑥ monitoring

Page 21: where is your data cached?

measure multiple points

only you can preventfiredrills

Page 22: where is your data cached?
Page 23: where is your data cached?

tools to managethis insanity—

InnotopPercona toolkitsysbenchcacti templatesnagios

Page 24: where is your data cached?

credits

flickr

• license plate – severud• tools – meanestindian

other

• 3ware image via http://www.xbitlabs.com/

• remaining images istockphoto

Page 25: where is your data cached?

CIO Meteor EntertainmentProgram Chair OSCONProgram Chair PLMCEBoard Member Blue Gecko

Chef CommunityMySQL Community

[email protected]@sarahnovotny

stuff I do