Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Plugin] [Support] Unraid ZRAM Plugin (Compressed RAM) with disk swap

Featured Replies

Hi,

I have created a new plugin to configure and view ZRAM on [low] ram unraid servers: https://github.com/johnpwhite/unraid-plg-zram

For those who don't know what it is, it is a module to create compressed block devices in ram. This plugin supports compressed swap in ram and disk swap fall back. It's really useful if you're running Unraid on a server with low memory, you can squeeze more out of it and a little cpu/latency cost. Go forth and multiply those docker containers!

More details here:

https://en.wikipedia.org/wiki/Zram

It's available in the CA App Store, else you may install it manually with this link: https://github.com/johnpwhite/unraid-plg-zram/raw/main/unraid-zram-card.plg

The dashboard card:

image.png

The settings page:

image.png

Edited by johner
Updated title now live. added description, new images, swap feature

hey @johner i installed the plugin and it works great! thanks

  • Author
15 hours ago, wildenrou said:

hey @johner i installed the plugin and it works great! thanks

thanks for the feedback! Let me know if you need anything changed/extended etc. I'm just working through getting it in to the CA store.

  • Author

Thanks @Squid , zram plg template as been fixed/uploaded. OpenClaw is not working yet so removed it, and appears there is one going through the process so I'll drop mine.

Thanks again

John

Edited by johner

  • johner changed the title to [Plugin] [Support] Unraid ZRAM Plugin
  • Author

hi @Squid I think this thread is ready to move to the plugin support area, is that something I can do myself? if not, would you do the honours please?

Just want to say thanks for the plugin! Probably going to be useful for a lot of people with the current prices of RAM. Great timing for me as I've added a few containers that're relatively memory intensive and started looking into enabling ZRAM through CLI but this was way easier ;-).

  • Author
11 hours ago, ParrotParity said:

Just want to say thanks for the plugin! Probably going to be useful for a lot of people with the current prices of RAM. Great timing for me as I've added a few containers that're relatively memory intensive and started looking into enabling ZRAM through CLI but this was way easier ;-).

Thanks for the feedback! Let me know if you need any changes/features added.

  • 1 month later...

This plugin is not visible for me in CA; only your "Unraid AI CLI Agents" plugin shows up.

  • Author

Oh interesting, I thought it was the other way around at one point!

Let me check the index files.

Thank you for reporting.

Always welcome; if not reported, how can it be known? 😂

As an aside, I was previously going to use https://forums.unraid.net/topic/109342-plugin-swapfile-for-691/ until I found your plugin which configures zram and swap (very nice that you include both)

Two additional questions for you, when you've got a moment

  1. Is there a reason you limit swappiness from 0-100? The actual swappiness can be well outside that range; I'm used to setting it to a value of 180 on my desktop, going off the arch wiki (https://wiki.archlinux.org/title/Zram#Optimizing_swap_on_zram), because I want zram favored very heavily over swap, as I only have spinning rust (HDDs) in my collection (for my unraid server as well as my desktop; the only SSD I have is a small old Samsung EVO 120G, which is used as my /boot and / partitions on my desktop). A higher swappiness means it will heavily favor the zram because of how much slower swap is when it has to page out for it; even on SSDs the general consensus I'm aware of is a value around 133; 180 seems ideal where I have only HDDs to burn instead.

  1. Is there actual evidence of the warning that pops up when the only cache drive you have is an HDD (again, I just don't have any SSDs in my collection besides my desktop's old /boot&/ drive) saying "HDD swap causes severe performance degradation and may interfere with parity operations"? I am aware HDD swap is terrible for performance, but its still a thousand times better (in my opinion) than running into an OOM issue; the bit I was unaware of was that it may interfere with parity operations, is there actual evidence you found related to that, or is just a possibility? Because with unraid having it assigned as a cache drive, not a part of the array pool, I would not think that should be a risk myself, and have not yet seen anything suggesting that, so I'm interested if you have found evidence to that, or have reasons to believe it a significant risk, especially since your plugin already only allows cache drives to show up.

Edited by Mesmerus
I forgot an ending parentheses; whoops lol

  • Author

hi,

Thx again for the feedback, I’ll make a change to increase swapiness, I never really checked the actual limits!

Does it allow you to create on HDD?

I agree anything is better than OOM, I’ll tone down the ‘opinions’ 🤣 AI has helped me build this, it can be quite opinionated!

Aha, I figured there might have been reasons - having the swappiness be more flexible would be nice for sure.


