R
Railway•6mo ago
drewby

high memory usage

Hi, I just opened an app on the hobby plan but it keeps getting stopped due to high memory usage even after I raised the limits from $10 to $12 recently https://github.com/adnjoo/XpenseTrackr/issues/44 It's a standard ruby on rails (7) app with a postgres database attached. Just wondering if anybody has an idea why the memory usage might be high? I'm the only user beta-testing the app right now so it seems weird to me..
GitHub
railway memory usage · Issue #44 · adnjoo/XpenseTrackr
problem: december memory usage high - possibly due to ?multiple migrations potential solution: check january usage try alternative PAAS e.g. heroku? or digitalocean
No description
8 Replies
Percy
Percy•6mo ago
Project ID: df4f61cc-0a52-42e8-8e04-46c2904b91a9
drewby
drewby•6mo ago
df4f61cc-0a52-42e8-8e04-46c2904b91a9
drewby
drewby•6mo ago
app memory usage
No description
Brody
Brody•6mo ago
do you have a WEB_CONCURRENCY variable set? try setting it to 2
drewby
drewby•5mo ago
haven't done that yet.. I just added RAILS_MAX_THREADS to 2.. is it recommended to set e.g. WEB_CONCURRENCY to 2?
Brody
Brody•5mo ago
i think you should try it https://github.com/adnjoo/XpenseTrackr/blob/main/config/puma.rb#L17 Concurrent.physical_processor_count would likely be "seeing" the host machines 32 (or more) cores and could be spawning far to many workers, since each worker and thread will take a reserve amount of ram, that could be where your excess ram usage is coming from. if puma spawns two threads per worker that could theatrically be a whopping 64 workers, more than a hobby project would ever need
drewby
drewby•5mo ago
k I'll try it thank u so much 😄
Brody
Brody•5mo ago
no problem! let me know if it makes a difference