Documentos de Académico
Documentos de Profesional
Documentos de Cultura
MongoSF
May 2011
Kenny Gorman, Data Architect
Shutterfly Inc.
60000
Writes
40000
Reads
20000
0
R/O
25/75
R/W
// with fastmod
> db.ptest.update({userid:10},{$inc:{likes:1}});
> db.system.profile.find({}).sort({$natural:-1});
{ "ts" : ISODate("2011-05-18T18:30:20.802Z"), "info" : "update test.ptest query: { userid: 10.0 }
nscanned:1 fastmod 0ms", "millis" : 0 }
}
}
// write example
>db.container.update({_id:99},{$inc:{imageCount:1}});
...
"indexOnly" : true,
...
!!
• mongostat
• Aggregate instance level information
> Faults; cache misses
> Lock%; tune updates
• mtop
• Good picture of current session level information
• Picture of db.currentOp()
> Watch "waitingForLock" : true
• iostat
• How much physical I/O are you doing?
• Home grown load test
• Make it a priority to try different patterns, measure results.
• Historical data repository
// r/w not too much miss, some inserts, not bad locked %
insert query update delete getmore command flushes mapped vsize res faults locked % idx miss % qr|qw conn repl time
88 92 22 0 181 236 0 1542g 1559g 38g 7 2.9 0 0|0 1467 M 12:55:42
93 93 15 0 170 218 0 1542g 1559g 38g 10 5.2 0 0|0 1467 M 12:55:43
82 140 3 0 153 233 0 1542g 1559g 38g 4 1.5 0 0|0 1468 M 12:55:44
94 134 5 0 169 251 0 1542g 1559g 38g 5 1.8 0 0|0 1468 M 12:55:45
76 147 12 0 135 257 0 1542g 1559g 38g 6 2.5 0 0|0 1468 M 12:55:46
77 78 9 0 133 173 0 1542g 1559g 38g 7 3.9 0 0|0 1468 M 12:55:47
81 78 5 0 128 177 0 1542g 1559g 38g 7 6.1 0 0|0 1468 M 12:55:48
71 133 7 0 125 212 0 1542g 1559g 38g 6 2.9 0 0|0 1468 M 12:55:49
Questions?
Contact:
http://www.kennygorman.com
twitter: @kennygorman
http://www.shutterfly.com
kgorman@shutterfly.com