设想情况:
10.000.000记录/日
记录:访问者、访问日、群集(我们在哪里看到)、元数据
从这些信息中我们想知道:
为了方便地查询这些信息,我坚持使用的模型是:
{
VisitorId:1,
ClusterVisit: [
{clusterId:1, dates:[date1, date2]},
{clusterId:2, dates:[date1, date3]}
]
}索引:
为了更有效地访问数据,我还必须将集群组划分为不同的集合。
导入:首先,我们搜索VisitorId - ClusterId和addToSet日期的组合。
第二:如果第一次不匹配,我们将插入:
$addToSet: {VisitorId:1,
ClusterVisit: [{clusterId:1, dates:[date1]}]
}通过第一次和第二次导入,我将讨论clusterId不存在或VisitorId不存在的情况。
问题:当集合增长时,完全没有效率(几乎不可能)更新/插入/重新插入,我猜是因为在添加新日期时文档大小越来越大。难以维护(大部分日期未确定)
我有一个超过50.000.000的收藏品,我不能再增长了。它只更新100 ~记录/秒。
我认为我所使用的模型对于如此大的信息并不是最好的。在我处理分片之前,您认为最好的方法是获得更多的插入/秒并快速查询信息,因为在我学习和自信时,分片需要更多的时间。
我在AWS 10上有一个具有10个磁盘的x1大型实例
发布于 2012-11-20 20:29:18
数组在大型集合上是昂贵的: mapreduce,聚合.
尝试.explain():MongoDB 'count()' is very slow. How do we refine/work around with it?
添加索引的显式提示:Simple MongoDB query very slow although index is set
完整的堆?:Insert performance of node-mongodb-native
收集的内存空间的结束:How to improve performance of update() and save() in MongoDB?
特殊读聚类:http://www.colinhowe.co.uk/2011/02/23/mongodb-performance-for-data-bigger-than-memor/
全局写锁?:mongodb bad performance
慢速日志性能跟踪:Track MongoDB performance?
旋转日志:Does logging output to an output file affect mongoDB performance?
使用分析器:http://www.mongodb.org/display/DOCS/Database+Profiler
将一些集合缓存移动到RAM:MongoDB preload documents into RAM for better performance
关于集合分配大小的几点看法:MongoDB data schema performance
使用单独的集合:MongoDB performance with growing data structure
一个查询只能使用一个索引(最好是复合索引):Why is this mongodb query so slow?
丢失的钥匙?:Slow MongoDB query: can you explain why?
也许碎片:MongoDB's performance on aggregation queries
提高性能堆栈溢出链接:https://stackoverflow.com/a/7635093/602018
进一步切分复制教育的一个好点是:https://education.10gen.com/courses
https://stackoverflow.com/questions/13474674
复制相似问题