Skip to content

Instantly share code, notes, and snippets.

View FrancescaK's full-sized avatar

Francesca Krihely FrancescaK

View GitHub Profile
Sat Apr 5 22:29:54 [conn99] command serverside.$cmd command: { getlasterror: 1, w: "majority" } ntoreturn:1 keyUpdates:0 reslen:112 1006370ms
mloginfo mongod.log --queries
QUERIES
namespace pattern count min (ms) max (ms) mean (ms) 95%-ile (ms) sum (ms)
serverside.scrum_master {"datetime_used": {"$ne": 1}} 20 15753 17083 16434 17039.3 328692
serverside.django_session {"_id": 1} 562 101 1512 317 842.6 178168
serverside.user {"_types": 1, "emails.email": 1} 804 101 1262 201 684.85 162311
local.slaves {"_id": 1, "host": 1, "ns": 1} 131 101 1048 310 819.5 40738
@FrancescaK
FrancescaK / gist:92b1eec30d9fa73d54a2
Created May 6, 2014 18:19
Tiered_Storage_Gist12
sh.status()
--- Sharding Status ---
sharding version: {
"_id" : 1,
"version" : 3,
"minCompatibleVersion" : 3,
"currentVersion" : 4,
"clusterId" : ObjectId("5314f1487abd6cb2803696d6")
}
shards:
@FrancescaK
FrancescaK / gist:b83a518ec21ae1e56f0b
Created May 6, 2014 18:17
Tiered_Storage_Gist11
sh.status()
--- Sharding Status ---
sharding version: {
"_id" : 1,
"version" : 3,
"minCompatibleVersion" : 3,
"currentVersion" : 4,
"clusterId" : ObjectId("53616554992f1bbce576f9fd")
}
shards:
@FrancescaK
FrancescaK / gist:c5225e59ad6db00a4c28
Created May 6, 2014 18:17
Tiered_Storage_Gist10
mongorestore -d enron -c messages enron/messages.bson
var configdb = db.getSiblingDB("config")
configdb.tags.find().pretty()
{
"_id" : {
"ns" : "enron.messages",
"min" : {
"date" : { "$minKey" : 1 }
}
},
"ns" : "enron.messages",
sh.status()
--- Sharding Status ---
...
"clusterId" : ObjectId("53616554992f1bbce576f9fd")
}
shards:
{ "_id" : "shard0000", "host" : "Server1:27017", "tags" : [ "current" ] }
{ "_id" : "shard0001", "host" : "Server2:27017", "tags" : [ "tier-2" ] }
{ "_id" : "shard0002", "host" : "Server3:27017", "tags" : [ "tier-2" ] }
databases:
//Add the tags
sh.addTagRange('enron.messages',{date:MinKey},{date:ISODate("2001-07-01")},'tier-2')
sh.addTagRange('enron.messages',{date:ISODate("2001-07-01")},{date:MaxKey},'current')
db.messages.ensureIndex({date:1})
sh.shardCollection('enron.messages',{date:1})
{ "collectionsharded" : "enron.messages", "ok" : 1 }
use enron
switched to db enron
db.createCollection("messages")
{ "ok" : 1 }
sh.enableSharding("enron")
{ "ok" : 1 }