mongodb日志中变量的含义 [英] Meaning of variables in mongodb logs

查看:206
本文介绍了mongodb日志中变量的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以向我解释一下mongodb中的日志,例如日志中每个变量的定义以及它们的含义吗?

Can anyone explain to me about the logs in mongodb like what each variable in logs are defined for and what they mean?

2015-02-26T16:05:24.112 + 0100 [conn1359]命令xxx.$ cmd命令:{ fsync:false,j:false,w:1}} keyUpdates:0 numYields:0 reslen:55 4045ms

2015-02-26T16:05:24.112+0100 [conn1359] command xxx.$cmd command: { fsync: false, j: false, w: 1 } } keyUpdates:0 numYields:0 reslen:55 4045ms

2015-02-26T16:05:24.114 + 0100 [conn1296]更新xxx.users查询: nscanned:2015 nscannedObjects:2015 nMatched:1 nModified:1 fastmod:1 keyUpdates:0 numYields:15个锁(micros)w:7292 4538ms

2015-02-26T16:05:24.114+0100 [conn1296] update xxx.users query: nscanned:2015 nscannedObjects:2015 nMatched:1 nModified:1 fastmod:1 keyUpdates:0 numYields:15 locks(micros) w:7292 4538ms

推荐答案

您需要参考

You need to refer to the Database Profiler Output section of the MongoDB documentation to get a detailed explanation of the query profile information like read and write operations, cursor operations, and database commands that MongoDB writes to the log. To answer your question

fsync : -强制mongod进程将所有未决的写操作从存储层刷新到磁盘.

fsync: - Forces the mongod process to flush all pending writes from the storage layer to disk.

keyUpdates :-操作中更新更改的索引键的数量.更改索引键会降低性能成本,因为数据库必须删除旧键并将新键插入B树索引.

keyUpdates: - The number of index keys the update changed in the operation. Changing an index key carries a small performance cost because the database must remove the old key and inserts a new key into the B-tree index.

numYield :-该操作产生的允许其他操作完成的次数.通常,操作在需要访问MongoDB尚未完全读入内存的数据时产生.这样,在MongoDB读取数据以进行屈服操作时,可以完成内存中具有数据的其他操作.

numYield: - The number of times the operation yielded to allow other operations to complete. Typically, operations yield when they need access to data that MongoDB has not yet fully read into memory. This allows other operations that have data in memory to complete while MongoDB reads in data for the yielding operation.

responseLength ( reslen ):-运算结果文档的字节长度.较大的响应长度会影响性能.

responseLength (reslen): - The length in bytes of the operation’s result document. A large responseLength can affect performance.

nscanned :-MongoDB在索引中扫描以执行操作的文档数.通常,如果nscanned远高于nreturned,则数据库正在扫描许多对象以查找目标对象.考虑创建索引来改善这一点.

nscanned: - The number of documents that MongoDB scans in the index in order to carry out the operation. In general, if nscanned is much higher than nreturned, the database is scanning many objects to find the target objects. Consider creating an index to improve this.

nMatched :-选择用于更新的文档数.如果更新操作导致文档没有更改,例如$ set表达式会将值更新为当前值,nMatched可以大于nModified.

nMatched: - The number of documents selected for update. If the update operation results in no change to the document, e.g. $set expression updates the value to the current value, nMatched can be greater than nModified.

nModified :-已更新的现有文档数.如果更新/替换操作未对文档造成任何更改(例如,将字段的值设置为其当前值),则nModified可以小于nMatched.

nModified: - The number of existing documents updated. If the update/replacement operation results in no change to the document, such as setting the value of the field to its current value, nModified can be less than nMatched.

lockStats locks(micros):-操作花费在获取和持有锁上的时间(以微秒为单位).此字段报告以下锁类型的数据:

lockStats locks(micros): - The time in microseconds the operation spent acquiring and holding locks. This field reports data for the following lock types:

R - global read lock
W - global write lock
r - database-specific read lock
w - database-specific write lock

timeLockedMicros :-操作持有特定锁定的时间(以微秒为单位).对于需要多个锁定的操作(例如那些锁定本地数据库以更新操作日志的操作),该值可能会比操作的总长度(即毫秒)长.

timeLockedMicros: - The time in microseconds the operation held a specific lock. For operations that require more than one lock, like those that lock the local database to update the oplog, this value may be longer than the total length of the operation (i.e. millis.)

这篇关于mongodb日志中变量的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