Add Zram config
This commit is contained in:
parent
be0813a982
commit
b6cae7e72f
2 changed files with 27 additions and 0 deletions
|
@ -68,3 +68,8 @@ vm.dirty_background_bytes = 134217728
|
||||||
# The kernel flusher threads will periodically wake up and write old data out to disk. This
|
# The kernel flusher threads will periodically wake up and write old data out to disk. This
|
||||||
# tunable expresses the interval between those wakeups, in 100'ths of a second (Default is 500).
|
# tunable expresses the interval between those wakeups, in 100'ths of a second (Default is 500).
|
||||||
vm.dirty_writeback_centisecs = 1500
|
vm.dirty_writeback_centisecs = 1500
|
||||||
|
|
||||||
|
# The sysctl swappiness parameter determines the kernel's preference for pushing anonymous pages or page cache to disk in memory-starved situations.
|
||||||
|
# A low value causes the kernel to prefer freeing up open files (page cache), a high value causes the kernel to try to use swap space,
|
||||||
|
# and a value of 100 means IO cost is assumed to be equal.
|
||||||
|
vm.swappiness = 100
|
||||||
|
|
22
etc/udev/rules.d/30-zram.rules
Normal file
22
etc/udev/rules.d/30-zram.rules
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# Prefer to recompress only huge pages. This will result in additional memory
|
||||||
|
# savings, but may slightly increase CPU load due to additional compression
|
||||||
|
# overhead.
|
||||||
|
ACTION=="add", KERNEL=="zram[0-9]*", ATTR{recomp_algorithm}="algo=lz4 priority=1", \
|
||||||
|
RUN+="/sbin/sh -c echo 'type=huge' > /sys/block/%k/recompress"
|
||||||
|
|
||||||
|
TEST!="/dev/zram0", GOTO="zram_end"
|
||||||
|
|
||||||
|
# Since ZRAM stores all pages in compressed form in RAM, we should prefer
|
||||||
|
# preempting anonymous pages more than a page (file) cache. Preempting file
|
||||||
|
# pages may not be desirable because a process may want to access a file at any
|
||||||
|
# time, whereas if it is preempted, it will cause an additional read cycle from
|
||||||
|
# the disk.
|
||||||
|
SYSCTL{vm.swappiness}="150"
|
||||||
|
|
||||||
|
# Optimal value for games, so sets not too aggressive, but also not too weak
|
||||||
|
# kswapd behavior, as described there:
|
||||||
|
# https://www.reddit.com/r/linux_gaming/comments/vla9gd/comment/ie1cnrh/
|
||||||
|
SYSCTL{vm.watermark_scale_factor}="125"
|
||||||
|
SYSCTL{vm.watermark_boost_factor}="0"
|
||||||
|
|
||||||
|
LABEL="zram_end"
|
Loading…
Add table
Reference in a new issue