R
Railway•3mo ago
bmariano

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
Percy
Percy•3mo ago
Project ID: c76a19f8-74a9-4003-8811-1ffb7bf64233
ThallesComH
ThallesComH•3mo ago
what's the average usage of those postgres instances? Strapi is a resource hungry service
bmariano
bmarianoOP•3mo ago
Mmm ugh I don't know, how can I check it? Do these images respond to it?
No description
No description
ThallesComH
ThallesComH•3mo ago
is that from the current month?
bmariano
bmarianoOP•3mo ago
Yes
ThallesComH
ThallesComH•3mo ago
get from a past month, there's a selector on the top of the page
Attacler/Bart
Attacler/Bart•3mo ago
dont forget the egress costs 👀
bmariano
bmarianoOP•3mo ago
Ok let me send everything
bmariano
bmarianoOP•3mo ago
No description
No description
bmariano
bmarianoOP•3mo ago
These are the same two of the last month
Attacler/Bart
Attacler/Bart•3mo ago
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)
ThallesComH
ThallesComH•3mo ago
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
bmariano
bmarianoOP•3mo ago
Sorry wait
bmariano
bmarianoOP•3mo ago
Is it ok?
No description
No description
ThallesComH
ThallesComH•3mo ago
yep, as I guessed you would save about 7.5$ by doing all of that
bmariano
bmarianoOP•3mo ago
Well that's around 25%
ThallesComH
ThallesComH•3mo ago
if its worth it for you ok but IMO i would leave it as is
bmariano
bmarianoOP•3mo ago
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
ThallesComH
ThallesComH•3mo ago
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
bmariano
bmarianoOP•3mo ago
What do you recommend? Payload?
ThallesComH
ThallesComH•3mo ago
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
bmariano
bmarianoOP•3mo ago
I'm going to take a look, thanks!
ThallesComH
ThallesComH•3mo ago
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 ...
Attacler/Bart
Attacler/Bart•3mo ago
directus.io is what i would recommend 🙂
ThallesComH
ThallesComH•3mo ago
i would recommend that too but i don't know their resource usage so it might be the same as strapi
Attacler/Bart
Attacler/Bart•3mo ago
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)
Brody
Brody•3mo ago
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.
Medim
Medim•3mo ago
which is extremely weird 'cause directus handles more than that
Brody
Brody•3mo ago
I know, so they must have been doing something heavy
Attacler/Bart
Attacler/Bart•3mo ago
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
Brody
Brody•3mo ago
its already solved 🙂
Attacler/Bart
Attacler/Bart•3mo ago
alright!
Want results from more Discord servers?
Add your server