Use zswap instead of swap in zram (#2420)
* Use zswap instead of swap in zram This requires a swap file which will get generated automatically on startup. * Fix file size and free disk space comparison * Set zswap factor to 33% * Set vm.swappiness to 1 Decrease swapping to a minimum. This is also recommended for database work loads by the MariaDB documentation. In practice it causes the least amount of writes to disk when under memory pressure, while still making swap available when needed.
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
[Unit]
|
||||
Description=HassOS ZRAM swap
|
||||
Requires=zram-swap.service
|
||||
After=zram-swap.service
|
||||
|
||||
[Swap]
|
||||
What=/dev/zram0
|
||||
|
||||
[Install]
|
||||
WantedBy=swap.target
|
||||
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=HAOS swap
|
||||
DefaultDependencies=no
|
||||
Requires=mnt-data.mount
|
||||
After=mnt-data.mount systemd-growfs@mnt-data.service
|
||||
Before=mnt-data-swapfile.swap
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/libexec/haos-swapfile
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=HAOS swap file
|
||||
|
||||
[Swap]
|
||||
What=/mnt/data/swapfile
|
||||
|
||||
[Install]
|
||||
WantedBy=swap.target
|
||||
@@ -1,15 +0,0 @@
|
||||
[Unit]
|
||||
Description=HassOS ZRAM swap
|
||||
DefaultDependencies=no
|
||||
Before=dev-zram0.swap
|
||||
RefuseManualStart=true
|
||||
RefuseManualStop=true
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/libexec/hassos-zram -t swap
|
||||
RemainAfterExit=true
|
||||
StandardOutput=null
|
||||
|
||||
[Install]
|
||||
WantedBy=hassos-zram.target
|
||||
Reference in New Issue
Block a user