MongoDB性能和数据安全的严重问题

时间:2013-10-18 06:27:42

标签: performance mongodb

我正在使用mongodb 2.4.3,我遇到了一些严重的问题:

首先,效果

我的mongodb服务器日志中有大约40000个项目如下:

Fri Oct 18 03:10:15.396 [conn20627] update onlinetime.online_2013_10_18 query: { _id: 63545 } update: { $inc: { olt: 12085 } } nscanned:1 nupdated:1 keyUpdates:1 locks(micros) w:89 628ms
Fri Oct 18 03:10:15.396 [conn20658] update onlinetime.online_2013_10_18 query: { _id: 101599 } update: { $inc: { olt: 15018 } } nscanned:1 nupdated:1 keyUpdates:1 locks(micros) w:83 625ms
Fri Oct 18 03:10:15.396 [conn20656] update onlinetime.online_2013_10_18 query: { _id: 143782 } update: { $inc: { olt: 14897 } } nscanned:1 nupdated:1 keyUpdates:1 locks(micros) w:75 600ms
Fri Oct 18 03:10:15.396 [conn20629] update onlinetime.online_2013_10_18 query: { _id: 98588 } update: { $inc: { olt: 13895 } } nscanned:1 nupdated:1 keyUpdates:1 locks(micros)  w:82 610ms
Fri Oct 18 03:10:15.396 [conn20670] update onlinetime.online_2013_10_18 query: { _id: 145266 } update: { $inc: { olt: 17629 } } nscanned:1 nupdated:1 keyUpdates:1 locks(micros) w:79 593ms
Fri Oct 18 03:10:15.396 [conn20642] update onlinetime.online_2013_10_18 query: { _id: 71860 } update: { $inc: { olt: 15026 } } nscanned:1 nupdated:1 keyUpdates:1 locks(micros) w:79 604ms

这些日志是什么意思? _id之类的{ $inc: { olt: 12085 }进行的简单更新是否需要628毫秒才能完成?

集合online_2013_10_18中只有20000条左右的记录。

mongodb是否存在严重的性能问题?或者我只是滥用它?甚至更奇怪的是日志项目显示:

update taxilogs.log_PUSH_2013_10_18 query: { idxs: 1827626800 } update: { $addToSet: { acks: { rid: 36045, date: new Date(1382076054148) } }, $inc: { acks_c: 1 } } nscanned:1 nmoved:1 nupdated:1 keyUpdates:0 locks(micros) w:3575082 3575ms

更新需要3575毫秒才能完成?

其次:数据丢失

从我的应用程序日志中,我确信更新已发布到mongodb。但这就是我在日志中看到的:

update:{ "idxs" : 1827771018},{ "$addToSet" : { "acks" : { "rid" : 130284 , "date" : { "$date" : "2013-10-18T05:27:08.358Z"}}} ,"$inc" : { "acks_c" : 1}}.
but when I query data using find({ "idxs" : 1827771018},{acks_c:1,recs_c:1}),mongodb returns { "_id" : ObjectId("5260b3450cf2f82eef378e8d"), "recs_c" : 99 }

acks_c没有更新,出了什么问题?在mongodb的服务器日志中没有发现异常。

mongodb可能会默默地丢失一些更新吗?

0 个答案:

没有答案
相关问题