I have set a MongoDB Sharded Cluster with 2 shards (3 replicas set), 3 configSrv and 2 mongos, and my problem is when I make an insert query > it writes at only 1000 w/per second for a simple query indexed id + firstname.
That seems to be abnormally slow when looking at my server setup which is as follows :
- Config server for each Shard is a cpu 24c/48t - 128g ram - ssd nvme 512go
- Config server for each Mongos and for each ConfigSrv is a cpu 16c/32t - 256go ram - ssd nvme 512go
- All server are running on a Ubuntu 20.04 with Mongodb 4.4
(In comparison when I have tested on a standalone MongoDB server, I could easily reach 25000 w/per second...)
Anyone can tell me why I cannot get more than 1000 w/per second ?
With Htop the cpu is only used between 2% and 7%, the ram is at 0.4%.
Problem is mongos, shard or configSrv ?
Thank you for advice.
insertOne
). UseinsertMany
or Bulk Operation Methods or similar API. Are you sure you got 15k/sec with the same method? I have made similar experience, see github.com/syslog-ng/syslog-ng/issues/3454 – Wernfried Domscheit