What should be the mongodb installation and configuration recommendation in Docker swarm?

Hello, there is a production in the IoT sector that prints 5 KB of data for 15000 devices every 30 minutes. My servers are approximately 5 16 core 32 GB ram vm linux. We manage all our applications and db’s through the docker swarm cluster under these 5 VMs. 3 masters 2 workers.
We want to keep this IoT data in mongodb. Can you guide me for the most optimal performance installation? Should it be in Docker swarm under the VM for Mongo, or should I separate it in a separate VM? We are considering indexing the DeviceId and ts fields. What should our Sharding Cluster structure and numbers be? How should I configure CQRS? Currently, I have a system that has 2 shardings via Mongos and 3 replicas in each sharding, but I send the requests to Mongos and it uses a lot of CPU and RAM, and I’m also having performance problems with CQRS.
How to Example best practices docker compose file ?

I recommend the MongoDB forum for performance and tuning questions.

1 Like