SlideShare a Scribd company logo
Log MongoDB Slow
Query
Pricebook.co.id and MongoDB
●Pricebook.co.id; A shopping search engine, price
comparison website based in Indonesia, launched on
December 2013
●Fast growing
●Millions and millions of documents
●More than 27GB data size
●…
Collecting performance data (1)
●Enable MongoDB profiling
db.setProfilingLevel(1);
Table of profiling level
-1 No change. Returns the current profile level.
0 Off. No profiling.
1 On. Only includes slow operations.
2 On. Includes all operations.
By default slow operations are those slower than 100 milliseconds.
You can change to whatever number that suits your platform.
Collecting performance data (2)
Example : Getting the slow queries below 200 miliseconds
db.setProfilingLevel(1,200);
“When you enable profiling, you also set the profiling level. The profiler records
data in the system.profile collection. MongoDB creates the system.profile
collection in a database after you enable profiling for that database.”
Read the complete reference here :
http://docs.mongodb.org/manual/tutorial/manage-the-database-profiler/
Collecting performance data (3)
system.profile; Here is one example
document of how it looks.
-what command?
count product_id on searchindex collection
-how long?
110 ms
System.Profile
●MMS (MongoDB Monitoring System) to help you with this
what’s next?
OK, now we know what queries are slow.. and then..
Solutions might be different from one application type and another.
-Index?
-Denormalize? Change schema design?
-Scale up? Upgrade machine specs?
Thank you!
@hadiariawan

More Related Content

PPTX
Automated Slow Query Analysis: Dex the Index Robot
PPTX
Sekilas PHP + mongoDB
ODP
PDF
MongoDB - An Introduction
PPTX
Dev Jumpstart: Build Your First App with MongoDB
PPTX
Mongo db
PDF
An introduction to MongoDB
PPTX
Mongo db nosql (1)
Automated Slow Query Analysis: Dex the Index Robot
Sekilas PHP + mongoDB
MongoDB - An Introduction
Dev Jumpstart: Build Your First App with MongoDB
Mongo db
An introduction to MongoDB
Mongo db nosql (1)

What's hot (20)

PPTX
Tms training
PDF
Updating materialized views and caches using kafka
PDF
Mongodb
PPTX
MongoDB
PPTX
MongoDb and NoSQL
PPTX
MongoDB
PPTX
Mongo DB 102
DOCX
Approach explaination
PDF
Managing Data and Operation Distribution In MongoDB
PPTX
Webinar: Building Your First MongoDB App
PPTX
MongoDB Scalability Best Practices
PDF
Replicating application data into materialized views
PPT
Mongo Web Apps: OSCON 2011
KEY
MongoDB NYC Python
PDF
VBA API for scriptDB primer
PPTX
Back to Basics Webinar 1: Introduction to NoSQL
PDF
GDG İstanbul Şubat Etkinliği - Sunum
PDF
21st Athens Big Data Meetup - 1st Talk - Fast and simple data exploration wit...
PPTX
Triggers In MongoDB
Tms training
Updating materialized views and caches using kafka
Mongodb
MongoDB
MongoDb and NoSQL
MongoDB
Mongo DB 102
Approach explaination
Managing Data and Operation Distribution In MongoDB
Webinar: Building Your First MongoDB App
MongoDB Scalability Best Practices
Replicating application data into materialized views
Mongo Web Apps: OSCON 2011
MongoDB NYC Python
VBA API for scriptDB primer
Back to Basics Webinar 1: Introduction to NoSQL
GDG İstanbul Şubat Etkinliği - Sunum
21st Athens Big Data Meetup - 1st Talk - Fast and simple data exploration wit...
Triggers In MongoDB
Ad

Similar to Log MongoDB slow query (20)