It did allow me to create it on the HDD I have set up. I configured a separate pool called 'swapdisk' with only one slot, and put said HDD into it. Being a separate pool, there's no parity protection in the first place, same as a cache pool would be (though that would also ideally want to be SSDs, whether there's one or multiple for sure), so I was confused about the note suggesting issues with parity operations, given it doesn't allow for array disks to be selected (which would be very undesirable for multiple reasons, including actually likely causing issues with parity operations).

So far no issues running with the HDD, but I have noticed on the little widget-style thing on the dashboard (I don't know what they're meant to be called) it lists the zram, and the lower tier still gets referred to as "SSD" - it might be more prudent to call it "Swap Disk" or "Swap Drive" or such, rather than implying or trying to detect whether its an SSD or HDD. Those who can would surely be using an SSD, those who can't use an HDD because it is better than nothing, but in either case, its being used for swap. So far I haven't seen the server actually compress anything, or really use the swapdisk, so the thing on the dashboard is just flat for me, but running zramctl I get back matching zeros, so I guess its just not using the zram yet, which isn't a bad thing.

I'm hopeful once you work out why its not listed in CA switching from the manual plugin to using CA (because I heavily prefer to do that for plugins in particular, as is best-practice for them) I can just switch over without it loosing the config, but I'm still not seeing it in CA, so I'm hoping you aren't expecting it to be showing up again yet.

  • johner changed the title to [Plugin] [Support] Unraid ZRAM Plugin (Compressed RAM) Now with ssd/hdd swap combined

Hey ,after the latest update something broke regarding removing and creating zram swap.

So i had one running before the update. Then updated and wanted to re-create the swap file to use the higher swappiness (as far as i could read in the changelog, this is only applied to new zram´s?). I removed the existing zram, which looked to be ok, then the page had to be reloaded, but after reload it still showed the "remove" button. After doing that for a another 3-4 times, it finally reloaded and showed the "create" button instead of "remove", but when i clicked create, the log showed that it couldnt create it, because the file already exists. I tried thisn a few times over an over, always getting the same problems with removing and re-creating and finally gave up. Then randomaly i looked on the dashboard card and saw, that the zram appears to be created correctly with the correct 150 swappiness.

I am not able to set the Auto Size to 75% nor make the size customizable. It always creates 16G.

Edit: NVM figured it out -> You have to save settings first.

Edited by seamon

  • Author

Hey both, I’m away for 4days, it sounds like you’re both up and running. I’ll take a look to see if there are any race conditions etc.

I’ll change it to auto save too, will be a better experience by the sounds!

@johner When you get back, is it possible to have:

  1. Custom Swappiness for the Tier 2 (Max Value Clamped to Tier 1 Swappiness).

  2. How much data is in Tier 1 vs how much data is in Tier 2.

Also what is priority? It's set to 100 for Tier 1 and 10 to Tier 2. How does that differ from Swappiness? Can we customize that as well?

Edited by seamon

There seems to be a bug with Tier 2. Upon a restart, Tier 2 is skipped initially

[WARN] Disk swap mount (/mnt/swap) not available yet. Skipping Tier 2.

You have to go to ZRAM Settings and click Apply & Save to enable it.

  • Author

Ok I fixed the other issues, I’ll take a look at fixing this one and make the values more configurable. I think swappiness is system wide, but will double check.

@johner Another Issue. I have a use case where I just want to use Tier 2 and not Tier 1. In this scenario, it seems to be working but Dashboard is useless and doesn't show anything.

  • Author
On 5/5/2026 at 5:49 AM, seamon said:

@johner Another Issue. I have a use case where I just want to use Tier 2 and not Tier 1. In this scenario, it seems to be working but Dashboard is useless and doesn't show anything.

how weird I was thinking about this today! Let me get the release out, then I'll circle back to this one.

  • Author

ok new version up, with all fixes/changes. Let me know how you go!

I was also able to include this request:

On 5/5/2026 at 5:49 AM, seamon said:

@johner Another Issue. I have a use case where I just want to use Tier 2 and not Tier 1. In this scenario, it seems to be working but Dashboard is useless and doesn't show anything.

  • johner changed the title to [Plugin] [Support] Unraid ZRAM Plugin (Compressed RAM) with disk swap
  • 3 weeks later...

Great plugin, testing it out on my limited ram Beelink nas.

@johner One question, is there a particular reason the logo is with a white background? Is looks off in the dashboard comparing to all other icons.

  • Author

Thanks Ricardo777, to be honest, because i'm not very good with paint! I think I created that one with gemini originally and AI can't create transparent backgrounds. If you have time and want to tweak it or send another, I'd be happy to consider replacing it? Else, I'll probably have a play when i get a spare hour (which isn't looking likely for a while, I have a 3rd plugin in the creation!)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.