How to lower the cost of simple apps?

I have two barely visited Node.js apps deployments, four in total (the other two are staging apps). Both have custom domains, not sure if that plays a role, but those custom domains are on a separate provider. The total monthly bill comes to about $20 (excluding domains), that seems like a lot.

I have all these entries that I don’t know what they mean:

  • Dedicated IPv4 — $4
  • Machines Shared CPU 1x — $2
  • Machines Shared CPU 1x (cdg) — $4.5
  • Machines Shared CPU 1x (jnb) — $2.5
  • Machines Shared CPU 1x (otp) - cpu_count: 1 — $6
  • Machines Shared CPU 1x (otp) - cpu_count: 1 — $4

Then I have some decreases in cost like:

  • Free Machine Allowance (3 shared-cpu-1x 256mb) — -$6

Two of my apps have two machines, to improve latency (but I don’t really know what I’m doing). I start thinking that if I don’t understand the benefits of this service perhaps I should switch to something else, but maybe it isn’t an overkill. Can I decrease the cost somehow? Is it reasonable considering the details I shared?

Would you consider this a hobby project? You can do w/ 1 machine if you don’t mind the occasional hiccups. Turn on autostop and set it to “suspend”, you’ll save money when it’s not in use and it’ll wake up pretty quick (300ms-ish)

Also, do you really need the dedicated IPs?

1 Like

One is my blog, so hobby, but I feel like two regions are better, and the other one is a few pages of hobby static content which gets visited far less frequently. I realized that my staging apps had two machines so I downsized those, as well as production app of that other project, which is intended for a single region anyway.

I now suspended the apps that made sense for me to suspend, but they’re going to wake up as soon as someone visits them. Is there a way for them to automatically fall back asleep?

As for dedicated IPv4, I don’t know what they are, I just somehow ended up with them, I don’t remember actively choosing them. I thought they come with custom domains. I guess I have some reading to do.

Thanks for your advice.

Use the CLI to release the dedicated IPs.
The machine will automatically sleep after being idle for 5 min or so.

1 Like

Check out the autostart/autostop docs and ensure that you’ve got the right stuff in your fly.toml.

If so, as @khuezy mentions, they’ll autostop after a few minutes of not receiving requests.

1 Like

auto_start_machines/auto_stop_machines appears to be what I was looking for, great! My apps machines automatically got suspended after a while.

As for IPs, I made IPv4 shared in all my apps via CLI. Not sure if I should do the same with v6, but since they don’t appear on my invoice I don’t think I’m being charged for those.

Thanks for all your help both you and @khuezy, I’m looking forward to a lower invoice next month!

I’m not sure which reply to mark as the solution because each of you provided two crucial pieces of the puzzle :sweat_smile: I wish this forum allowed multiple solutions.

1 Like