---
title: "Discussion on \"My Idle Background Worker Was the Most Expensive Thing I Owned\" | Hashnode"
description: "Discussion on \"My Idle Background Worker Was the Most Expensive Thing I Owned\". A queue that was empty almost always, a consumer polling it once a second forever, and a platform that only bills for CPU when requests arrive."
url: "https://hashnode.com/posts/my-idle-background-worker-was-the-most-expensive-thing-i-owned/6a8e33d71011e317aa404c6d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [My Idle Background Worker Was the Most Expensive Thing I Owned](https://blog.ashishkrjha.dev/my-idle-background-worker-was-the-most-expensive-thing-i-owned?utm_source=hashnode&utm_medium=feed)

A queue that was empty almost always, a consumer polling it once a second forever, and a platform that only bills for CPU when requests arrive.

Aug 26 · 20 min read · blog.ashishkrjha.dev  
Updated Aug 29  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#devop](https://hashnode.com/tag/devop)
-   [#devops-articles](https://hashnode.com/tag/devops-articles)
-   [#devops-journey](https://hashnode.com/tag/devops-journey)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)

## Written by

[Ashish Kr Jha](https://hashnode.com/@Ashish14411)

@Ashish14411

  
[View profile](https://hashnode.com/@Ashish14411)

## Responses 6

Markdown supported · ⌘↵ to post

[Duko tools](https://hashnode.com/@talha24ramzan)

[Aug 27](https://hashnode.com/posts/my-idle-background-worker-was-the-most-expensive-thing-i-owned/6a8e33d71011e317aa404c6d/comment/6a8fd6f1726c9686686a1241)

The min-instances=0 "fix" is the part worth flagging loudest, it's not a cheaper version of the same behaviour, it's silent data loss wearing a cost-optimization costume. Tasks pile up with zero errors anywhere, which means the failure surfaces as a support ticket about missing emails weeks later, not a billing alert.

The commit-before-enqueue ordering check is the detail I'd have missed entirely. Async execution accidentally papering over that bug via network latency, only to have eager mode "tear the paper off" immediately, is a sharp way to describe how a timing bug can hide behind a slow path for years and then surface the instant you make things faster.

The agent framing at the end is the most useful generalization though, "conventional" and "correct for this billing model" being different things, and the constraint living in a billing console the agent never had access to. That's not really a Celery story, it's a story about where the information an agent needs actually lives.

[Ashish Kr Jha](https://hashnode.com/@Ashish14411)

[Aug 29](https://hashnode.com/posts/my-idle-background-worker-was-the-most-expensive-thing-i-owned/6a8e33d71011e317aa404c6d/comment/6a8fd6f1726c9686686a1241#reply-6a929e00787de25336fb74e8)

Good way to put it. The silent-failure part is what made that option especially dangerous, and the agent/context angle is the part I ended up taking away from it too.

[Sanoary Istiaque](https://hashnode.com/@istyy)

[Aug 26](https://hashnode.com/posts/my-idle-background-worker-was-the-most-expensive-thing-i-owned/6a8e33d71011e317aa404c6d/comment/6a8ec051b25232b1a0daab87)

This was such a relatable engineering story. It’s easy to overlook the cost of something that’s “just sitting there” until the numbers make you pay attention. I really liked the practical lesson here: infrastructure decisions should be revisited as usage and scale change. A great reminder that optimization isn’t always about making things faster it can also be about questioning what actually needs to be running in the first place.

[Ashish Kr Jha](https://hashnode.com/@Ashish14411)

[Aug 29](https://hashnode.com/posts/my-idle-background-worker-was-the-most-expensive-thing-i-owned/6a8e33d71011e317aa404c6d/comment/6a8ec051b25232b1a0daab87#reply-6a929e6406cfedaf8b76039e)

Exactly. The useful question turned out to be less “what can I optimize?” and more “what actually needs to exist all the time?”

[Andrew](https://hashnode.com/@rizzdev)

[Aug 26](https://hashnode.com/posts/my-idle-background-worker-was-the-most-expensive-thing-i-owned/6a8e33d71011e317aa404c6d/comment/6a8e4894073adfd2569bdb4d)

Eager mode is useful, but Cloud Run's request timeout is now the only bound your inline tasks have. A hung SMTP call that used to die at task\_time\_limit now sits on signup until the service timeout fires. Tune that number before a slow provider turns the hang into a 504 on signup.

[Ashish Kr Jha](https://hashnode.com/@Ashish14411)

[Aug 29](https://hashnode.com/posts/my-idle-background-worker-was-the-most-expensive-thing-i-owned/6a8e33d71011e317aa404c6d/comment/6a8e4894073adfd2569bdb4d#reply-6a929f0739c3135e39ff0a85)

Good catch. Once the task moves inline, the request timeout becomes part of the same failure budget. Bounded it at 5s per attempt and 12s total across attempts and backoff. The post also understates the normal case, since signup sends two emails sequentially, so that needs a correction too.
