You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hya,
Using Cloud Run (in Go for example), occasionally there is a need to use a 3rd party pkg that does some background processing. Sometimes, this processing is done out of the request context.
For example, I'm using the (https://github.com/google/go-metrics-stackdriver) pkg for sending metrics to stackdriver. It launches a goroutine that periodically sends pending metrics. This is done async to the request flow.
I understand Cloud Run can throttle the CPU to 0 when not handling requests - I am intrigued about how does that affects such use cases. In some cases, I can be OK with my periodic handling being suspended for a while. Just trying to better understand what to expect.
I know the best practice is to avoid background jobs, however, I believe in many use cases it's a requirement (I prefer to not re-write plumbing logic when I don't have to 😄 )
Cheers
The text was updated successfully, but these errors were encountered:
I'm guessing that CPU throttling is different to terminating the process? But I don't see much document about what people should do in a process being throttled or "suspended". To be more specific I personally have no idea what to do with DB connection pools.
Hya,
Using Cloud Run (in Go for example), occasionally there is a need to use a 3rd party pkg that does some background processing. Sometimes, this processing is done out of the request context.
For example, I'm using the (https://github.com/google/go-metrics-stackdriver) pkg for sending metrics to stackdriver. It launches a goroutine that periodically sends pending metrics. This is done async to the request flow.
I understand Cloud Run can throttle the CPU to 0 when not handling requests - I am intrigued about how does that affects such use cases. In some cases, I can be OK with my periodic handling being suspended for a while. Just trying to better understand what to expect.
I know the best practice is to avoid background jobs, however, I believe in many use cases it's a requirement (I prefer to not re-write plumbing logic when I don't have to 😄 )
Cheers
The text was updated successfully, but these errors were encountered: