scale postgres VM vs Horizontal scaling

Hey guys. Cheers.

Have been using flyio for sometime and recently i just migrated a postgres database to fly postgres.

Currently my postgresql database is utilizing the free allowance. The postgres is hosted with only 1 machine with the lowest VM and 256mb ram only.
image

first of all, am not trying to avoid paying. am just starting and trying out how this whole things work out for us.

There are a few things i am not quite sure about flyio when it comes to machine or app and the relationship between them. Please correct me if am wrong.

Since this app is only hosted with 1 MACHINE. I assume that if that 1 machine has issue and is down, the whole postgres is down. correct?

so now comes the real question:
how do i make sure that mini postgres server never go down or less chances to go down?

My assumption is to utilize horizontal scaling


my understanding is that it adds one more machine in another region, so there are 2 server handling the postgres, so in case 1 machine is down, another machine will still be available to handle the connections.

the " Scale Postgres VMs" i guess i don’t need that yet. since the database has low volume and i guess the shared-cpu-1x 256mb ram is still capable.

So, is my understanding of the above “scale vm” and “horizontal scaling” correct? if correct, that means what i need is horizontal scaling. right?

and lastly, the free allowances give us 3x shared-cpu-1x 256mb VMs.
Currently my web app (not postgres app) is using 2 machines of shared-cpu-1x
image
and the postgres app is using 1 machine of shared-cpu-1x as i mentioned above. So i guess once i scale the postgres app horizontally by adding 1 more machine, i will have to start paying?

thanks in advance. These might be some weird questions but please allow me because i came from VPS background, this machine and app things is so new to me. and one of the reasons i move away from VPS is the community around here.

From General to Questions / Help

Added machines, postgres

No, these were reasonable things to wonder about.

(And this forum adheres to the “there are no dumb questions” standard, anyways.)

I don’t have Fly Postgres nodes myself anymore, but I may be able to help a little with the cost side…

The property of “never go down or less chances to go down” that you were inquiring about corresponds to High Availability—3 Postgres Machines, all in the same region. That works out as follows:

machine region cost
web app 1 sin 1 :large_blue_circle: + 5 :yellow_circle:
web app 2 sin 1 :large_blue_circle: + 5 :yellow_circle:
pg 1 sin 1 :large_blue_circle: + 1 :red_circle: +20 :yellow_circle:
pg 2 sin 1 :large_blue_circle: + 1 :red_circle: +20 :yellow_circle:
pg 3 sin 1 :large_blue_circle: + 1 :red_circle: +20 :yellow_circle:

The colored dots are like gaming chips, where you get a certain number for free when you walk in the door but have to pay for the remainder. (The resemblance of Fly’s billing system to an elaborate card game is not universally admired, but it works out strongly in your favor here.)

So, you get 3 :large_blue_circle:, 3 :red_circle:, and 30 :yellow_circle: completely for free (“free allowance”), but then have to pay for the remaining 2 :large_blue_circle: + 40 :yellow_circle:.

chip meaning free allowance cost for extras
:large_blue_circle: tiniest CPU+RAM config 3 $2
:red_circle: 1GB disk slice 3 $0.15
:yellow_circle: 1GB network traffic 30* $0.04*

*Assuming Asia/Pacific

(The figures in the second column are all per month, and the ones in the final column are per chip, as it were. You don’t necessarily have to buy in these exact discrete lumps, incidentally. That’s just an expository expedient.)

Almost all of the above is estimates, of course, and the network traffic in particular is just based on what people have reported in the past in the forum. As I understand it, there is a fair amount of chatter of PG nodes with themselves, even when there is no SQL activity from the web app, and it sounds like Fly.io has maybe stopped waiving the fees for that.

Thus, assuming that you can indeed get away with using such small CPU and RAM sizes (which would be atypical), the charge per month would be ~$5.


Clarification: “web app 1” and “web app 2” are the two Machines in your existing web app, and “pg 2” and “pg 3” are new Machines in your Postgres app.

2 Likes

Damn good explanation, :smiling_face_with_three_hearts: i think you can turn this into flyio pricing “details” documentation. 100% got you. Thanks!

fyi: i am serious about turning that into pricing docs. coz i am sure there are many people out there wanna dig deeper into this but lazy or don’t want to spend the time to ASK.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.