[SERVER-14260] Reusing freed extents takes a long time Created: 16/Jun/14 Updated: 11/Jun/19 Resolved: 22/May/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Performance, Storage |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | PHO | Assignee: | Daniel Pasette (Inactive) |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: | |
| Case: | (copied to CRM) |
| Description |
|
When we repeatedly create and drop large collections, the extent freelist gets very long and the server starts to take a long time to find a suitable freed extent to reuse while the database being write-locked. It can take from 10 sec to several minutes depending on the length of freelist. This is related to SERVER-3022 if I understand it correctly.
There would be three approaches to mitigate this problem:
|
| Comments |
| Comment by Greg Murphy [ 02/Apr/15 ] |
|
We're also experiencing this issue on 2.6.8. The database which is causing the problem has thousands of small collections created each day and then deleted a few days later. As a result, it has a huge extent free list. dbstats output for that database is: { , , Some example log entries from when the server hangs during extent free list searches are: warning: slow scan in allocFromFreeList (in write lock) warning: slow scan in allocFromFreeList (in write lock) warning: slow scan in allocFromFreeList (in write lock) The server can be unresponsive for anything up to about 5 minutes during these scans. |
| Comment by PHO [ 18/Jun/14 ] |
|
Thank you for letting me know about The last time I saw the problem was when I was using MongoDB 2.4.1. But it has occurred on various versions and I think it still persists in the git HEAD from what I've examined the codebase: MMAP1DatabaseCatalogEntry::createCollection allocates an extent of 4096 bytes long, freed extents will never be merged, and MmapV1ExtentManager::_allocFromFreeList walks through mmapped pages. If you still want me to try 2.6.2 then I will happily do so though. |
| Comment by Ramon Fernandez Marina [ 17/Jun/14 ] |
|
What version of MongoDB are you using? If you're using 2.6.0 or 2.6.1 you may be running into |