So I have a serverless instance and I recently got my billing. Now I have about 25mil RPU and I’m currently optimizing my queries.
I was wondering, is it possible to see which of my API routes uses the most RPU? Right now, my best guess is because of my cron jobs that runs every hour and after doing some check using .explain() it really does scans my whole collections so I’m currently optimizing them
63552 RPU - https://domain.com/userdata
2324 RPU - https://domain.com/api-route-one
I also want to see how much RPU my other queries uses without really using .explain on each one of them since there’s a decent amount of them
edit: added some example
Thank you for the question. There are currently three ways to estimate the documents scanned:
- Use the explain() command as you pointed out
- Go to the “Monitoring” tab and then the “Metrics” tab on the Atlas UI and view the “Read/Write Units” chart
- Go to the “Monitoring” tab and then the “Profiler” tab on the Atlas UI. This chart only shows slow queries. If you see any click on them and view the “docUnitsRead” and “idxEntryUnitsRead”.
We do not have a bulk explain() command. Please upvote this idea here so that we can prioritize this feature in a future release.
Please let us know if you have any additional questions.