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)

PDF
MongoDB - visualisation of slow operations
PDF
MongoDB Performance Tuning
PDF
Indexing and Query Performance in MongoDB.pdf
PDF
Mongo db improve the performance of your application codemotion2016
PPTX
Performance Tuning and Optimization
PPTX
MongoDB Aggregation Performance
PPTX
Is It Fast? : Measuring MongoDB Performance
PDF
10 Key MongoDB Performance Indicators
PDF
Who's afraid of front end databases
PDF
Know thy cost (or where performance problems lurk)
DOCX
What are the major components of MongoDB and the major tools used in it.docx
PPTX
PDF
Whos afraid of front end databases?
PDF
Managing Database Indexes: A Data-Driven Approach - Amadeus Magrabi
PPTX
how_can_businesses_address_storage_issues_using_mongodb.pptx
PDF
MongoDB performance tuning and load testing, NOSQL Now! 2013 Conference prese...
PDF
MongoDB World 2019: RDBMS Versus MongoDB Aggregation Performance
PDF
Mongodb debugging-performance-problems
PPTX
Webinar: Performance Tuning + Optimization
PPTX
Mongo db pefrormance optimization strategies
MongoDB - visualisation of slow operations
MongoDB Performance Tuning
Indexing and Query Performance in MongoDB.pdf
Mongo db improve the performance of your application codemotion2016
Performance Tuning and Optimization
MongoDB Aggregation Performance
Is It Fast? : Measuring MongoDB Performance
10 Key MongoDB Performance Indicators
Who's afraid of front end databases
Know thy cost (or where performance problems lurk)
What are the major components of MongoDB and the major tools used in it.docx
Whos afraid of front end databases?
Managing Database Indexes: A Data-Driven Approach - Amadeus Magrabi
how_can_businesses_address_storage_issues_using_mongodb.pptx
MongoDB performance tuning and load testing, NOSQL Now! 2013 Conference prese...
MongoDB World 2019: RDBMS Versus MongoDB Aggregation Performance
Mongodb debugging-performance-problems
Webinar: Performance Tuning + Optimization
Mongo db pefrormance optimization strategies
Ad

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
Tartificialntelligence_presentation.pptx
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
1. Introduction to Computer Programming.pptx
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
Encapsulation theory and applications.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
DP Operators-handbook-extract for the Mautical Institute
WOOl fibre morphology and structure.pdf for textiles
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Hindi spoken digit analysis for native and non-native speakers
Tartificialntelligence_presentation.pptx
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Zenith AI: Advanced Artificial Intelligence
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation_ Review paper, used for researhc scholars
1. Introduction to Computer Programming.pptx
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
NewMind AI Weekly Chronicles - August'25-Week II
OMC Textile Division Presentation 2021.pptx
A comparative analysis of optical character recognition models for extracting...

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?