摘要: 建议先设置好配置文件/etc/mongod.conf后,每次手动用命令启动 mongod -f /etc/mongod.conf mongod --dbpath=/data0/MongoDB/db --logpath=/data0/mongodb/log/mongodb.log --fork 强制关 阅读全文
posted @ 2017-04-28 21:51 車輪の唄 阅读(15) 评论(0) 推荐(0)
摘要: 1.3000万数据建立索引,datatime类型占用100m左右,9位string类型占用200m,5位int占160m 2.聚合操作,100-200万数据在2-3s,超过这个值的数据就不能直接做报表输出了,响应速度会很慢 3.16g内存单机每秒1w写入操作,持续36hours,性能不会达到瓶颈 4 阅读全文
posted @ 2017-04-28 21:47 車輪の唄 阅读(17) 评论(0) 推荐(0)
摘要: 实现类 public class Singleton { private static class LazyHolder { private static final Singleton INSTANCE = new Singleton(); } private Singleton (){} pub 阅读全文
posted @ 2017-04-28 21:47 車輪の唄 阅读(15) 评论(0) 推荐(0)
摘要: 1.Redis适合做key少value大的计数统计 mongo适合使用聚合做key多value少的计数统计,使用聚合的方式 2.mongo可以直接使用key-value做计数而不是聚合,但是这种方式只试用统计访问总数,而不是访问人次 3.使用mongo聚合的方式统计更加灵活,可以扩充功能。比如统计d 阅读全文
posted @ 2017-04-28 21:46 車輪の唄 阅读(19) 评论(0) 推荐(0)