Or how to turn this:
into this:
| #!/bin/bash | |
| # Performs a dump of target database and compresses result. | |
| # Outputs to: $DUMPDIR/$DUMPNAME.tar.xz | |
| # Note: Absolute paths are required for use in cron jobs | |
| DBNAME=meteor | |
| ROOTDIR=/Users/alanning/foo | |
| DUMPDIR=$ROOTDIR/dumps |
| #!/bin/bash | |
| apt-get -y update | |
| apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev | |
| wget -c https://openresty.org/download/openresty-1.9.15.1.tar.gz | |
| tar zxvf openresty-1.9.15.1.tar.gz | |
| cd openresty-1.9.15.1 | |
| ./configure \ | |
| --sbin-path=/usr/sbin/nginx \ | |
| --conf-path=/etc/nginx/nginx.conf \ |
| (all instruction need root permission) | |
| 0. Create a droplet with Ubuntu 14.04 image | |
| 1. wget -q -O - http://multipath-tcp.org/mptcp.gpg.key | sudo apt-key add - | |
| 2. vim /etc/apt/sources.list.d/mptcp.list , add line: | |
| deb http://multipath-tcp.org/repos/apt/debian trusty main | |
| 3. apt-get update && apt-get install linux-mptcp |
First, you have to enable profiling
> db.setProfilingLevel(1)
Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...
| #/bin/sh | |
| du -k --max-depth=1 | sort -nr | awk ' | |
| BEGIN { | |
| split("KB,MB,GB,TB", Units, ","); | |
| } | |
| { | |
| u = 1; | |
| while ($1 >= 1024) { | |
| $1 = $1 / 1024; | |
| u += 1 |