> For the complete documentation index, see [llms.txt](https://docs.openiam.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openiam.com/troubleshooting/performance/disableswap.md).

# Disable swap

Confirming swap is disabled and keeping it off across reboots, which OpenIAM requires rather than merely prefers.

{% hint style="warning" %}
**Swap being off is an installation requirement, not a tuning option.** OpenIAM's memory settings are sized for a host that does not swap, and the installer checks it before it begins — see [What you need](/installation/what-you-need.md). A host that has had swap re-enabled since installation has drifted out of a supported state.
{% endhint %}

Linux swaps pages out to disk to manage memory pressure, and it is fairly aggressive about it by default. For Redis, the cache OpenIAM depends on, a swapped page turns a memory lookup into a disk read, so a host that swaps under load performs far worse than one that does not.

| Symptom                                                          | Likely cause                                                                 | Resolution                 |
| ---------------------------------------------------------------- | ---------------------------------------------------------------------------- | -------------------------- |
| The platform is slow under load, with no single service at fault | The host is swapping, so every tier is paying disk latency for memory access | Confirm and disable, below |
| The installer refuses to start, reporting swap                   | A swap device is active                                                      | The same                   |

## Confirm whether swap is active

```bash
swapon --show
```

**No output means swap is off** — that is the state you want. Any row is an active swap device.

{% hint style="info" %}
**`blkid` does not answer this question.** It lists partitions by what they are formatted as, so a swap partition that has been disabled still appears with `TYPE="swap"`. Use it to find *which* device to comment out of `/etc/fstab`, not to check whether swap is on.
{% endhint %}

## Disable it

{% stepper %}
{% step %}
**Turn swap off now.** This takes effect immediately.

```bash
swapoff -a
```

{% endstep %}

{% step %}
**Keep it off across reboots.** Edit `/etc/fstab` and comment out the line containing `swap` by putting a `#` at the start of it. Without this, the next reboot brings swap back.
{% endstep %}

{% step %}
**Reload the units generated from `/etc/fstab`**, so systemd stops tracking the swap device:

```bash
systemctl daemon-reload
```

{% endstep %}

{% step %}
**Confirm.** `swapon --show` should now return nothing.
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.openiam.com/troubleshooting/performance/disableswap.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
