What is Mcrouter? Use McRouter scale out Memcache for a Microservices solution

Tram Ho

Mcrouter acts as a router for the memcache services. This is a component of the cache infrastructure at Facebook and Instagram, which processes close to 5 billion requests per second. Mcrouter is developed and maintained by Facebook.

Installation Instructions

See this document: https://github.com/facebook/mcrouter

Sharded pools setup

Write the setup file to the json file Then run the command: mcrouter file.json -p port(s) -f config Memcached protocol router for scaling memcached deployments with:

  • Multiple hashing schemas -> hash table
  • Multi-cluster support

  • Prefix routing -> config with json
  • Flexible routing -> config with json

Explanation : requests with key prefix “a” will be sent to pool ‘workload1’, requests with key prefix “b” will be sent to pool ‘workload2’, requests with key prefix “ab” will be sent to pool ‘workload3’. Other requests will be sent to pool ‘common_cache’. So key “acd” will be sent to ‘workload1’; “abcd” to ‘workload3’; “bar” to ‘workload2’; “zzz” to ‘common_cache’.

  • Sharded pools

  • Replicated pools

Note: number of retries is 5.

  • Broadcast operations
  • Production traffic shadowing

  • Cold cache warm up

  • ** Memcached ASCII protocol **
  • Reliable delete stream
  • Large values
  • Muti-level caches
  • Quality of service
  • Destination health monitoring / automatic failover
  • Rich stats counters, Stats commands and debug commands
  • Online reconfiguration
  • Ipv6 support
  • SSL support
Share the news now

Source : Viblo