R
Railway11mo ago
odysseus

Billing Help - Memory costs soaring

project ID - b0b525c1-ced1-4ba1-ab53-25856ba5b50d Obviously, my bill has ballooned considerably from the few $ a month I started with and I am kinda unclear on what to do. The "worker" container is clearly the culprit with memory being 99% of the bill. 1) if my project's memory is never surpassing ~3GB, is there a reason to upgrade from Hobby to Pro? Kinda unclear if that would reduce my memory costs at all. 2) How do I throttle or reign in these memory costs? Is there a way to set RAM requests and limits for a given container? thanks
No description
No description
15 Replies
Percy
Percy11mo ago
Project ID: b0b525c1-ced1-4ba1-ab53-25856ba5b50d
Adam
Adam11mo ago
1: upgrading to pro will not reduce your memory costs, it will only increase your memory cap (and cpu, storage etc.) 2: there is no way to set a resource limit, you'll have to troubleshoot your code to figure out why it's using so much RAM. Maybe there's a memory leak? The process isn't letting go of memory it's using? Too many workers?
Brody
Brody11mo ago
adam had the same though as me: Too many workers is this something like a celery or huey worker?
odysseus
odysseusOP11mo ago
Indeed it's a celery worker doing voice synthesis, so it's concatenating packets in-memory. Gotta figure out how to do this in a more manageable way.
Brody
Brody11mo ago
what's your concurrency value on the celery worker?
odysseus
odysseusOP11mo ago
Ah, that is not set anywhere. So it is defaulting to 1. But a higher number would increase the CPU demand, right? Only one CPU core is available to the resource if I understand it right.
Brody
Brody11mo ago
you're sure it's defaulting to 1? I could have sworn it defaults to 10
odysseus
odysseusOP11mo ago
The default is the number of CPUs available on your system.
No description
Brody
Brody11mo ago
whats your current start command for celery?
odysseus
odysseusOP11mo ago
poetry run celery -A fwd_server.worker:app worker --logfile=/dev/null --hostname worker-1 --max-memory-per-child 1024 I tried experimenting with that last command, not really clear if that helped or not
Brody
Brody11mo ago
number of cpus could be 32 yes you are hobby (as far as i can tell) but the code that checks for the cpu count can sometimes see the host cpu count
odysseus
odysseusOP11mo ago
What number makes sense? This is a bit new territory for me ah I see, upgrading to Pro would actualyl make those 32 available
Brody
Brody11mo ago
correct, but even if you where on pro, its unlikely that you'd want to spawn 32 processes anyway, so many try 2? you can always increase it easy enough
odysseus
odysseusOP11mo ago
Thanks, I'll report back! Also you dont work at Railyway? lol double thanks
Brody
Brody11mo ago
nope lol
Want results from more Discord servers?
Add your server