Giter Site home page Giter Site logo

centos7-zram's Introduction

zram for Fedora

zram compresses swap partitions into RAM for performance.

You need Linux kernel version 2.6.37.1 or better to use zram. For Fedora 16 you can just install kmod-staging from rpmfusion to get the module:

sudo yum install kmod-staging

Automated Install

First you have to setup your rpm build environment. For details see How to create an RPM package - Preparing your system.

# Short version of the howto
sudo yum install @development-tools fedora-packager
rpmdev-setuptree

# the real thing(tm)
make rpm
sudo rpm -Uhv ~/rpmbuild/RPMS/noarch/zram-*.noarch.rpm

Manual Install

There are 4 files you need to enable zram for Fedora. They are:

  • zramstart
  • zramstat
  • zramstop
  • mkzram.service

All these files can be found in the project directory.

Place "zramstart", zramstat and "zramstop" in the following directory.

/usr/sbin/

Place "mkzram.service" in the following directory.

/lib/systemd/system

Place "zram" in the following directory.

/etc/sysconfig

As root, run the following command to enable zram for Fedora.

systemctl daemon-reload

Starting

sudo systemctl enable mkzram.service
sudo systemctl start mkzram.service

Run the following command to make sure the service started properly.

sudo systemctl status mkzram.service

The output should look like this:

mkzram.service - Enable compressed swap in memory using zram
    Loaded: loaded (/usr/lib/systemd/system/mkzram.service; enabled)
    Active: active (exited) since Mon 2015-11-30 12:26:21 UTC; 2min 45s ago
    Process: 2437 ExecStart=/usr/sbin/zramstart (code=exited, status=0/SUCCESS)
    Main PID: 2437 (code=exited, status=0/SUCCESS)

To see how well your compressed swap performs run

zramstat # no sudo needed

The output looks like this:

/dev/zram0:     362.18% (180998144 -> 49973309)
/dev/zram1:     356.50% (180924416 -> 50749160)

This means 180,998,144 bytes got compressed to 49,973,309 bytes. The "swapped" memory is 362.18% of the RAM used. That's it!

Credits:

The zramstart and zramstop scripts were written by Sergey Davidoff of Elementary OS. The zramstat script and RPM packaging bits by Doncho N. Gunchev.

References:

centos7-zram's People

Contributors

gbagnoli avatar grizzlyfred avatar gunchev avatar hubbitus avatar jorti avatar mystilleef avatar otavio avatar rudd-o avatar rvasilev avatar syuu1228 avatar vlad1mir-d avatar yachi avatar zecas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.