How to organize my projects to optimize costs
Hi, I'd like to know what would be better to optimize costs in Railway since I'm paying around $40 per month, I don't see that as a lot but well, if I can reduce it, better then.
I have 15 projects. Each one named with the name of the company, and inside it has a Postgres database and a Strapi CMS connected to it.
These receive around 150k requests per month.
2 GB of ram should be enough (I think, lol) to handle that amount of requests (and usage in general), but around 10k requests per month is enough make a single project use 750 MB - 1.25GB of RAM, so I have 15 projects using ~1GB of RAM, which is expensive.
I'd like to ask if it'd be cheaper to create a single project, put there a single Postgres Database (using different schemas for each project), and put the 15 Strapi Admins there, connected to it. Is there any catch-ups for this implementation or something I should know?
If there isn't a clear response to this, and it's something I should try out, let me know! Thanks!
32 Replies
Project ID:
c76a19f8-74a9-4003-8811-1ffb7bf64233
what's the average usage of those postgres instances? Strapi is a resource hungry service
Mmm ugh I don't know, how can I check it? Do these images respond to it?
is that from the current month?
Yes
get from a past month, there's a selector on the top of the page
dont forget the egress costs 👀
Ok let me send everything
These are the same two of the last month
in my exprience, 1 shared DB instance for multiple CMS instances should work perfectly fine
but it might become a bottle neck at some point (if it uses more RAM/CPU than your railway plan)
it doesnt show the postgres usage :/
but ok, my point is that the postgres usage is so little (about 50mb~100mb) that it might not be worth it doing all of that work
Sorry wait
Is it ok?
yep, as I guessed
you would save about 7.5$ by doing all of that
Well that's around 25%
if its worth it for you ok but IMO i would leave it as is
Actually I prefer to leave this the way it is now, this way is easier to separate costs by client. But I'm going to think about it. Thanks a lot @ThallesComH
well, you also lose redundancy in case your postgres instance goes down
and a redundant postgres instance might be more expensive
yep, unfortunately thats the price to pay for using Strapi
What do you recommend?
Payload?
I didn't try much CMS out there due to project restrictions so dont trust 100% my recommendations
but i really liked payload, they seems to support Vercel so you could probably host for free
I'm going to take a look, thanks!
I saw this video of them in case you want to take a look
https://www.youtube.com/watch?v=CZ7a-dx3Glw
Payload
YouTube
Install Payload Into Any Next.js App With One Line — 3.0 Beta Is He...
🎉🎉 Big news: 🚀🚀 Payload 3.0 Beta is now available, making Payload truly Next.js native! You can get started in one line: npx create-payload-app@beta
Chapters:
0:00 3.0 Is Here
0:50 A Turning Point for Headless CMS Industry
1:39 Combining Payload Into Any Next.js App
4:58 Modular Local API: Use Payload Anywhere
7:27 Server-side HMR
8:32 Deploy ...
directus.io is what i would recommend 🙂
i would recommend that too but i don't know their resource usage so it might be the same as strapi
i have an instance that uses around 385 MB, nearly no CPU usage (its not very active)
database uses +- 38 MB and also nearly no CPU usage
the 385MB is because of the caching that Directus does, if you want it as cheap as possible, you can disable it but CPU usage will be high(er) and requests will take a little bit longer
its mostly defined by how your project is setup and what you have inside of it
(if you use features like generating a thumbnail for an image, it will spike temporary)
I had to ask a customer to add another replica to their directus install since it couldn't handle sub 100 req/s 🫤
I don't know what they were doing with it, but still.
which is extremely weird 'cause directus handles more than that
I know, so they must have been doing something heavy
With Directus you can install/create plenty of stuff that would slow your replica down
If you can link me that issue, i might be able to help out
its already solved 🙂
alright!