This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_id" : ObjectId("53744abad3a11771ea04bc32"), | |
"-name" : "Unalaska", // station Name | |
"-ID" : "9462620", // station ID | |
"metadata" : { | |
"location" : { | |
"lat" : "53.88", // Geo Lat | |
"long" : "-166.537", // Geo Long | |
"state" : "AK" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_id" : ObjectId("53c281bb2239c277d82494a3"), | |
"station_id" : 8449130, | |
"name" : "Nantucket Island", | |
"lon" : -70.0967, | |
"products" : [ | |
{ | |
"v" : 72.1, | |
"t" : ISODate("2014-07-13T12:42:00Z"), | |
"name" : "water_temperature", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongoperf < perfsession1.js | |
mongoperf | |
use -h for help | |
options: | |
{ nThreads: 2, w: true, r: false, mmf: true, fileSizeMB: 256 } | |
creating test file size:256MB ... | |
testing... | |
new thread, total running : 1 | |
9922222 ops/sec | |
11197085 ops/sec |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$>echo "{nThreads:2,w:true,r:false,mmf:false,fileSizeMB:10000}" > perfsession1.js | |
$> | |
$>mongoperf < perfsession1.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$>echo "{nThreads:2,w:true,r:false,mmf:true}" > perfsession1.js | |
$> | |
$>mongoperf < perfsession1.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Export/Import using named pipe | |
# Doesn't use disk I/O, just pipes input through pipes | |
# | |
# Node 1 | Terminal A | |
# | |
mkfifo /tmp/mongodump_pipe | |
# now export the data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var balance_check = function(n) { | |
if ( n ) { | |
var output = db.chunks.aggregate([ | |
{ $group : { _id : { "_id":"$ns", "shard":"$shard" }, chunks : { $sum : 1 } }}, | |
{ $match : { "_id._id" : n } }, | |
{ $sort : { "chunks" : 1 } } | |
]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ts" : ISODate("2012-09-14T16:34:00.010Z"), // date it occurred | |
"op" : "query", // the operation type | |
"ns" : "game.players", // the db and collection | |
"query" : { "total_games" : 1000 }, // query document | |
"ntoreturn" : 0, // # docs returned with limit() | |
"ntoskip" : 0, // # of docs to skip() | |
"nscanned" : 959967, // number of docs scanned | |
"keyUpdates" : 0, // updates of secondary indexes | |
"numYield" : 1, // # of times yields took place |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MongoM:PRIMARY> db.system.profile.findOne() | |
{ | |
"ts" : ISODate("2013-02-13T17:23:58.809Z"), | |
"op" : "insert", | |
"ns" : "test.foot", | |
"keyUpdates" : 0, | |
"numYield" : 0, | |
"millis" : 0, | |
"client" : "127.0.0.1", | |
"user" : "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> db.system.profile.aggregate( | |
{ $group : | |
{ _id :"$op", | |
count:{$sum:1}, | |
"max response time":{$max:"$millis"}, | |
"avg response time":{$avg:"$millis"} | |
} | |
}); | |
{ |