Does anyone tested the latency from google cloud run to mongo serverless through public internet connection?

I use google cloud run to connect atlas serverless instance, in the monitor I found that each read operation cost 20-50ms, in the oppsite, write operation is far more faster than read, which is weird I think.

Is there anyway to optimize read performance in MongoDB Atlas serverless instances? I don’t want to use VPC to connect Atlas Serverless instances, it will create 50 static ips which cost too much for a small application.

Hi Xu_Jingxin

Thank you for the question- have you created indexes for your query? I would start with this resource to see if there’s anything you can do to optimize query performance.

Thank you

Hi Anurage

My collection size the small (<100 documents) and there is nothing other than query by id, so I think it’s not the matter of index.

Hi Xu_Jingxin

Thank you for the correspondence over Direct Message. Confirming that you now see a latency of 4ms 75% of the time. The issue earlier could possibly be because of a cold start issue on the Google Cloud Run side. Please let us know if you have other questions.

Best Regards,
Anurag Kadasne