Skip to content

Instantly share code, notes, and snippets.

View tobytripp's full-sized avatar

Toby Tripp tobytripp

View GitHub Profile
#!/usr/bin/env ruby
require "rubygems"
require "faker"
require "csv"
line_count = ARGV.empty? ? 55 : ARGV.first.to_i
def maybe( value, percent_chance )
return "" unless rand * 100 < percent_chance
db.people.getIndexes()
[
{
"name" : "_id_",
"ns" : "dnc_voters.people",
"key" : {
"_id" : 1
}
},
{
total used free shared buffers cached
Mem: 128992 128681 311 0 89 127541
-/+ buffers/cache: 1050 127941
Swap: 2047 265 1782
@tobytripp
tobytripp / gist:417615
Created May 28, 2010 19:30
iostat during unresponsive mongod
avg-cpu: %user %nice %system %iowait %steal %idle
0.03 0.00 0.03 12.43 0.00 87.51
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sda1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sda2 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdb 500.00 0.00 419.00 0.50 12928.00 4.00 30.83 2.12 5.04 2.38 100.05
sdb1 500.00 0.00 419.00 0.50 12928.00 4.00 30.83 2.12 5.04 2.38 100.05
dm-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
@tobytripp
tobytripp / gist:417572
Created May 28, 2010 18:59
mongod has expanded to fill 124G of available RAM and become unresponsive.
db.serverStatus(); // On a mongod that is unresponsive to queries
{
"uptime" : 13956,
"localTime" : "Fri May 28 2010 09:42:57 GMT-0400 (EDT)",
"globalLock" : {
"totalTime" : 13955605883,
"lockTime" : 1910430,
"ratio" : 0.00013689337575283544
},
"mem" : {
db.serverStatus(); // On a mongod that is unresponsive to queries
{
"uptime" : 13956,
"localTime" : "Fri May 28 2010 09:42:57 GMT-0400 (EDT)",
"globalLock" : {
"totalTime" : 13955605883,
"lockTime" : 1910430,
"ratio" : 0.00013689337575283544
},
"mem" : {