Skip to content

Instantly share code, notes, and snippets.

@jzi96
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save jzi96/93c948365892113ba8cf to your computer and use it in GitHub Desktop.

Select an option

Save jzi96/93c948365892113ba8cf to your computer and use it in GitHub Desktop.
MongoDB profiling
//Robo Mongo
//mongo db add indexing
db.setProfilingLevel(0)
db.system.profile.drop()
db.createCollection("system.profile", {capped:true, size:400000000})
db.setProfilingLevel(1, 5)
//Run queries
//check table system.profile for queries longer than 5ms
//ttlindex
db.eventlog.createIndex( { "lastModifiedDate": 1 }, { expireAfterSeconds: 3600 } )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment