Moxi - Memcached Proxy

Post on 15-Jan-2015

18.632 views 2 download

Tags:

description

moxi is a memcached proxy with several features which can help keep the memcached contract whole in complicated environments. It also brings several optimizations to memcached deployments, without requiring any changes to the application software using memcached. For more, visit: http://labs.northscale.com/moxi/

Transcript of Moxi - Memcached Proxy

moxia memcached proxy

who

• steve yen

• dustin sallings

• matt ingenthron

rhymes with foxy

open source

multithreaded C

standing on the shoulders of giants

• libmemcached

• memcached

• libevent

apache

web stack

php php php php

memcached memcached memcached

apache

choose your weapons

php RoR Django perl

memcached memcached memcached

apache

php then...

php php php php

memcached memcached memcached

apache

connection mesh

php php php php

memcached memcached memcached

apache

moxi

php php php php

moxi

memcached memcached memcached

apache

moxi connections

php php php php

moxi

memcached memcached memcached

apache

moxi connections

php php php php

moxi

memcached memcached memcached

apache

moxi connections

php php php php

moxi

memcached memcached memcached

configurableconcurrency

apache

protocol conversion

php php php php

ascii protocol

ascii protocol

moxi

memcached memcached memcached

apache

protocol conversion

php php php php

ascii protocol

binary protocolascii protocol

moxi

memcached memcached memcached

apache

auth’ed connections

php php php php

moxi

memcached memcached memcached

binary protocolauth’ed

apache

consistent hashing

php php php php

moxi

memcached memcached memcached

apache

consistent hashing

php php php php

memcached memcached memcached

a new server!

memcached

moxi

apache

management channel

php php php php

a new server!

moxidynamic reconfigurations

and statistics

memcached memcached memcachedmemcached

GET de-duplication

get item:2421

get item:2421

get item:2421

apache

GET de-duplication

get a b c

memcached

get c d e

get a b c d e

get b c d

moxi

instead of...get a b cget b c dget c d e

apache

front cache

php php php php

moxifront cache

memcached memcached memcached

apache

front cache

php php php php

moxifront cache

memcached memcached memcached

apache

front cache

php php php php

moxifront cache

Prefix-based. For limited number of hot items.

Served withouthitting wire.

Simple expirations.Meant for replication

friendly content.

memcached memcached memcached

front cache

moxi moxi moxi

hot items replicated across many front caches.

memcached memcached memcached

front cache

moxi moxi moxi

hot items replicated across many front caches.

memcached memcached memcached

front cache

moxi moxi moxi

hot items replicated across many front caches.lazily.

memcached memcached memcached

failure handling

moxi moxi moxi

memcached memcached memcached

failure handling

moxi moxi moxi

memcached memcached memcached

for hiccups: configurable retry counts.then send misses and ERROR back to clients

failure handling

memcached

for deep failures (and for planned server changes)dynamic reconfiguration messages

memcachedmemcached memcached

mgmtchannel

moxi moxi moxi

failure handling

memcachedmemcached memcached

mgmtchannel

for deep failures (and for planned server changes)dynamic reconfiguration messages

moxi moxi moxi

memcached

draining and filling

memcached memcached

mgmtchannel

lazily migrate items from old server to new server

memcachedmemcached

moxi moxi moxi

draining filling

draining and filling

memcached memcached

mgmtchannel

N time later, just use filled server only

memcachedmemcached

moxi moxi moxi

drained filled

timeout

timeout• if a request takes more than X millisecs,

moxi should return a miss or error

blackhole configuration

• GET’s become misses

• SET’s become error

• clients never wait, such as trying to make a connection to a non-existent memcached

client...session[‘shopping-cart’] = user_cart;

sends... set session:123456 some_big_value

receives STORED.

continues on its way.

moxi...

receives... set session:123456 some_big_value

sees a match with configurable prefix “session:”

responds with STORED to client.

forwards to memcached asynchronously.

fire & forget SET

inside moxi

• memcached

• libevent

• libmemcached

inside moxi

libevent

drive_machineprotocol state machine

item manager

slabber

ascii protocol handler

binary protocol handler

memcached

hashtable

inside moxi

libevent

drive_machineprotocol state machine

item manager

slabber

ascii protocol handler

ascii proxy upstream

protocol handler

binary proxy downstream

protocol handler

ascii proxy downstream

protocol handler

binary protocol handler

memcached proxy

dyna-config

libmemcached

matcherfrontcache

hashtable

inside moxi

libevent

drive_machineprotocol state machine

item manager

slabber

ascii protocol handler

ascii proxy upstream

protocol handler

binary proxy downstream

protocol handler

ascii proxy downstream

protocol handler

binary protocol handler

memcached proxy

dyna-config

libmemcached

matcherfrontcache

hashtable

moxi embeds memcached

libevent

drive_machineprotocol state machine

item manager

slabber

ascii protocol handler

ascii proxy upstream

protocol handler

binary proxy downstream

protocol handler

ascii proxy downstream

protocol handler

binary protocol handler

memcached proxy

dyna-config

libmemcached

matcherfrontcache

hashtable

moxi’s can talk to themselves

but, they think they’re talking to memcached

moxi moxi moxi

memcached

moxi moxi moxi

and, they still think they’re talking to just memcached

moxi’s can talk to themselvesand to memcached

memcached memcached

moxi moxi moxi

and, they still think they’re talking to just memcached

moxi’s can talk to themselvesand to memcached

memcached memcached memcached

moxi moxi moxi

and, they still think they’re talking to just memcached

moxi’s can talk to themselvesand to memcached

memcached tokyotyrant

memcachedb

moxi moxi moxi

and, they still think they’re talking to just memcached

moxi’s can talk to themselvesand to memcached(*)

starting

• memcached -m 512

• moxi -m 512 -z [configkey]

memcachedcommand-line

moxicommand

line

when can I get moxi?

today

• upcoming features

• draining/filling - August 2009

• everything else is done

• Available Now

where can I get moxi?

links

• getting moxi

• http://labs.northscale.com/moxi

• read, join list

• moxi@googlegroups.com

support, training

• available from NorthScale, Inc.

• steve.yen@northscale.com

• 888.399.5509

• support@northscale.com

questions?

talking to itselfoptimization

stats aggregation

moxi

memcached memcached memcached

broadcasts “stats”. sums the responses.

flush_all

moxi

memcached memcached memcached

broadcasts “flush_all” to memcached servers