by emilsedgh · 5y ago · 0 comments
I had a worker service running on Heroku. Very CPU intensive. The traffic pattern was extremely low throughout the day, but had completely unexpected surges.
On Heroku, my choices were: Paying $3k (basically paying for peak surge throughout the month) or having a lot of slow/failed responses during the surge.
Moved to Cloud Run very easily. Just a normal dockerized 12 factor app.
Now I pay ~$50/m and it automatically scales up when I need more workers.
If you want a managed app platform, it couldn't be more simple and cheap.
The scaling model of Cloud Run has been great. Now that they support websockets, I will be moving all my apps slowly to it.
My only gripe: I wish they had something for worker processes. I know that the rest of Google Cloud has solutions for it but being able to just spawn worker processes as part of the same deployment would be fantastic.
Have a look at GCP EventArc. It's a new way to trigger cloud run instances. You could create an EventArc trigger that wakes up a worker image, or some such. Basically,EventArc enables serverless event driven design across all GCP. https://cloudblog.withgoogle.com/topics/developers-practitio...
It may not fit your needs, but did you know that you can invoke other Cloud Run containers from a Cloud Run container?
Alternatively, you can enqueue Cloud Tasks from a Cloud Run container. Those Cloud Tasks can in turn invoke Cloud Run containers.
Not sure if they fit your usecase, but I use both of these approaches and they really expand the capabilities of Cloud Run for me.