[SERVER-35594] db.getCollectionNames can take more than 10 minutes to execute Created: 14/Jun/18 Updated: 27/Oct/23 Resolved: 14/Jun/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 3.6.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | tab trader | Assignee: | [DO NOT USE] Backlog - Sharding Team |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Sharding
|
| Operating System: | ALL |
| Steps To Reproduce: | Set up a mongodb 3.6.5 cluster of three nodes(maybe one is also ok). Create over 75000 collections. Access mongodb via WAN from mongo shell. Call db.getCollectionNames(). Observe it execute for a very long time (around 8 minutes). |
| Participants: |
| Description |
|
db.getCollectionNames works unacceptably slow via internet if you have thousands of collections. doesn't reproduce with local networks |
| Comments |
| Comment by tab trader [ 15/Jun/18 ] |
|
Well do you actually not see a flow here? should getCollectionNames transfer all that excessive data when all I need is collection names? I need all collection names and nothing more. Also why do I care as a user what is going on under the hood while requesting collection names? To me it's just a strangely long processing of a simple request. |
| Comment by Kaloian Manassiev [ 14/Jun/18 ] |
|
For context, the db.getCollectionNames() call eventually runs the listCollections command. Assuming ~1Kb of data per collection entry and 75,000 collections, the total amount of data which needs to be transferred is about 70Mb. This, divided by 8 min (480 sec) produces about 149 Kb per second transfer rate. This kind of rate is consistent with the speed of a 1 megabit internet connection. Is this by chance the network on which you are running? In either case, due to the amount of data which needs to be transferred, there is not much that the server can do. Also, if you don't need the entire set of collections, please consider using db.getCollectionInfos with a filter. -Kal. |