What are the mongos pods for?

We’re deploying percona server for mongodb using the kubernetes operator and after deploying I see the following:

percona-mongo-db-psmd-cfg-0                               2/2     Running   0          5d23h
percona-mongo-db-psmd-cfg-1                               2/2     Running   0          5d23h
percona-mongo-db-psmd-cfg-2                               2/2     Running   1          5d23h
percona-mongo-db-psmd-mongos-6ccff68cc8-cbnlx             1/1     Running   0          5d23h
percona-mongo-db-psmd-mongos-6ccff68cc8-grkpb             1/1     Running   0          5d23h
percona-mongo-db-psmd-rs0-0                               2/2     Running   0          5d23h
percona-mongo-db-psmd-rs0-1                               2/2     Running   0          5d23h
percona-mongo-db-psmd-rs0-2                               2/2     Running   2          5d23h

These names are brutally long to type - are these customizable in the chart?

Aside from that I want to understand what we have in place this is three config-servers which I understand contain information about authentication and sharding.

There are three rs servers - which I assume are replica sets and we want three for election purposes.

But then there are two mongos pods. What are those? Does the S in mongoS stand for mongodb shard?

Does this mean we have two shards and three replica sets or what are the mongoS instances?

Thanks,
Brad

1 Like

Answering my own question due to lack of response. :stuck_out_tongue:

With sharding turned on, you have mongos service as an entry point to access your database.

For a sharded cluster, the mongos instances provide the interface between the client applications and the sharded cluster. The mongos instances route queries and write operations to the shards. From the perspective of the application, a mongos instance behaves identically to any other MongoDB instance.

There is no limit to the number of mongos routers you can have in a deployment. However, as mongos routers communicate frequently with your config servers, monitor config server performance closely as you increase the number of routers. If you see performance degradation, it may be beneficial to cap the number of mongos routers in your deployment.

1 Like