Moxi - Memcached Proxy

26,026 views

Published on

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/

Published in: Technology
1 Comment
39 Likes
Statistics
Notes
  • beautiful art
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
26,026
On SlideShare
0
From Embeds
0
Number of Embeds
5,838
Actions
Shares
0
Downloads
338
Comments
1
Likes
39
Embeds 0
No embeds

No notes for slide

Moxi - Memcached Proxy

  1. 1. moxi a memcached proxy
  2. 2. who • steve yen • dustin sallings • matt ingenthron
  3. 3. rhymes with foxy
  4. 4. open source
  5. 5. multithreaded C
  6. 6. standing on the shoulders of giants • libmemcached • memcached • libevent
  7. 7. web stack apache php php php php memcached memcached memcached
  8. 8. choose your weapons apache php RoR Django perl memcached memcached memcached
  9. 9. php then... apache php php php php memcached memcached memcached
  10. 10. connection mesh apache php php php php memcached memcached memcached
  11. 11. moxi apache php php php php moxi memcached memcached memcached
  12. 12. moxi connections apache php php php php moxi memcached memcached memcached
  13. 13. moxi connections apache php php php php moxi memcached memcached memcached
  14. 14. moxi connections apache php php php php moxi configurable concurrency memcached memcached memcached
  15. 15. protocol conversion apache php php php php ascii protocol moxi ascii protocol memcached memcached memcached
  16. 16. protocol conversion apache php php php php ascii protocol moxi ascii protocol binary protocol memcached memcached memcached
  17. 17. auth’ed connections apache php php php php moxi auth’ed binary protocol memcached memcached memcached
  18. 18. consistent hashing apache php php php php moxi memcached memcached memcached
  19. 19. consistent hashing apache php php php php moxi a new server! memcached memcached memcached memcached
  20. 20. management channel apache php php php php dynamic reconfigurations and statistics moxi a new server! memcached memcached memcached memcached
  21. 21. GET de-duplication get item:2421 get item:2421 get item:2421
  22. 22. GET de-duplication apache get a b c get b c d get c d e moxi get a b c d e instead of... get a b c memcached get b c d get c d e
  23. 23. front cache apache php php php php front cache moxi memcached memcached memcached
  24. 24. front cache apache php php php php front cache moxi memcached memcached memcached
  25. 25. front cache apache php php php php Prefix-based. For limited number of hot items. front cache Served without moxi hitting wire. Simple expirations. Meant for replication friendly content. memcached memcached memcached
  26. 26. front cache hot items replicated across many front caches. moxi moxi moxi memcached memcached memcached
  27. 27. front cache hot items replicated across many front caches. moxi moxi moxi memcached memcached memcached
  28. 28. front cache hot items replicated across many front caches. lazily. moxi moxi moxi memcached memcached memcached
  29. 29. failure handling moxi moxi moxi memcached memcached memcached
  30. 30. failure handling for hiccups: configurable retry counts. then send misses and ERROR back to clients moxi moxi moxi memcached memcached memcached
  31. 31. failure handling for deep failures (and for planned server changes) dynamic reconfiguration messages moxi moxi moxi mgmt channel memcached memcached memcached memcached
  32. 32. failure handling for deep failures (and for planned server changes) dynamic reconfiguration messages moxi moxi moxi mgmt channel memcached memcached memcached memcached
  33. 33. draining and filling lazily migrate items from old server to new server moxi moxi moxi mgmt channel memcached memcached memcached memcached draining filling
  34. 34. draining and filling N time later, just use filled server only moxi moxi moxi mgmt channel memcached memcached memcached memcached drained filled
  35. 35. timeout
  36. 36. timeout • if a request takes more than X millisecs, moxi should return a miss or error
  37. 37. 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
  38. 38. fire & forget SET client... moxi... session[‘shopping-cart’] = user_cart; sends... set session:123456 some_big_value receives... set session:123456 some_big_value sees a match with configurable prefix “session:” responds with STORED to client. receives STORED. forwards to memcached asynchronously. continues on its way.
  39. 39. inside moxi • memcached • libevent • libmemcached
  40. 40. inside moxi memcached hash item manager table slabber ascii binary protocol protocol handler handler drive_machine protocol state machine libevent
  41. 41. inside moxi memcached proxy hash item manager libmemcached front table slabber dyna-config matcher cache ascii binary ascii proxy ascii proxy binary proxy protocol protocol upstream downstream downstream handler handler protocol handler protocol handler protocol handler drive_machine protocol state machine libevent
  42. 42. inside moxi memcached proxy hash item manager libmemcached front table slabber dyna-config matcher cache ascii binary ascii proxy ascii proxy binary proxy protocol protocol upstream downstream downstream handler handler protocol handler protocol handler protocol handler drive_machine protocol state machine libevent
  43. 43. moxi embeds memcached memcached proxy hash item manager libmemcached front table slabber dyna-config matcher cache ascii binary ascii proxy ascii proxy binary proxy protocol protocol upstream downstream downstream handler handler protocol handler protocol handler protocol handler drive_machine protocol state machine libevent
  44. 44. moxi’s can talk to themselves but, they think they’re talking to memcached moxi moxi moxi
  45. 45. moxi’s can talk to themselves and to memcached and, they still think they’re talking to just memcached moxi moxi moxi memcached
  46. 46. moxi’s can talk to themselves and to memcached and, they still think they’re talking to just memcached moxi moxi moxi memcached memcached
  47. 47. moxi’s can talk to themselves and to memcached and, they still think they’re talking to just memcached moxi moxi moxi memcached memcached memcached
  48. 48. moxi’s can talk to themselves and to memcached(*) and, they still think they’re talking to just memcached moxi moxi moxi memcached tokyo memcachedb tyrant
  49. 49. starting moxi memcached command command-line line • memcached -m 512 • moxi -m 512 -z [configkey]
  50. 50. when can I get moxi?
  51. 51. today • upcoming features • draining/filling - August 2009 • everything else is done • Available Now
  52. 52. where can I get moxi?
  53. 53. links • getting moxi • http://labs.northscale.com/moxi • read, join list • moxi@googlegroups.com
  54. 54. support, training • available from NorthScale, Inc. • steve.yen@northscale.com • 888.399.5509 • support@northscale.com
  55. 55. questions?
  56. 56. thanks! photo credits • http://flickr.com/photos/davebluedevil/15877348/ • http://www.flickr.com/photos/theamarand/2874288064/ • http://www.flickr.com/photos/splityarn/3469596708/ • http://www.flickr.com/photos/heisnofool/3241930754/ • http://www.flickr.com/photos/onourminds/2885704630/ • http://www.flickr.com/photos/lunaspin/990825818/
  57. 57. talking to itself optimization
  58. 58. stats aggregation broadcasts “stats”. sums the responses. moxi memcached memcached memcached
  59. 59. flush_all broadcasts “flush_all” to memcached servers moxi memcached memcached memcached

×