TokuDB 的ft tree 用在MongoDB产品TokuMX已经发布。MongoDB 在大量数据(比如1亿条记录)后,插入性能急剧下降。
Tokutek数据
带索引插入性能对比。
http://www.tokutek.com/2013/06/iibench-benchmark-tokumx-vs-mongodb/
以上为Tokutek的测试数据,下面为我测试的数据:
笔者实际测试
生产数据2亿多条导入测试
先建集合,创建3个索引,包括_id共4个索引。
TokuMX 5个多小时导完数据,官方MongoDB 2.2.4版本竟然花了2天2夜多,近58个小时
使用mongostat统计,每分钟取值一个,纵坐标为inserts/s,横坐标为分钟。
局部放大图:
磁盘空间占用比较:
TokuMX 18G,MongoDB 80G
内存使用比较:
TokuMX,cacheSize设置为30G,开directio,内存使用完没有cache的。
# free -g
total used free shared buffers cached
Mem: 31 31 0 0 0 0
-/+ buffers/cache: 30 0
Swap: 15 0 15
MongoDB,内存使用完,实际在cache里面
# free -g
total used free shared buffers cached
Mem: 31 31 0 0 0 28
-/+ buffers/cache: 1 29
Swap: 15 0 15
cpu使用:
未详细记录,TokuMX要高10%左右。
io:
MongoDB io要高不少。
总结:TokuMX太让人激动了,没有不使用它的理由,不过目前有些不支持的功能,如geo索引。
Currently unsupported functionality
● dropDups option for unique indexes
● Background Indexing, the “background” option is ignored when creating indexes.
● Fulltext indexes
● Geospatial indexes