7 months ago
Hi all,
I was planning to migrate from GCP to Railway for one of my clients. I wanted to take your suggestions and not just rely on AI. I'm thinking how should i allocate resource while keeping the cost down as its a non-profit organization.
Stack
Backend - Nodejs/Express.js with TS
Frontend - Nextjs
DB - MySQL
The major confusion I'm having is with resource allocations.
These are what's going on with the system.
Cron jobs
Daily 14 jobs
Sunday and Wednesday there are extra 2 jobs to send text and emails.
Total jobs in a week.
98 jobs and the emails are hardcoded. 44 people recieves reports everyday.
2 jobs on Sunday and Wendesday, totaling 4 jobs for sending out comms to parents to tell them to come to the platform to Fill up their child's scorecard. In this one, we are scheduling and reading the database every 5 mins where the columns are indexed for performance. As we are sending comms based on timezones.
Totaling 102 Jobs in 1 Week.
Total Concurrent users: ~80 - ~120 people will login altogether when the texts and emails go out.
The frontend is pretty simple, just call the api no crons from there.
I created 3 instances under a workspace on railway and I've been testing
Frontend - 1 vCPU, 4 GB RAM
Backend - 2 vCPU, 4 GB RAM
MySQL - 1 vCPU, 3 GB RAM
I'm trying to understand what would be the ideal resource allocation for such an application. I'm using the Hobby plan but let me know if Pro would be a better choice. My Client wants to keep it under 20 USD, but if we need to push for more, I can negotiate with the right numbers. I know your time is precious, but your guidance would help me finalize the migrations for a smoother performance.
1 Replies
7 months ago
Hey there! We've found the following might help you get unblocked faster:
🧵 After moving MySQL to metal, queries from NodeJS are 2-3x slower
🧵 Nodejs backend deployment deleted and entire MySQL database stopped
If you find the answer from one of these, please let us know by solving the thread!