# How to prevent auto-suspend?

**URL:** <https://community.fly.io/t/how-to-prevent-auto-suspend/27203>\
**Category:** General\
**Tags:** machines, autoscaling, login-only\
**Created:** [February 24, 2026, 10:29am UTC](https://community.fly.io/t/how-to-prevent-auto-suspend/27203 "2026-02-24T10:29:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![porton](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/porton/32/42754_2.png) [@porton](https://community.fly.io/u/porton)\
**Post date:** [February 24, 2026, 10:29am UTC](https://community.fly.io/t/how-to-prevent-auto-suspend/27203/1 "2026-02-24T10:29:04Z")

</div>

My machine has ` **`auto_stop_machines = "suspend"``** (to reduce costs).

I do want to suspend it sometimes, but _while running certain tasks_ I want the machine not to be suspended. How a machine can prevent its own suspension (during it executing a certain task)?

---

<div class="post-metadata">

**Author:** ![lillian](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/lillian/32/49616_2.png) [@lillian](https://community.fly.io/u/lillian)\
**Post date:** [February 24, 2026, 11:33am UTC](https://community.fly.io/t/how-to-prevent-auto-suspend/27203/2 "2026-02-24T11:33:51Z")

</div>

there isn’t any way to pause auto-stop/auto-suspend for a machine while it is running a task; it is based only on incoming requests. I would recommend creating a temporary machine for the task which is not part of the http service, and then setting it to auto\_destroy so it goes away once the task is finished.

---

<div class="post-metadata">

**Author:** ![khuezy](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@khuezy](https://community.fly.io/u/khuezy)\
**Post date:** [February 24, 2026, 1:52pm UTC](https://community.fly.io/t/how-to-prevent-auto-suspend/27203/3 "2026-02-24T13:52:42Z")

</div>

You could try to send an external request to a noop API. But like Lillian said make a separate worker

---

<div class="post-metadata">

**Author:** ![bglw](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/bglw/32/51112_2.png) [@bglw](https://community.fly.io/u/bglw)\
**Post date:** [February 24, 2026, 11:41pm UTC](https://community.fly.io/t/how-to-prevent-auto-suspend/27203/5 "2026-02-24T23:41:00Z")

</div>

External requests won’t stop the automatic suspension. `auto_stop_machines` is a function of the fly-proxy which makes that decision exclusively based on inbound connections.

The best answer is usually to take control of when your machines stop or suspend yourself. So your config would wind up as:

```auto
auto_stop_machines = "off"
auto_start_machines = true

```

In this setup the proxy will start your machines when they are needed, but will never stop or suspend them. Then, you can stop your own machines by ending your process with a success code, or you can [self-suspend](https://fly.io/docs/reference/suspend-resume/#machines-api) from within your own machine:

```auto
curl --unix-socket /.fly/api -X POST \
  http://flaps/v1/apps/$FLY_APP_NAME/machines/$FLY_MACHINE_ID/suspend

```

---

<div class="post-metadata">

**Author:** ![khuezy](https://avatars.discourse-cdn.com/v4/letter/k/4da419/32.png) [@khuezy](https://community.fly.io/u/khuezy)\
**Post date:** [February 25, 2026, 3:34am UTC](https://community.fly.io/t/how-to-prevent-auto-suspend/27203/6 "2026-02-25T03:34:22Z")

</div>

I mean an external request back to the same apps noop endpoint. That should work right?

---

<div class="post-metadata">

**Author:** ![bglw](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/bglw/32/51112_2.png) [@bglw](https://community.fly.io/u/bglw)\
**Post date:** [February 25, 2026, 3:55am UTC](https://community.fly.io/t/how-to-prevent-auto-suspend/27203/7 "2026-02-25T03:55:24Z")

</div>

Yes, an external request coming in keeps the app alive, though at the point you’re doing that I’d recommend managing the suspend/stop lifecycle directly rather than using the proxy autostop.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg) [@system](https://community.fly.io/u/system)\
**Post date:** [March 4, 2026, 3:55am UTC](https://community.fly.io/t/how-to-prevent-auto-suspend/27203/8 "2026-03-04T03:55:25Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
