MongoDB Documentation, Release 3.0.4 – current the total number of current clients that connect to the database instance. – available the total number of unused connections available for new clients. If there are numerous concurrent application requests, the database may have trouble keeping up with demand. If this is the case, then you will need to increase the capacity of your deployment. For read-heavy applications, increase the size of your replica set and distribute read operations to secondary members. For write-heavy applications, deploy sharding and add one or more shards to a sharded cluster to distribute load among mongod instances. Spikes in the number of connections can also be the result of application or driver errors. All of the officially supported MongoDB drivers implement connection pooling, which allows clients to use and reuse connections more efficiently. Extremely high numbers of connections, particularly without corresponding workload is often indicative of a driver or other configuration error. Unless constrained by system-wide limits, MongoDB has no limit on incoming connections. On Unix-based systems, you can modify system limits using the ulimit command, or by editing your system’s /etc/sysctl file. See UNIX ulimit Settings (page 287) for more information. MongoDB’s “Profiler” is a database profiling system that can help identify inefficient queries and operations. The following profiling levels are available: Database Profiling Level Setting 0 Off. No profiling 1 On. Only includes “slow” operations 2 On. Includes all operations Enable the profiler by setting the profile value using the following command in the mongo shell: db.setProfilingLevel(1) The slowOpThresholdMs setting defines what constitutes a “slow” operation. To set the threshold above which the profiler considers operations “slow” (and thus, included in the level 1 profiling data), you can configure slowOpThresholdMs at runtime as an argument to the db.setProfilingLevel() operation. The documentation of db.setProfilingLevel() for more information. By default, mongod records all “slow” queries to its log , as defined by slowOpThresholdMs . Note: Because the database profiler can negatively impact performance, only enable profiling for strategic intervals and as minimally as possible on production systems. You may enable profiling on a per- mongod basis. This setting will not propagate across a replica set or sharded cluster . You can view the output of the profiler in the system.profile collection of your database by issuing the show profile command in the mongo shell, or with the following operation: db.system.profile.find( { millis : { $gt : 100 } } ) This returns all operations that lasted longer than 100 milliseconds. Ensure that the value specified here ( 100 , in this example) is above the slowOpThresholdMs threshold. 215 5.1. Administration Concepts See