这里记录一些调研了解情况
FB在缓存方面的使用有一个很牛X的地方,就是用MC扛起一起缓存,像流行的Redis数据库,从来不用
强大的业务压力背后,是强大的MC中间件,叫mcrouter

DBA迫切需要的功能
front-ends数量(连接数问题)
扩容
缩容
HA
系统状态
开发迫切需要的功能
多机房同步写
多级cache,热key自动分离
再说memcache的multiget hole(无底洞)
About mcrouter
Introduction
- pronounced “mick-router”
- 5 billion requests per second
- BSD license
- easy-to-understand and easy-to-deploy
C++ 11CRagelFollyfbthrift- multiple independent threads
- configuration in JSON format

Features
- Standard open source memcached ASCII protocol support
支持标准的ASCII协议
- Connection poolin
采用连接池,减少对memcached的连接
- Multiple hashing schemes
采用一致性哈希
支持其他专用哈希算法

- Prefix routing
前缀路由,可把某些key单独放在一个实例上,分离压力

- Replicated pools
pool之间可做复制,读写分离,只读某个pool,写全部的pool。

Production traffic shadowing
生产环境引流测试,可灵活设定引流方式Online reconfiguration
配置文件热更新,自动加载,无延迟Flexible routing
没看懂。Destination health monitoring and automatic failover
自带健康检查,如果出现问题,会自动切换到其他destination,期间会不断检查坏掉的节点,如果恢复,会切回来。


- Cold cache warm up
增加节点不会以冷的cache响应客户端,会按照下面的逻辑进行warmup。

- Broadcast operations
指定关键字,可进行广播操作,如达到多写(有问题)、多删除的目的。

- Reliable delete stream
通过文件落地,达到可靠性删除。

- Multi-cluster support
多个cluster配置简单。
Rich stats and debug commands
丰富的系统状态,JSON。
“Which host would a particular request go to?”Quality of service
可以进行限流。Large values
大的item进行拆分,重组。Multi-level caches
优先查找local cache,如果没有,会查询remote cache并把结果写到local cache。IPv6 support
SSL support
Multi-threaded architecture
Reference
Introducing mcrouter: A memcached protocol router for scaling memcached deployments
[PDF]Scaling Memcache at Facebook
使用
- 安装
- 配置
- 测试
问题
- 如何监控
mcrouter
总结
- 是否满足平台对于mc的需求
- 对比
Twemproxy