Current Setup
We have a single node Mongodb (v4.4.2) installed and configured in an EC2 machine in us-east-1 region. This DB is connected by a frontend java app in same region with the total data of around 1.2 TB and total index of around 583675023360
Due to cost cutting we didn’t go for replication/clustering yet, and the above setup is working fine.
Issue
We wanted to plan for DR. Our backup process for DR was
- take daily AMI of Mongodb and application instance, copy them to us-east-2 region
- spin up instances using above AMIs in DR with same instance type in our existing setup
With above plan, DR site was up. Small datasets were loading successfully, but, for larger datasets data loading was too slow - we got 504 gateway timeout in our frontend app.
Findings/Debugging
We tried to verify the total db size along with index in our DR and existing Mongodb setup - they were all same.
Also, checking on the Mongodb logs in DR, index scanning was seen.
Could anyone please suggest what additional configuration we need to do for Mongodb that was created from an existing AMI if there is any to avoid this slowness? Are we missing something here?