My son made a coding mistake in his Unity game code and was updating a game players information in MongoDB every frame. We fixed the issue in minutes but there was a large spike of 39k writes and the “Compute Runtime” reach 49 hours/s and exceeded the 500 hour per month limit in one 2 minute spike.
My question: Is there a way to cap costs on M0? It seems that a bug in coding could run into big bucks if gone unchecked. I would rather hit a cap that give my application an error then it auto-scale to absorb the load.
Would an M2 instance also spike in price if “Compute Runtime” is exceeded?
Please note that the bill you’re seeing is not from M0 but from App Services. All App Services Apps in a MongoDB Atlas project share a single monthly free tier. All usage below the free tier thresholds in a given month is not billed. As soon as a project exceeds any monthly free tier threshold, App Services starts billing for additional usage of any kind for that project.
You can use billing alerts to help manage your billing quotas. Billing alerts notify a designated person when a bill has exceeded a USD limit, or when a credit card is about to expire.
To configure billing alerts, click Organization Alerts in the Organization view. Set up consumption alerts to track how much a project or team is spending. You’ll be notified via email whenever your specific trigger is set off.
Hope this helps. Feel free to reach out for anything else as well.
Please note that I understand that if my son uses significant resources then we should be billed for it. We appreciate MongoDB providing a free tier for developers. My concern is that in our case all the resources ($14+) were used in under one minute. A simple coding bug had my son’s game writing out the players status to MongoDB every frame of the game. The game writes to MongoDB from a server and my son leaves the server running all time so others can test. If this bug had not been fixed within the development session I could be looking at a $500 or much more bill. Even with alerts I may not catch an issue until the next day.
It is my current understanding that no matter what tier I choose (M0 or M1) my bill could be much higher than the free or $9.99 stated price if my application exceeds usage limits.
I would like MongoDB to consider an optional cost cap (limit) setting that will prevent resources from getting used if the cap for the month is reached. The application would receive an error when the cap is reached. This would prevent a runaway application from running up huge charges.
Please note my bill was $2 for a couple of days. Now it is $14 which is consistent with the cost of $10 per 500 hours of compute. The under a minute peak used 1.23K hours of compute.
These graphs show one major and one other peak in usage: