Skip to content

Instantly share code, notes, and snippets.

View kgorman's full-sized avatar

Kenny Gorman kgorman

View GitHub Profile
$>echo "{nThreads:2,w:true,r:false,mmf:true}" > perfsession1.js
$>
$>mongoperf < perfsession1.js
$>echo "{nThreads:2,w:true,r:false,mmf:false,fileSizeMB:10000}" > perfsession1.js
$>
$>mongoperf < perfsession1.js
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
{
"_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",
{
"_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"
},
{
"metadata": {
"name": "",
"signature": "sha256:a90804b68c0c02c405e62b261bc333673f0be01d2a735136d4799cd5e506f42d"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@kgorman
kgorman / gist:50f256c1c328efe576b7
Last active August 29, 2015 14:15
install_jupyterhub
# this script installs jupyter on Rackspace CBD
# 2015 kcg
# the trick here is to install python 3.3 with pip and not ruin the default python install
# then simply run jupyterhub
# this is designed to be run as a postinstall script when provisioning a cluster.
if [ $HOSTNAME == "GATEWAY-1" ]
then
# pre-requisites
@kgorman
kgorman / gist:4e0e0d933d9fae4571e8
Created February 24, 2015 03:12
Ipython plus Spark
import sys
import os
sys.path.append("/usr/lib/spark-yarn/python")
os.environ["SPARK_HOME"]="/usr/lib/spark-yarn/"
from pyspark import SparkContext
@kgorman
kgorman / gist:1c39f6dce753bb6703e5
Last active August 29, 2015 14:23
Compaction/Fragmentation example
// mongodb 2.4.8
// fragmented
// initial setting of random rand of 5000
> use sbtest
switched to db sbtest
> db.stats()
{
"db" : "sbtest",
hour,avg_neg,avg_neutral,avg_pos
0,0.489045047812703,0.572904921392379,0.510954952187297
1,0.45979209657117,0.55928348584548,0.54020790342883
2,0.452954920632673,0.564895009665459,0.547045079367327
3,0.4886087921913,0.473499704794948,0.5113912078087
4,0.486929135727515,0.470766998533493,0.513070864272485
5,0.516430239594934,0.633499700744954,0.483569760405066
6,0.476850687564712,0.605231004647229,0.523149312435288
7,0.485249046873756,0.504506815590507,0.514750953126244
8,0.485469075837924,0.53258626109772,0.514530924162076