-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal Code, Sharding
-
Catalog and Routing
-
ALL
-
-
(copied to CRM)
-
3
Hi team,
We are using a 10 shards (Primary / Secondary / Arbiter) cluster to host around 20k databases.
We noticed that creating new databases take lot of time, around 10s :
2017-09-11T09:48:52.763+0000 I SHARDING [conn641] distributed lock 'anthony110920175' acquired for 'createDatabase', ts : 59b65c04bb2f983e7e106b2c 2017-09-11T09:49:02.438+0000 I SHARDING [conn641] Placing [anthony110920175] on: clust-1-sh1 2017-09-11T09:49:02.448+0000 I SHARDING [conn641] distributed lock with ts: 59b65c04bb2f983e7e106b2c' unlocked.
It looks like a
db.runCommand({listDatabases:1})
is launched on all shard, one by one, before creating the database on the config servers. This command take arount 1s per shard.
Adding the "nameOnly:true" option make the query almost instantaneous. Maybe it should be added when a mongos check database existency ?
Regards,
Anthony
- is related to
-
SERVER-35431 rollback does not correct sizeStorer data sizes
- Backlog
- related to
-
SERVER-89651 Make selectLeastLoadedNonDrainingShard query shards data size in parallel
- Open
-
SERVER-31083 Allow passing primary shard to "enableSharding" command for a new database
- Closed