@@ -18,19 +18,35 @@ swap_mode=auto
1818
1919################################################################################
2020# Zswap Settings (used in zswap+swapfc mode)
21+ # This space is used for uncompressed memory. Since we have around a 3x compression ratio,
22+ # a system with 8 GB of RAM and 45% compressed memory usage can reach roughly 10.8 GB of
23+ # swap in RAM.
24+ #
25+ # However, keep in mind that 3.6 GB of RAM is no longer actually being used as regular RAM,
26+ # but rather as compressed cache. In practice, this is equivalent to around 15.2 GB total
27+ # (4.4 GB of RAM + 10.8 GB of swap compressed in RAM).
28+ #
29+ # 45% is a high value, but the kernel automatically manages when it is better to move swap
30+ # to storage, freeing up RAM, or when it is better to simply deallocate this memory.
31+ #
32+ # In addition, the system can automatically create swap files, allowing it to manage when
33+ # to move swap to storage. This makes it possible to use a few more gigabytes of swap when needed.
2134################################################################################
2235
2336zswap_compressor=zstd # Compression algo: zstd, lz4, lzo
24- zswap_max_pool_percent=60 # Max RAM for compressed pool
37+ zswap_max_pool_percent=45 # Max RAM for compressed pool
2538zswap_zpool=zsmalloc # Allocator
2639zswap_shrinker_enabled=1 # Proactively move cold pages to disk
2740zswap_accept_threshold=90 # Restart accepting pages when pool drops to X%
2841
2942################################################################################
3043# Zram Settings (used in zram modes)
44+ # Unlike zswap, with zram the reserved space corresponds to the virtual size of the
45+ # swap being created, not to a usage limit based on a percentage of physical memory.
46+ # Therefore, 90% in zram does not represent a higher virtual swap value than 45% in zswap.
3147################################################################################
3248
33- zram_size=80 % # Size of zram device (e.g., 50%, 1G)
49+ zram_size=90 % # Size of zram device (e.g., 50%, 1G)
3450zram_alg=zstd # Compression algo
3551zram_prio=32767 # Priority (highest)
3652
@@ -46,28 +62,25 @@ zram_writeback_threshold=50 # Trigger when zram is X% full
4662################################################################################
4763
4864# Progressive Scaling: Start small, grow as needed
49- # e.g. 256M -> 256M -> 512M -> 512M... doubles every 4 files
5065swapfc_enabled=1 # Enable swap files
5166swapfc_path=/swapfc/swapfile # Directory and filename prefix
52- swapfc_chunk_size=256M # Base size
53- swapfc_max_chunk_size=32G # Max single file size
54- swapfc_max_count=28 # Max number of files
67+ swapfc_chunk_size=512M # Base size
68+ swapfc_max_chunk_size=64G # Max single file size ( Theoretically be up to 16 TB or more )
69+ swapfc_max_count=32 # Max number of files ( Kernel limit is 32 )
5570swapfc_scaling_step=4 # Double size every X files
71+ # Doubles every 4 files e.g. 512M -> 512M -> 512M -> 512M -> 1024M -> 1024M...
5672
5773# Triggers
5874swapfc_free_ram_perc=35 # Create swap when free RAM < X%
5975swapfc_free_swap_perc=25 # Create more when free swap < X%
6076swapfc_remove_free_swap_perc=55 # Remove files when free swap > X%
6177
62- ################################################################################
63- # Advanced / Experimental
64- ################################################################################
65-
6678# MGLRU Anti-Thrashing (Kernel 6.1+)
6779# Protect working set for X ms. 0 to disable.
6880mglru_min_ttl_ms=1000
6981
7082# Sparse Files
7183# Create files that only use disk space when actually written to.
72- # Highly recommended for Zswap mode.
73- # swapfc_use_sparse_disable=1 # Uncomment to disable (pre-allocate all space)
84+ # With pre-allocated space there should be a performance gain, however
85+ # more storage space will be reserved for swap, so the performance gain may not be noticeable.
86+ # swapfc_use_sparse_disable=1 # Uncomment to pre-allocate all space
0 commit comments