Need help configing zram / pop os 22.04 laptop – Linux

i could use some help with zram id like to know if this is the file in which zram tweaks for pop os are

are made an if so what lines an values / setting can be changed to improve or

adjust zram function

what can these settings be adjusted by an to what effect


#!/bin/bash

test -b /dev/zram0 && exit 0

ENV_CONF=‘/etc/pop-zram’

if test -f ${ENV_CONF}; then
export $(grep -v ‘^#’ ${ENV_CONF} | xargs)
fi

test -n “${ALGO}” || ALGO=zstd

test -n “${MAX_SIZE}” || MAX_SIZE=16384

test -n “${SWAPPINESS}” || SWAPPINESS=90

test -n “${PORTION}” || PORTION=50

if ((PORTION > 200)); then
PORTION=200
elif ((PORTION < 1)); then
PORTION=1
fi

test -n “${PAGE_CLUSTERS}” || PAGE_CLUSTERS=$(test zstd = ${ALGO} && echo 0 || echo 1)

TOTAL=$(awk -v p=${PORTION} ‘/MemTotal/ {printf “%.0f”, p * $2 / 102400}’ /proc/meminfo)

SIZE=$(((TOTAL > MAX_SIZE)) && echo ${MAX_SIZE} || echo ${TOTAL})

modprobe zram num_devices=1
udevadm settle -t 1

zramctl –size “${SIZE}M” –algorithm “${ALGO}” /dev/zram0

mkswap /dev/zram0
udevadm settle -t 1

swapon -p 1000 /dev/zram0

sysctl -w “vm.page-cluster=${PAGE_CLUSTERS}” “vm.swappiness=${SWAPPINESS}”

MINIMUM=$(awk ‘/MemTotal/ {printf “%.0f”, $2 * 0.01}’ /proc/meminfo)
CURRENT=$(sysctl vm.min_free_kbytes | awk ‘{print $3}’)
if ((MINIMUM > CURRENT)); then
sysctl -w “vm.min_free_kbytes=${MINIMUM}”
fi

an were if i can do i adjust the vm.page-cluster= setting an what options
are ther an ther effects

im trying to improve the usage of my 16gb of ram which i cant upgrade anymore to my laptop

an zram seem to chew more then before

Read more here: Source link