[SERVER-2649] Poor remove() performance (tested for pymongo only) Created: 01/Mar/11 Updated: 06/Dec/22 Resolved: 06/Oct/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Performance |
| Affects Version/s: | 1.7.6 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Valery Khamenya | Assignee: | Backlog - Storage Execution Team |
| Resolution: | Incomplete | Votes: | 10 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu 10.10 (amd64) |
||
| Assigned Teams: |
Storage Execution
|
| Participants: |
| Description |
|
1. In my original case I have issued the command c.db.coll.remove( { 'str_key' : 'myvalue'}) that resulted in removal of about 200000 records from a collection containing 2000000 records. The removal of these 10% of records took 1 hour. The field str_key was indexed. Each record size was about 10 Kbytes. About 13Gbytes of RAM not used by any application and ready for mongodb mmap. 2. I tried to check how remove() works in oversimplified case (see below). The insertions took 312 sec, whereas the removal 994sec. So, removals are much slower, whereas no much serialized data are pushed between server and a client. 3. see also: (4. "limit=100000" doesn't seem to work in the example below, but this is not important, I hope. Also, perhaps, I should have put safe=True for more transparency. Finally, in my case it was a "cold" I/O – the records have not been prefetched from disk into RAM before the remove() has been invoked. If it is all still very important, I could try to reproduce my issue again but a bit closer, but IMHO the case below still shows well enough an unexpected slow-down) #################################### class Test(unittest.TestCase): @timeit ) insert_many() if _name_ == "_main_": |
| Comments |
| Comment by Eric Milkie [ 06/Oct/17 ] |
|
Performance profiles have changed quite a bit since version 1.7.6; please open a new ticket for assistance with the current available versions of MongoDB. |