I have a somewhat CPU intensive service I want to deploy on Fly (since Google Cloud Run crapped out on me).
I could probably run it with 256MB of RAM but from the pricing page it seems I’d need to get the dedicated-cpu-1x plan which has 2GB of RAM and costs $31/month.
Have you tried out the shared-cpu-1x option? Also, I believe that there is also shared-cpu-2x up to shared-cpu-8x that you could try. The pricing page hasn’t yet been updated but essentially just multiply the shared-cpu-1x price by the number of CPUs (e.g. shared-cpu-4x is ~$7.76).
So I then upscaled the app to use 1 dedicated CPU and 2GB of RAM and I’m still waiting after 1 hour.
The same audio file takes about 45 seconds in my 2017 Core i5. I’m using ffmpeg spawning a new process. The Lame MP3 encoder is single threaded so the number of cores doesn’t matter here.
As a side note, even with 2GB of RAM available, the app never consumed more than 200MB which is why for this type of workload RAM doesn’t matter much.
Locally (Apple M1 Max), it took 3s once. Then, it hung forever on the next tries.
Are you pushing your test.mp3 as part of the build? Add test.mp3 to a .dockerignore. Looks like the program hangs if test.mp3 exists. You can also add the -y flag to ffmpeg to overwrite the existing file.
As far as I can tell, that’s probably the issue!
(I haven’t been able to deploy it to Fly because of the bug with running recent ubuntu images on some of our older kernels, working on moving my builder somewhere else so I can test this on Fly)
Sorry. It was late at night and forgot to create the .dockerignore file. I’ve pushed it to the repo now.
I’m trying to deploy it to a new app but it fails with the Failed due to unhealthy allocations error. Is this because of the bug you mention? Would I be able to deploy with Alpine? I used Ubuntu for the repro because I need it to install other packages in my production app which are not available for Alpine.
Also 3 seconds on the M1 Max? Woah that’s slow. I imagine it’s because it’s running inside Docker with Rosetta.
It’s true on this repro I made the mistake of not adding -y to the command, but on my production app this doesn’t happen. You can see from the CPU graph I pasted earlier that the app was doing hard work.
Is this because I’m using the latest version of Ubuntu? What version do you recommend to use?
I’m not entirely sure why the Ubuntu version would matter, except that it might ship a different version of ffmpeg.
We don’t generally recommend alpine, but if you don’t need to do DNS lookups or ipv6 too much, it might be ok!
If you can reproduce the issue with ubuntu again and get it spinning, you could ssh in there and run strace or perf (but that could be painful to setup) on the process to see what it’s doing.