forked from thypon/runit-swap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swap.conf
65 lines (56 loc) · 2.05 KB
/
swap.conf
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
54
55
56
57
58
59
60
61
62
63
64
65
################################################################################
# Defaults are optimized for general usage
################################################################################
################################################################################
# Zswap
#
# Kernel >= 3.11
# Zswap create compress cache between swap and memory for reduce IO
# https://www.kernel.org/doc/Documentation/vm/zswap.txt
zswap_enabled=1
zswap_compressor=lz4
zswap_max_pool_percent=25
zswap_zpool=z3fold
################################################################################
# ZRam
#
# Kernel >= 3.15
# Zram compression streams count for additional information see:
# https://www.kernel.org/doc/Documentation/blockdev/zram.txt
zram_enabled=0
# For setting the zram_size variable, make sure to append "G" for size in GB or "K" for size in kB.
zram_size=
zram_streams=$cpu_count
# zramctl (which the script uses) supports the following zram compression algorithms (for the zram_alg variable):
# - lzo
# - lz4
# - lz4hc
# - deflate
# - 842
# - zstd
zram_alg=lz4
zram_prio=32767
################################################################################
# Swap File Universal
# loop + swapfile = support any fs (also btrfs)
swapfu_enabled=0
# File is sparse and dynamically allocated.
swapfu_size=${ram_size}K # Size of swap file.
# File will not be available in fs after script start
# Make sure what script can access to this path during the boot process.
# Full path to swapfile
swapfu_path=/var/swap
swapfu_prio=-1024
################################################################################
# Swap File Chunked
# Allocate swap files dynamically
# Min swap size 256M, Max 16*256M
swapfc_enabled=0
swapfc_chunk_size=256M # Allocate size of swap chunk
swapfc_max_count=16 # 0 - unlimited
swapfc_free_swap_perc=15 # Add new chunk if free < 15%
swapfc_path=/var/.swapfc/
################################################################################
# Swap devices
# Find and auto swapon all available swap devices
swapd_auto_swapon=1