[SERVER-423] db.<dname>.ensureIndex( { uid: 1 }, {unique: true} ) eats up all ram and swap Created: 13/Nov/09 Updated: 12/Jul/16 Resolved: 06/Apr/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance, Performance |
| Affects Version/s: | 1.1.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Alexey Zilber | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
AWS Linux m1.large instance. x64 |
||
| Participants: |
| Description |
|
When creating a NON-Unique index, index is created normally. On a collection with 3.5M documents: ): Fri Nov 13 13:44:24 cpu: 4000 0 0% for <dbname>.Farm... , name: "uid_1" } I did a db.<dbname>.dropIndexes(); Then db.<dname>.ensureIndex( { uid: 1 }, {unique: true}) Fri Nov 13 13:51:10 cpu: 4000 0 0% for <dname>.Farm... , name: "uid_1", unique: true } During this second run, mongo went almost 2GB into swap and as you can see, took almost 4 times as long before even detecting a conflict. I had to restart mongodb to clear up the ram usage.. it was using all system ram (RES 7.2G). The whole collection size is around 16G. > db.<dbname>.dropIndexes(); Now, even adding a regular index causes massive swap use: ) top - 14:16:50 up 20:28, 4 users, load average: 1.50, 0.89, 0.93 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND It completes, but ram is not freed: Fri Nov 13 14:13:34 cpu: 4000 0 0% for <dbname>.Farm... , name: "uid_1" } |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 06/Apr/10 ] |
|
this should be fixed in 1.4 |
| Comment by Eliot Horowitz (Inactive) [ 17/Feb/10 ] |
|
some changes in 1.3.2 |
| Comment by Alexey Zilber [ 17/Nov/09 ] |
|
I can give you access to the instance where I have the csv file, you're welcome to see for yourself. -Alex |
| Comment by auto [ 13/Nov/09 ] |
|
Author: {'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}Message: BDONObjBuilder::apendAsNumber |
| Comment by Eliot Horowitz (Inactive) [ 13/Nov/09 ] |
|
I cannot reproduce this. |
| Comment by auto [ 13/Nov/09 ] |
|
Author: {'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}Message: some index building code cleaning looking at |