system.profile is a limited collection with a default size of 1 MB, so documents are cleaned naturally (with respect to the timestamp) to make room for new documents.
To increase the size of the system.profile collection (say, 10 MB), follow these steps:
1) Stop profiler: db.setProfilingLevel(0)
2) Drop system.profile: db.system.profile.drop()
3) Create a larger collection of system.profile manually: db.createCollection( "system.profile", { capped: true, size: 1024 * 1024 * 10 } )
4) Enable profiling again
If on average a collection of 1 MB collected about 200-300 documents, the new settings will be about 2000-3000 documents. Increase the size of the system.profile file as needed.
Orient dar
source share