a year ago
We have 3 services.
A Strapi Node.js CMS with its own database for user data
A fastify/prisma orm to store blockchain data inside a seperate postgres database
A fastify server to fetch data from the blockchain and other applications.
Mainly both fastify backends communicate with each other.
If i run my service locally, i fetch around 10000 trades and store them in my database in 6 seconds.
I have a mac with 32GB Ram.
On railway, the metrics doesn't seem to really spike, but it is really slow.
For the same request, it took 240 seconds.
6 Replies
a year ago
Hello,
I notice you have your databases on GCP and your other services on Metal, please move all services to the same region and let me know if the performance improves.
Best,
Brody
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
I switched that, and it looks like it works faster now. However the database seems to work sequentially. do i need to add more pools in prisma ?
The performance is slightly worse than on my mac though.
average response time is 1.5 times more than locally.
Even though i've set it up correctly now.
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
Hello,
The databases aren't sequential, we have many users using them at many thousands of TPS, the bottleneck here would have to come from your code.
I'm glad the performance has improved, but unfortunately, we won't be able to offer coding assistance or advice here, perhaps forums such as StackOverflow could help you further?
Best,
Brody
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
So it is possible for me to horizontally scale my application and make f.e. 3 prisma instances reference the same Database, where all have different functionalities ( Read and write f.e. ) ?
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
You can horizontally scale -
https://docs.railway.com/guides/optimize-performance#configure-horizontal-scaling
But you would need to handle the database logic in code.
Status changed to Awaiting User Response Railway • about 1 year ago
7 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 7 months ago