Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

script and service to create compressed zram swaps

License

NotificationsYou must be signed in to change notification settings

mrdotx/zram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Prior to kernel 3.15, each zram device contains it's own compression buffer, memory pools and other metadata as well as per-device locks. This can become a serious bottleneck for multi-core machines. To work around this problem, zram is capable of initializing multiple devices.For this reason, the recommended amount of devices for swap is 1 per cpu core for kernels prior to 3.15.Gentoo Wiki

comparison of compression algorithms

LinuxReviews

algorithmtimedatacompressedtotalratiopercent
lzo4.571s1.1G387.8M409.8M2.6863
lzo-rle4.471s1.1G388.0M410.0M2.6863
lz44.467s1.1G403.4M426.4M2.5762
lz4hc14.584s1.1G362.8M383.2M2.8766
84222.574s1.1G538.6M570.5M1.9248
[zstd]7.897s1.1G285.3M298.8M3.6873

[default algorithm]

The size of the zram device controls the maximum uncompressed amount of data it can store, not the maximum compressed size. The zram size can be equal to or even greater than the systems physical RAM capacity, as long as the compressed size on physical RAM will not exceed the systems physical RAM capacity (e.g. theoretically 368% for zstd). To avoid problems with complete physical RAM allocation and to take into account the degree of compression, the percentage values in the table are fictitious calculations as a proven method (e.g. 100-(100/3.68)=72,8261 for zstd).ArchWiki

create compressed zram swaps

install zram.service

  • cp zram.service /etc/systemd/system/zram.service
  • adjust the paths for execstart/-stop

enable zram.service

  • systemctl enable zram.service --now

check zram swaps

  • systemctl status zram.service
  • zramctl --output-all
  • swapon --show

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp