Skip to content

Instantly share code, notes, and snippets.


Mahendran Kathirvel astromahi

View GitHub Profile
astromahi /
Created May 24, 2017 — forked from rantav/
Find slow queries in mongo DB

A few show tricks to find slow queries in mongodb

Enable profiling

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...

docker run -d --name consul --net=host gliderlabs/consul-server -bootstrap -advertise=
astromahi / xmas.go
Created Dec 28, 2015 — forked from bradfitz/xmas.go
Brad's xmas lights
View xmas.go
// Copyright 2015 Google Inc. All Rights Reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,