[SERVER-10756] Why is my mongodb dump so slow? Created: 13/Sep/13  Updated: 10/Dec/14  Resolved: 16/Sep/13

Status: Closed
Project: Core Server
Component/s: Performance, Querying
Affects Version/s: 2.2.0-rc0
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: dongweiming Assignee: Unassigned
Resolution: Done Votes: 0
Labels: performance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Debian GNU/Linux 6.0 2.6.32-5-amd64


Participants:

 Description   

I wanted to backup my database, and then execute the following command:

mongodump -d sandbox --out .

But very, very slow。

I saw the mongodb log, such a large number of logs:
Tue Sep 10 23:00:14 [conn2409] getmore sandbox.followbrand_flwrs query: { query: {}, $snapshot: true } cursorid:7315171840358601840 ntoreturn:0 exhaust:1 keyUpdates:0 numYields: 3645 locks(micros) r:10464765 nreturned:6993 reslen:4194538 36678ms
Tue Sep 10 23:00:50 [conn2409] getmore sandbox.followbrand_flwrs query: { query: {}, $snapshot: true } cursorid:7315171840358601840 ntoreturn:0 exhaust:1 keyUpdates:0 numYields: 3602 locks(micros) r:10267399 nreturned:7015 reslen:4194822 35893ms

The indexes is:

> db.followbrand_flwrs.getIndexes()
[
{
"v" : 1,
"key" :

{ "_id" : 1 }

,
"ns" : "sandbox_qqonline.followbrand_flwrs",
"name" : "id"
},
{
"v" : 1,
"key" :

{ "update_time" : 1 }

,
"ns" : "sandbox_qqonline.followbrand_flwrs",
"name" : "update_time_1"
}
]

> db.followbrand_flwrs.count()
21579466



 Comments   
Comment by Daniel Pasette (Inactive) [ 16/Sep/13 ]

mongodump scans your entire collection. if the data is being paged in from disk, that can be a costly operation. Check iostat to see if you are io bound.

This project is for bugs or features, this is more of a support request, so probably should go to stackoverflow or google groups. https://groups.google.com/forum/#!forum/mongodb-user

Generated at Thu Feb 08 03:23:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.