MongoDB - CPU / Document limit

67 views
Skip to first unread message

Suhail Doshi

unread,
Jun 30, 2011, 8:12:49 PM6/30/11
to mongodb-user
We're doing lots of updates with a $push where the criteria only is
using the _id key. We're seeing a lot of CPU usage.

Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s
avgrq-sz avgqu-sz await svctm %util
sda 0.00 9.00 0.00 96.00 0.00 20.93
446.42 0.30 3.12 0.21 2.00

avg-cpu: %user %nice %system %iowait %steal %idle
35.61 0.00 17.07 0.00 0.00 47.32

Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s
avgrq-sz avgqu-sz await svctm %util
sda 0.00 0.00 0.00 88.00 0.00 19.49
453.64 0.13 1.48 0.23 2.00

avg-cpu: %user %nice %system %iowait %steal %idle
35.29 0.00 14.22 1.47 0.00 49.02

Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s
avgrq-sz avgqu-sz await svctm %util
sda 0.00 0.00 0.00 175.00 0.00 40.84
477.90 0.89 5.09 0.17 3.00

avg-cpu: %user %nice %system %iowait %steal %idle
34.62 0.00 12.02 0.96 0.00 52.40

Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s
avgrq-sz avgqu-sz await svctm %util
sda 0.00 0.00 0.00 282.00 0.00 64.39
467.60 1.46 5.18 0.14 4.00

avg-cpu: %user %nice %system %iowait %steal %idle
33.66 0.00 16.59 0.49 0.00 49.27

Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s
avgrq-sz avgqu-sz await svctm %util
sda 0.00 0.00 0.00 110.00 0.00 24.95
464.44 0.11 1.00 0.27 3.00

There's only one index: _id

{ "_id" : "11736:3be9f70762202b85", "active" : 1307571480, "history" :
[
{
"note" : "",
"properties" : {
"platform" : "Mac OS X",
"page" : "http://example.com/home",
"browser" : "Firefox"
},
"event" : "096329fdf32c2eb44702fc9310248509",
"created" : ISODate("2011-06-08T20:25:56Z")
},
{
"note" : "",
"properties" : {
"platform" : "Mac OS X",
"page" : "http://example.com/home",
"browser" : "Firefox"
},
"event" : "096329fdf32c2eb44702fc9310248509",
"created" : ISODate("2011-06-08T20:25:44Z")
},
], "name_tag" : "" }

One problem is that we're exceeding the document size (which we're
fine with and basically doing a no-op) but believe that there may be
an expensive thing going fundamentally with mongodb when it hits this
scenario (e.g. exception handler). Ideas and thoughts?

Suhail

Eliot Horowitz

unread,
Jul 1, 2011, 1:06:31 AM7/1/11
to mongod...@googlegroups.com
There definitely is going to be a fair amount of cpu involved in that tossing.
Its going to first build the whole new document, then check the size.

> --
> 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.
>
>

Suhail Doshi

unread,
Jul 5, 2011, 1:34:40 PM7/5/11
to mongodb-user
What would you recommend to avoid that scenario? Check the count on
history? Keep a counter?

Also, anyway in next versions that you can check the potential size
first then build the document?


On Jun 30, 10:06 pm, Eliot Horowitz <eliothorow...@gmail.com> wrote:
> There definitely is going to be a fair amount ofcpuinvolved in that tossing.
> Its going to first build the whole newdocument, then check the size.
> > One problem is that we're exceeding thedocumentsize (which we're

Eliot Horowitz

unread,
Jul 5, 2011, 7:42:44 PM7/5/11
to mongod...@googlegroups.com
A counter would be good, or later you'll be able to do $lt queries on $size.

Checking total size before would be good.
Can you add a feature request @ http://jira.mongodb.org/

Reply all
Reply to author
Forward
0 new messages