-
Notifications
You must be signed in to change notification settings - Fork 53
/
ztab
53 lines (50 loc) · 2.55 KB
/
ztab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Use '#' to comment out any line, add new drives with the first column
# providing the drive type and then drive details separated by tab characters.
#
# All algorithms in /proc/crypto are supported but only lzo-rle, lzo, lz4, and
# zstd have zramctl text strings; lzo-rle is the fastest with zstd having much
# better text compression.
#
# mem_limit is the compressed memory limit and will set a hard memory limit for
# the system admin. Set to 0 to disable the mem_limit.
#
# disk_size is the maximum size of the uncompressed memory. It should be set to
# roughly 150% of mem_limit depending on the algorithm and how compressible the
# input files are. Don't make it much higher than the compression algorithm
# (and the additional zram overhead) is capable of because there is a ~0.1%
# memory overhead when empty.
#
# swap_priority will set zram over alternative swap devices.
#
# page-cluster 0 means tuning to singular pages rather than the default 3 which
# caches 8 for HDD tuning, which can lower latency.
#
# swappiness 150 because the improved performance of zram allows more usage
# without any adverse affects from the default of 60. It can be raised up to 200
# which will improve performance in high memory pressure situations.
#
# target_dir is the directory you wish to hold in zram, and the original will be
# moved to a bind mount 'bind_dir' and is synchronized on start, stop, and write
# commands.
#
# bind_dir is the directory where the original directory will be mounted for
# sync purposes. Usually in '/opt' or '/var', name optional.
#
# oldlog_dir will enable log-rotation to an off device directory while retaining
# only live logs in zram. Usually in '/opt' or '/var', name optional.
#
# If you need multiple zram swaps or zram directories, just create another entry
# in this file. To do this simply add the new entries to this file, if you need
# to edit an active zram device you must stop zram with
# 'sudo systemctl stop zram-config.service' on Debian or
# 'sudo rc-service zram-config stop' on Alpine and then edit any entries you
# need to. Once finished, start zram using
# 'sudo systemctl start zram-config.service' or
# 'sudo rc-service zram-config start' which will only add the new entries if
# zram is already running.
# swap alg mem_limit disk_size swap_priority page-cluster swappiness
swap lzo-rle 250M 750M 75 0 150
# dir alg mem_limit disk_size target_dir bind_dir
#dir lzo-rle 50M 150M /home/pi /opt/zram/pi.bind
# log alg mem_limit disk_size target_dir bind_dir oldlog_dir
log lzo-rle 50M 150M /var/log /opt/zram/log.bind /opt/zram/oldlog