[mongodb-user] What is the globalLock time?

307 views
Skip to first unread message

Xaprb

unread,
May 5, 2010, 9:35:09 PM5/5/10
to mongodb-user
I've just read through the docs and searched the forum to try to
understand the meaning of this output from serverStatus:

"globalLock" : {
"totalTime" : 288777173126,
"lockTime" : 1366671934,
"ratio" : 0.0047326176068760465
},

The docs are not very revealing:

- http://www.mongodb.org/display/DOCS/Internal+Commands has nothing
useful
- http://www.mongodb.org/display/DOCS/Monitoring+and+Diagnostics has
more:
"globalLock - totalTime & lockTime are total ms since startup that
there has been a write lock"

But that doesn't really explain what this means. I'm guessing that
lockTime is the time spent actually acquiring locks, and totalTime is
the total time such locks are held until being released? Is that
correct?

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Eliot Horowitz

unread,
May 5, 2010, 9:51:43 PM5/5/10
to mongod...@googlegroups.com
totalTime is uptime
lockTime is the amount of time the global lock has been held

Baron Schwartz

unread,
May 5, 2010, 10:09:45 PM5/5/10
to mongod...@googlegroups.com
If totalTime is uptime (server uptime since the mongo program was
started?) then why is it inside of globalLock? But your answer makes
sense, because the sample I am looking at says:

> db._adminCommand({serverStatus:1})
{
"uptime" : 288777,
"globalLock" : {
"totalTime" : 288777173126,

So indeed it does look like uptime and totalTime are redundant.

Thanks!
Baron
--
Baron Schwartz
Percona Inc <http://www.percona.com/>
Consulting, Training, Support & Services for MySQL

Eliot Horowitz

unread,
May 5, 2010, 10:13:41 PM5/5/10
to mongod...@googlegroups.com
totalTime will rollover faster since its microseconds.
so at some point they will diverge.
the rollover is coordinated between totalTime and lockTime
Reply all
Reply to author
Forward
0 new messages