MongoDB profiler is an internal tool that enables DBAs and developers to collect information about executed MongoDB requests.
Profiler has three levels:
0 – profile is off
1 – profiler collects information on slow requests
2 – profiler collects all information
For production purposes level 1 is what DBA needs. In general, it is best to set it to some reasonable SLA required threshold, like 1,000 milliseconds (1 second), etc.
Level 2 is best for development purposes to get a complete log of executed requests.
Below is the list of profile related commands:
# set profiling to level 1 capture requests with duration over 500 ms
db.setProfilingLevel(1,500)
#get current profiler level
db.getProfilingLevel()
# get current profiler settings
MongoDB Enterprise > db.getProfilingStatus()
{ "was" : 1, "slowms" : 500 }
To return operations slower than 500 milliseconds, run a query similar to the following:
db.system.profile.find( { millis : { $gt : 50 } } ).pretty()
Enteros UpBeat High Load Capture continuously captures history of executed mongodb requests across all collection as well as other mongo db, OS, SAN and other operational statistics across muliple systems.
When the spike is identified, it can be cross-correlated across MongoDB nodes and correlated with MongoDB requests. A detailed report is generated to pinpoint what requests are were active during the problem time.
Also, please check my presentation on MongoDB performance tuning
The views expressed on this blog are those of the author and do not necessarily reflect the opinions of Enteros Inc. This blog may contain links to the content of third-party sites. By providing such links, Enteros Inc. does not adopt, guarantee, approve, or endorse the information, views, or products available on such sites.
Are you interested in writing for Enteros’ Blog? Please send us a pitch!
RELATED POSTS
Autonomous Vehicles at Risk: When Databases Can’t Keep Up with Real-Time Decisions
- 8 September 2025
- Software Engineering
Introduction Autonomous vehicles promise a future of safer roads, fewer accidents, and optimized traffic. But behind the sleek exterior and AI-driven software lies a hidden dependency: the performance of underlying databases. Every millisecond matters when a car is making split-second decisions in traffic. A small delay in data processing can mean the difference between avoiding … Continue reading “Autonomous Vehicles at Risk: When Databases Can’t Keep Up with Real-Time Decisions”
How Enteros Enhances Cost Attribution and AI-Driven Database Performance to Transform the Healthcare Sector
- 7 September 2025
- Database Performance Management
Introduction The healthcare sector is undergoing a profound digital transformation, driven by the convergence of artificial intelligence (AI), data-intensive applications, and cloud-based platforms. Electronic health records (EHRs), genomic sequencing, AI-powered diagnostic tools, telemedicine, and predictive analytics all rely heavily on databases that must handle massive volumes of structured and unstructured data. While these innovations hold … Continue reading “How Enteros Enhances Cost Attribution and AI-Driven Database Performance to Transform the Healthcare Sector”
How Enteros Uses AI SQL and Cloud FinOps to Enhance Database Performance and Cost Attribution in the Financial Sector
Introduction The financial sector has always been a pioneer in adopting advanced technologies to gain a competitive edge. With millions of daily transactions, regulatory obligations, and the growing demand for digital-first services, banks and financial institutions cannot afford inefficiency in their IT operations. At the heart of this efficiency challenge lies database performance management and … Continue reading “How Enteros Uses AI SQL and Cloud FinOps to Enhance Database Performance and Cost Attribution in the Financial Sector”
Genomics at Scale: How Database Performance Accelerates Drug Discovery
- 5 September 2025
- Software Engineering
Introduction Genomics research and drug discovery generate some of the world’s largest datasets. Sequencing, molecular simulations, and clinical trial analytics all rely on vast, high-speed databases. Yet many organizations struggle when data systems lag, slowing the path from discovery to treatment. In this article, we explore why genomics is so dependent on database performance, the … Continue reading “Genomics at Scale: How Database Performance Accelerates Drug Discovery”