PPTX
MongoDB basics & Introduction
PPTX
MongoDB - An Introduction
PDF
MongoDB
PPTX
Introduction To MongoDB
PDF
MongoDB - visualisation of slow operations
PDF
Introduction to MongoDB and its best practices
PDF
Mongodb
PDF
mongodb tutorial
PDF
MongoDB performance tuning and load testing, NOSQL Now! 2013 Conference prese...
PDF
Mongodb
PDF
An introduction to MongoDB by César Trigo #OpenExpoDay 2014
PPTX
MongoDB presentation
PPTX
introtomongodb
DOCX
What is the significance of MongoDB and what are its usages.docx
PDF
Mongo db dhruba
PPTX
MongoDB Introduction and Data Modelling
DOCX
What are the major components of MongoDB and the major tools used in it.docx
PPTX
MongoDB and Hadoop: Driving Business Insights
PDF
InnoDB Scalability improvements in MySQL 8.0
PPTX
MongoDB 3.2 - a giant leap. What’s new?
MongoDB basics & Introduction
MongoDB - An Introduction
MongoDB
Introduction To MongoDB
MongoDB - visualisation of slow operations
Introduction to MongoDB and its best practices
Mongodb
mongodb tutorial
MongoDB performance tuning and load testing, NOSQL Now! 2013 Conference prese...
Mongodb
An introduction to MongoDB by César Trigo #OpenExpoDay 2014
MongoDB presentation
introtomongodb
What is the significance of MongoDB and what are its usages.docx
Mongo db dhruba
MongoDB Introduction and Data Modelling
What are the major components of MongoDB and the major tools used in it.docx
MongoDB and Hadoop: Driving Business Insights
InnoDB Scalability improvements in MySQL 8.0
MongoDB 3.2 - a giant leap. What’s new?
Ad

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Big Data Technologies - Introduction.pptx
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
PDF
Sensors and Actuators in IoT Systems using pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Electronic commerce courselecture one. Pdf
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Transforming Manufacturing operations through Intelligent Integrations
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PDF
Advanced Soft Computing BINUS July 2025.pdf
Empathic Computing: Creating Shared Understanding
Diabetes mellitus diagnosis method based random forest with bat algorithm
Dropbox Q2 2025 Financial Results & Investor Presentation
“AI and Expert System Decision Support & Business Intelligence Systems”
Big Data Technologies - Introduction.pptx
madgavkar20181017ppt McKinsey Presentation.pdf
Sensors and Actuators in IoT Systems using pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
NewMind AI Weekly Chronicles - August'25 Week I
Electronic commerce courselecture one. Pdf
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
GamePlan Trading System Review: Professional Trader's Honest Take
Reach Out and Touch Someone: Haptics and Empathic Computing
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Transforming Manufacturing operations through Intelligent Integrations
Spectral efficient network and resource selection model in 5G networks
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
Advanced Soft Computing BINUS July 2025.pdf

Log MongoDB slow query

  • 2. Pricebook.co.id and MongoDB ●Pricebook.co.id; A shopping search engine, price comparison website based in Indonesia, launched on December 2013 ●Fast growing ●Millions and millions of documents ●More than 27GB data size ●…
  • 3. Collecting performance data (1) ●Enable MongoDB profiling db.setProfilingLevel(1); Table of profiling level -1 No change. Returns the current profile level. 0 Off. No profiling. 1 On. Only includes slow operations. 2 On. Includes all operations. By default slow operations are those slower than 100 milliseconds. You can change to whatever number that suits your platform.
  • 4. Collecting performance data (2) Example : Getting the slow queries below 200 miliseconds db.setProfilingLevel(1,200); “When you enable profiling, you also set the profiling level. The profiler records data in the system.profile collection. MongoDB creates the system.profile collection in a database after you enable profiling for that database.” Read the complete reference here : http://docs.mongodb.org/manual/tutorial/manage-the-database-profiler/
  • 5. Collecting performance data (3) system.profile; Here is one example document of how it looks. -what command? count product_id on searchindex collection -how long? 110 ms
  • 6. System.Profile ●MMS (MongoDB Monitoring System) to help you with this
  • 7. what’s next? OK, now we know what queries are slow.. and then.. Solutions might be different from one application type and another. -Index? -Denormalize? Change schema design? -Scale up? Upgrade machine specs?