Автор: Вонючий Волк, 1 месяц назад, написана на языке Plain Text.
Встраивание на сайт
  1. ################################################################################
  2. # Defaults are optimized for general usage
  3. ################################################################################
  4.  
  5. ################################################################################
  6. # You can override any settings by files in:
  7. # /etc/systemd/swap.conf.d/*.conf
  8. ################################################################################
  9.  
  10. ################################################################################
  11. # Zswap
  12. #
  13. # Kernel >= 3.11
  14. # Zswap create compress cache between swap and memory for reduce IO
  15. # https://www.kernel.org/doc/Documentation/vm/zswap.txt
  16.  
  17. zswap_enabled=1
  18. zswap_compressor=zstd     # lzo lz4 zstd lzo-rle lz4hc
  19. zswap_max_pool_percent=25 # 1-99
  20. zswap_zpool=z3fold        # zbud z3fold (note z3fold requires kernel 4.8+)
  21.  
  22. ################################################################################
  23. # ZRam
  24. #
  25. # Kernel >= 3.15
  26. # Zram compression streams count for additional information see:
  27. # https://www.kernel.org/doc/Documentation/blockdev/zram.txt
  28.  
  29. zram_enabled=0
  30. zram_size=$(($RAM_SIZE/4))      # This is 1/4 of ram size by default.
  31. zram_count=${NCPU}              # Device count (only for kernels < 4.8)
  32. #zram_streams=${NCPU}           #$NCPU
  33. zram_alg=zstd #lz4              # See $zswap_compressor 842 - for Linux 4.8.4
  34. zram_prio=32767                 # 1 - 32767
  35.  
  36. ################################################################################
  37. # Swap File Chunked
  38. # Allocate swap files dynamically
  39. # For btrfs fallback to swapfile + loop will be used
  40. # ex. Min swap size 512M, Max 8*512M
  41. swapfc_enabled=1
  42. swapfc_force_use_loop=0          # Force usage of swapfile + loop
  43. swapfc_frequency=1               # How often to check free swap space in seconds
  44. swapfc_chunk_size=512M           # Size of swap chunk
  45. swapfc_max_count=16              # 0 - unlimited, note: 32 is a kernel maximum
  46. swapfc_min_count=0               # Minimum amount of chunks to preallocate
  47. swapfc_free_ram_perc=35          # Add first chunk if free ram < 35%
  48. swapfc_free_swap_perc=15         # Add new chunk if free swap < 15%
  49. swapfc_remove_free_swap_perc=55  # Remove chunk if free swap > 55% && chunk count > 2
  50. swapfc_priority=50               # Priority of swapfiles (decreasing by one for each swapfile).
  51. swapfc_path=/var/lib/systemd-swap/swapfc/
  52. # Only for swapfile + loop
  53. swapfc_nocow=1              # Disable CoW on swapfile
  54. swapfc_directio=1           # Use directio for loop dev
  55. swapfc_force_preallocated=0 # Will preallocate created files
  56.  
  57. ################################################################################
  58. # Swap devices
  59. # Find and auto swapon all available swap devices
  60. swapd_auto_swapon=0
  61. swapd_prio=1024
  62.  
  63.