Finding Root to High Firestore Costs #1005
Replies: 4 comments 4 replies
-
Tony, is there a way to add to your log function which site called the API to perform the reads? (internal calls, vs calls from sites) I like the idea of trying to understand where the largest volume of calls is coming from, and it would be great if we could add a little extra context. |
Beta Was this translation helpful? Give feedback.
-
This is a good start to find root causes. |
Beta Was this translation helpful? Give feedback.
-
It may be useful to maintain a Firestore doc for each tracked function and
Other thoughts: updateParticipantData: Home collections: December 2023 release: |
Beta Was this translation helpful? Give feedback.
-
The main issue still in our monthly GCP costs is how many Firestore read operations are taking place each month (last month there were almost 3 Billion). I know that one main culprit is our backup processes, but I would like to start getting an understanding of how many documents are being read in each function within Firestore.js.
My initial idea is pretty simple: in every function in
Firestore.js
that reads documents from Firestore, we simply console log the size of the snap shot after it completes and include in the log which function read the documents. At the end of the month we can do a simple log export and generate a document count by function to get an idea of where we should focus our attention in the future.To clarify, I'm not aiming to solve the issue right away, I just want to do something that takes minimal effort that can start to give us an idea of what the best approach might be in the future. I know my idea is pretty elementary so I wanted to start a quick discussion to see if anyone else had a different idea.
Beta Was this translation helpful? Give feedback.
All reactions