Clarity on pricing based on projects
I'm a little confused about the pricing
Let's base everything under 0.25 CPU 1GB RAM and only 1 primary branch
So, let's say i have project A and project B on neon with one database each
Now, under the Launch plan i get 1200 hours of compute. Let's say both projects are being used 24x7 i.e 730 hours of compute
My question is, would that consume 730 * 2 = 1460 hours?
then i'll be charged $19 + ((1460 - 1200) * $0.04) = $19 + $10.4 = $29.4?
and if the same thing i had in just one project but two databases inside it, would that setup cost the same $29.4? or would i then just consume 730 hours with no overages and still have 1200 - 730 = 470 hours left? since there's only 1 project
7 Replies
eastern-cyan•2y ago
Thanks for asking this. We're working to improve our documentation. To play back your scenario:
* You have 2 databases.
* Both databases will be accessed at least once every 5 minutes (this means they will never sleep and therefore be active all the time. 24 hours x 31 days = 744 hours per month).
* 0.25 vCPU + 1 GiB RAM is succicient to serve both databases. You will never scale up.
If you put both databases in the same project, on the Launch plan you will use 744 of the 1,200 hours. Your bill will be $19. You will have 456 hours 'unused'.
If you put each database in its own project, on the Launch plan you will use 2 x 744 = 1,488 hours. Your bill will be $30.52. This is because there is an 'extra' 288 hours to pay for at $0.04 per hour.
So what's the benefit of putting a database in its own project?
1. If you put each database in its own project, each database gets its own 0.25 vCPU + 1 GB RAM. When they are in the same project, they are sharing it (you could say each database is getting 0.125 vCPU and 0.5 GB RAM). If this is all the resource each database needs, you should start with our Free plan 😀
2. Isolation. In our experience, it's less typical to have databases with such predictable and small demands. What's more typical is database
a has super low traffic (let's say it serves only 1 request per 10 mins to keep the maths simple). Meanwhile database b is hit far more often, needs at least 1 GB RAM and sometimes has a surge of traffic (let's say you run a food delivery service and there's a spike every Mon-Fri lunchtime 12pm-1pm).
In this scenario, database a would be autosuspended half the time, so now it's using 372 hours per month. Database b still runs 744 hours. We have 84 hours left over (1,200 - 744 - 372) within your $19. This gets a little more complicated but you can use those 84 hours @ 0.25 vCPU + 1 GB RAM as 21 hours @ 1 vCPU + 4 GB RAM. Doing that with autoscaling gives database b 1 vCPU and 4 GB RAM during those busy lunch times and your bill will still be $19.
This is the flexibility of having serverless Postgres!
3. Admin/security. In addition to the above, putting one database in one project gives you many more advantages. For example you could share only database a with me via Neon's project sharing; knowing I had no access to database b.adverse-sapphireOP•2y ago
ahh i see, thanks for explaining it in depth!
my use case is mostly micro-saas projects for now, i just don't want to wake up to a huge bill that's why i am putting everything under same project lol
quick question is there a way to set hard limit on monthly bill for an account?
eastern-cyan•2y ago
Today, the best way is to set quotas on your projects. For example this would limit the project to 60 seconds compute time and 100 bytes in size.
Later this year we plan to have cost forecasting, alerting and controls in the console UI.
adverse-sapphireOP•2y ago
got it, can you also add setting spending limits per account as a feature request? i would love to see it and i feel like it is a must
eastern-cyan•2y ago
Yes, we are looking at this too. There’s a balance to be struck here between cutting off spending and cutting off service. For example, would you really want your production databases to be taken offline for the rest of the month the moment you hit a spend limit?
adverse-sapphireOP•2y ago
hmm, but that doesn't happen in the free plan as well right? the primary is still available, although other branches would be suspended
but i get it, that making primary available would not be viable after limits are exhausted when suppose it's a larger instance
i guess cost forecasting, alerting controls would be better you're right
eastern-cyan•2y ago
Thanks for the additional comments: super useful feedback as we plan this out.