Last active
August 29, 2015 14:13
-
-
Save jzi96/93c948365892113ba8cf to your computer and use it in GitHub Desktop.
MongoDB profiling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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