Giter Site home page Giter Site logo

zram-service's Introduction

ZRAM service

this is a simple init script compatible with sysvinit to set up zram.

this script depends on a posix shell interpreter, core utilities and zramctl

why ?

looked at other services and scripts for using zram and they were a mess to be honest

usage

the makefile should put the script in /etc/init.d/zram by default, after that a simple sudo update-rc.d zram defaults should be enough to activate it for the next boot

the service script supports the start, stop, restart and status actions along the init, end, stat and force-restart aliases.

TODO

  • make a release
  • add debian packaging "paperwork"
  • perhaps add an action in the makefile to create a .deb

zram-service's People

Contributors

eylles avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

otakuzu corpsouth

zram-service's Issues

Robin Twiggs

Hi There,

Thanks for sharing this code, which I have found to be accurate and useful.

I've made a small modification to zram.sh which you may find useful.

After 'PRIORITY=100':
MEM_LIMIT_PERCENTAGE=0

Before 'echo "zram device initiated"':
if [ ${MEM_LIMIT_PERCENTAGE} -gt 0 ]; then
MEM_LIMIT_SIZE=$(( MEMORY_TOTAL * MEM_LIMIT_PERCENTAGE / 100));
echo "${MEM_LIMIT_SIZE}" > /sys/block/zram0/mem_limit
fi;

This allowed me to set MEM_LIMIT_PERCENTAGE=20 and RAM_PERCENTAGE=60 in /etc/default/zram-config
when I'm expecting a compression ratio of 3,
so that I can be confident my MEM_LIMIT_PERCENTAGE will not be exceeded under any conditions.

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.