How to make my Node app on Railway faster?
rayrift
HOBBYOP

5 months ago

Hi,

Good day

I have a Node backend in Fastify running on Railway. The response times are a little slower then i expecetd, and I'm pretty sure it's not my database.

Any tips for bringing the request time down in the Railway or in my Node app?

Attachments

$10 Bounty

1 Replies

dev-hari-prasad
FREE

5 months ago

You can do a few things to make your app faster like:

1. Configure your database connection pool (set max connections to 20 and add timeouts)

2. Disable verbose logging in the prod eg. Fastify’s logger: true adds overhead

3. Add compression with @fastify/compress, and reduce or remove request.log.info calls in routes

The biggest wins are the connection pool config and turning off logging in production. I think this shall help you achive 20% to 30% imporvment


Welcome!

Sign in to your Railway account to join the conversation.

Loading...