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
15 Replies
Project ID:
b0b525c1-ced1-4ba1-ab53-25856ba5b50d
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?
adam had the same though as me: Too many workers
is this something like a celery or huey worker?
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.
what's your concurrency value on the celery worker?
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.
you're sure it's defaulting to 1? I could have sworn it defaults to 10
The default is the number of CPUs available on your system.
whats your current start command for celery?
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
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
What number makes sense? This is a bit new territory for me
ah I see, upgrading to Pro would actualyl make those 32 available
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
Thanks, I'll report back!
Also you dont work at Railyway? lol double thanks
nope lol