MongoDB Documentation, Release 3.0.4 Profiler Overhead When enabled, profiling has a minor effect on performance. The system.profile (page 291) collection is a capped collection with a default size of 1 megabyte. A collection of this size can typically store several thousand profile documents, but some application may use more or less profiling data per operation. Change Size of system.profile Collection on the Primary To change the size of the system.profile (page 291) collection, you must: For example, to create a new system.profile (page 291) collections that’s 4000000 bytes, use the following sequence of operations in the mongo shell: Change Size of system.profile Collection on a Secondary To change the size of the system.profile (page 291) collection on a secondary , you must stop the secondary, run it as a standalone, and then perform the steps above. When done, restart the standalone as a member of the replica set. For more information, see Perform Maintenance on Replica Set Members (page 630). When used with the --logpath option or systemLog.path setting, mongod and mongos instances report a live account of all activity and operations to a log file. When reporting activity data to a log file, by default, MongoDB only rotates logs in response to the logRotate command, or when the mongod or mongos process receives a SIGUSR1 signal from the operating system. MongoDB’s standard log rotation approach archives the current log file and starts a new one. To do this, the mongod or mongos instance renames the current log file by appending a UTC timestamp to the filename, in ISODate format. It then opens a new log file, closes the old log file, and sends all new log entries to the new log file. You can also configure MongoDB to support the Linux/Unix logrotate utility by setting systemLog.logRotate or --logRotate to reopen . With reopen , mongod or mongos closes the log file, and then reopens a log file with the same name, expecting that another process renamed the file prior to rotation. Finally, you can configure mongod to send log data to the syslog . using the --syslog option. In this case, you can take advantage of alternate logrotation tools. See also: For information on logging, see the Process Logging (page 190) section. 5.2. Administration Tutorials 231 Rotate Log Files Overview 1. Disable profiling. 2. Drop the system.profile (page 291) collection. 3. Create a new system.profile (page 291) collection. 4. Re-enable profiling. db.setProfilingLevel(0) db.system.profile.drop() db.createCollection( "system.profile", { capped: true , size:4000000 } ) db.setProfilingLevel(1)