Skip to content

Instantly share code, notes, and snippets.

@comerford
comerford / compress_test.js
Created November 12, 2014 16:06
Generating data for MongoDB compression testing
// these docs, in 2.6, get bucketed into the 256 bucket (size without header = 240)
// From Object.bsonsize(db.data.findOne()), the size is actually 198 for reference, so add 16 to that for an exact fit
// with that doc size, 80,000 is a nice round number under the 16MiB limit, so will use that for the inner loop
// We are shooting for ~16 GiB of data, without indexes, so do 1,024 iterations (512 from each client)
// This will mean being a little short (~500MiB) in terms of target data size, but keeps things simple
for(var j = 0; j < 512; j++){ //
bigDoc = [];
for(var i = 0; i < 80000; i++){
@jayjanssen
jayjanssen / gist:5294528
Created April 2, 2013 17:55
keepalived vip a reader and writer vip (no LB) and PXC cluster check
vrrp_script prefer_node1 {
script "test `hostname` == 'node1'"
interval 600
weight 5
}
vrrp_script prefer_node2 {
script "test `hostname` == 'node2'"
interval 600
weight 5