Skip to content
help with memory profiling FastAPI application
Anonymous
OP

3 years ago

I'm currently facing a challenge with high memory usage by my FastAPI application hosted on Railway. My API does music source separation using the deep learning library Demucs, and the memory consumption spikes with each API request, accumulating substantial costs.

I would really appreciate if anyone here in the community have good suggestions for how I should approach memory profiling or if there are better alternative approaches to troubleshoot this!

Closed

13 Replies

Anonymous
OP

3 years ago

N/A


3 years ago

I honestly don't see much of an issue here with only the screenshots you have provided, yes there is a spike, but it does settle back down to a lower level than what it spiked to, for something that does music source separation with deep learning likely completely in memory that is not a crazy amount of memory at all


Anonymous
OP

3 years ago

@Brody I tried do memory profiling with guppy in the RQ worker, but I don't see anything unusual here either

1236348265864368240


Anonymous
OP

3 years ago

@Brody any other ideas on how I could make requests more cost-effective? $1.60 per request does not seem very scalable to me, but I don't know what the industry standard is either, so maybe I'm being ignorant


3 years ago

I mean, I didn't think deep learning was really cost effective to begin with?


Anonymous
OP

3 years ago

I think maybe that the initial memory spike is actually caused by the RQ worker downloading Demucs at runtime


Anonymous
OP

3 years ago

I'm just baking the model into my Docker image


3 years ago

sounds possible


Anonymous
OP

3 years ago

@Brody that was the issue 😅


3 years ago

just a friendly reminder that pinging is against the rules


Anonymous
OP

3 years ago

oh sorry


Anonymous
OP

3 years ago

thx for answering my questions


3 years ago

no problem


Welcome!

Sign in to your Railway account to join the conversation.

Loading...