Mastodon Politics, Power, and Science: Just added zRAM to two of my linux systems.

Sunday, September 7, 2025

Just added zRAM to two of my linux systems.

zRAM is a Linux kernel feature that creates RAM-backed block devices, compressed on-the-fly, to function as a faster alternative to traditional disk-based swap or as compressed RAM disks for temporary files like /tmp. It improves performance and extends the life of flash storage by reducing disk I/O and wear on SSD drives, making it particularly beneficial for devices with limited physical RAM or under heavy workloads. You can typically set up and manage zRAM devices using the zramctl command or distribution-specific tools and packages.  
This video explains what zRAM is and how it can improve the performance of your Linux system:


To use zRAM on Linux, first install the appropriate zRAM package for your distribution (e.g., zram-tools for Debian/Ubuntu.
 
Then, configure the settings, often by editing a configuration file like /etc/default/zramswap or /etc/systemd/zram-generator.config, to set the compression algorithm and the percentage of RAM to use. Finally, restart your system or the relevant service to apply the changes and verify with zramctl or cat /proc/swaps. 

Installation
  • For Debian/Ubuntu-based systems (like Mint, Pop!_OS, Ubuntu):
    • Open your terminal and run sudo apt update && sudo apt install zram-tools. 
  • For Arch-based systems (like Arch Linux):
    • Install the zram-generator package: sudo pacman -S zram-generator. 
Configuration
  • For Debian/Ubuntu-based systems:
    • Edit the zramswap configuration file: sudo nano /etc/default/zramswap. 
    • Uncomment and adjust ALGO (compression algorithm, e.g., lz4 or zstd) and PERCENT (percentage of RAM for zRAM, e.g., 50). 
  • Apply and Verify
  • For Debian/Ubuntu-based systems:
    • You may need to disable and re-enable the service: sudo zramswap stop and then sudo zramswap start. 
    • A system reboot is also effective: sudo reboot. 
    • Verify with zramctl to see the status of your zRAM devices. 

No comments:

Post a Comment

Progress on the campaign manager

You can see that you can build tactical maps automatically from the world map data.  You can place roads, streams, buildings. The framework ...