res.download is extremely slow
uche01
HOBBYOP

16 days ago

I recently switched from gcp to railway due to cloud sql costs. Still trying out railway with the free plan and it's been great.

I moved both my app and database(postgres)

Recently I tried to access an endpoint that requires me to download a zip file of 2.55MB and I am seeing download time of more than 2 minutes. Like cloud run was instant for the same endpoint.

Zip is generated on the server and sent back to client.

After doing some research, there are suggestions that the issue may be due to the limits in free plan but I doubt this. I currently still have about 4$ credits left and inspecting dashboard, there appears not to be any maxing out of limits.

I plan to upgrade but need to be sure everything would work fine after upgrade

Here is a snippet of the download code

const downloadComplete = new Promise((resolve, reject) => {
                res.download(zipPath!, 'content.zip', (err) => {
                    if (err) reject(err);
                    else resolve({});
                });
            });

This is a res.download issue as other response types like res.send or res.json works well.

Solved$10 Bounty

3 Replies

Railway
BOT

16 days ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


brody
EMPLOYEE

16 days ago

Hello,

We do not throttle download speeds based on the plan.

Unfortunately, I do not know why you are experiencing slow downloads. There are no networking restrictions on our end, so I will open this up to the community to help you debug.

Best,
Brody


Status changed to Awaiting User Response Railway 16 days ago


uche01
HOBBYOP

10 days ago

For some reasons, the response speed got better after trying it the next day. Not sure why but would be closing the issue as resolved


Status changed to Solved brody 10 days ago


Loading...