- dropDatabase with about 70 collections with 2 indexes each for a total of about 200 WT tables
- about 325k open cursors
- dropDatabase takes about 30 seconds and holds the global lock the entire time.
Collecting perf data shows mongod using 100% of a CPU for the duration, all in this stack:
For each of the 200 WT tables dropped we call closeAllCursors for that table. The perf stacks show all the time is spent in closeAllCursors itself, and the ftdc metrics also show that we aren't actually closing any cursors, so it appears that all the time is spent by closeAllCursors scanning the list of 325k open cursors to find cursors with a matching table uri.