Service using much more RAM on Railway than Local
Hi, my discord bot is using a lot more ram on Railway than on my local machine.
Railway: https://i.mrxbox98.me/file/2023/10/firefox_7CMFWfJz4N.png
Local: https://i.mrxbox98.me/file/2023/10/WindowsTerminal_bEvWZJ2DHO.png
This is my first time using btop to check RAM usage so lmk if I'm measuring wrong locally.
18 Replies
Project ID:
b820c80e-50e9-475a-85c6-89832fccdd8c
b820c80e-50e9-475a-85c6-89832fccdd8c
what kind of app is it, besides bun
Its a discord bot, here is the package.json
railway uses the start script by default, but you aren't using the start script when testing locally
I changed the railway default so it is
npm run bun-run
have you tested your app locally in a docker container too?
Ill try that and get back to you
@luna - the something to do with bun
Ah yep let me look at this on my laptop
can you please change your start script to this and let me know what version it prints out? please do this locally and for railway.
if there's a version mismatch that may be the issue here as they've been fixing a fair few memory issues recently.
bun --revision && bun run src/index.ts
@Mrxbox98
My local is
1.0.7+b0393fba6200d8573f3433fb0af258a0e33ac157
, for some reason the command on railway didnt print anything. Another strange thing I noticed was when I switched to node the memory on railway went down from 1.4gb to around 800mb while on my local node uses more memory than bun.the increased memory usage is likely due to the difference in bun versions and environments
How did you setup the one for railway? 🤔
Nvm I was able to find it, I think I was looking at an old version. Turns out the install was for some reason installing bun verison
1.0.2+37edd5a6e389265738e89265bcbdf2999cb81a49
yep that's probably part of the issue then. i personally run a
Dockerfile
to make sure im on the latest version of bun because of this.Yeah not sure why the latest bun npm release tagged 1.0.7 is actually 1.0.2
1.0.2 is the version railway is currently using for bun builds, nothing to do with npm