Submit Search
Upload
Zram
•
Download as TXT, PDF
•
0 likes
•
299 views
Nur Budiyanto
Follow
compress ram in debian and ubuntu
Read less
Read more
Technology
Report
Share
Report
Share
1 of 2
Download now
Recommended
Memory Management in WordPress
Memory Management in WordPress
Konstantin Kovshenin
Perl dancer
Perl dancer
Marian Marinov
NUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline Tutorial
Gagah Arifianto
Linux Command Line
Linux Command Line
Prima Yogi Loviniltra
puppet @techlifecookpad
puppet @techlifecookpad
Naoya Nakazawa
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppet
lutter
Basic Command
Basic Command
Sira Nokyoongtong
Dbbarang
Dbbarang
Dianovritzky Emir
Recommended
Memory Management in WordPress
Memory Management in WordPress
Konstantin Kovshenin
Perl dancer
Perl dancer
Marian Marinov
NUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline Tutorial
Gagah Arifianto
Linux Command Line
Linux Command Line
Prima Yogi Loviniltra
puppet @techlifecookpad
puppet @techlifecookpad
Naoya Nakazawa
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppet
lutter
Basic Command
Basic Command
Sira Nokyoongtong
Dbbarang
Dbbarang
Dianovritzky Emir
Magical WordPress Development with Vagrant
Magical WordPress Development with Vagrant
Chris Olbekson
A journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service management
Lubomir Rintel
Advanced Shell Scripting
Advanced Shell Scripting
Alessandro Manfredi
garry pal ing
garry pal ing
Carlos Alejandro Agüera León
Comets notes
Comets notes
Ilija Dukovski
4412 SDRAM
4412 SDRAM
philippe_nuaa
Configuration Management with Cfengine
Configuration Management with Cfengine
Steven Kreuzer
Linux basic3
Linux basic3
Hideo Amezawa
Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101
jelrikvh
Hubot: a look inside our robot friend
Hubot: a look inside our robot friend
ajacksified
Ssh2 install
Ssh2 install
GGclub
How to simplify OSGi development using OBR - Peter Kriens
How to simplify OSGi development using OBR - Peter Kriens
mfrancis
Thin
Thin
Luigi Montanez
Como programar melhor jogando game boy
Como programar melhor jogando game boy
Gabriel Rodrigues Couto
Automazione quotidiana in php
Automazione quotidiana in php
Manuel Baldassarri
Introduction to ansible
Introduction to ansible
Javier Arturo Rodríguez
Go初心者がGoでコマンドラインツールの作成に挑戦した話
Go初心者がGoでコマンドラインツールの作成に挑戦した話
dcubeio
(WHAT) To Do or Not To Do: Staying Up To Date with PHP Versions
(WHAT) To Do or Not To Do: Staying Up To Date with PHP Versions
Abu Ashraf Masnun
Ruby 1.9
Ruby 1.9
guestaef7ea
Ansible ハンズオン on AWS - DevelopersIO 2017
Ansible ハンズオン on AWS - DevelopersIO 2017
Shuji Watanabe
Samba 4 - debian instalacao
Samba 4 - debian instalacao
Eduardo Charquero
Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本
Lingfei Kong
More Related Content
What's hot
Magical WordPress Development with Vagrant
Magical WordPress Development with Vagrant
Chris Olbekson
A journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service management
Lubomir Rintel
Advanced Shell Scripting
Advanced Shell Scripting
Alessandro Manfredi
garry pal ing
garry pal ing
Carlos Alejandro Agüera León
Comets notes
Comets notes
Ilija Dukovski
4412 SDRAM
4412 SDRAM
philippe_nuaa
Configuration Management with Cfengine
Configuration Management with Cfengine
Steven Kreuzer
Linux basic3
Linux basic3
Hideo Amezawa
Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101
jelrikvh
Hubot: a look inside our robot friend
Hubot: a look inside our robot friend
ajacksified
Ssh2 install
Ssh2 install
GGclub
How to simplify OSGi development using OBR - Peter Kriens
How to simplify OSGi development using OBR - Peter Kriens
mfrancis
Thin
Thin
Luigi Montanez
Como programar melhor jogando game boy
Como programar melhor jogando game boy
Gabriel Rodrigues Couto
Automazione quotidiana in php
Automazione quotidiana in php
Manuel Baldassarri
Introduction to ansible
Introduction to ansible
Javier Arturo Rodríguez
Go初心者がGoでコマンドラインツールの作成に挑戦した話
Go初心者がGoでコマンドラインツールの作成に挑戦した話
dcubeio
(WHAT) To Do or Not To Do: Staying Up To Date with PHP Versions
(WHAT) To Do or Not To Do: Staying Up To Date with PHP Versions
Abu Ashraf Masnun
Ruby 1.9
Ruby 1.9
guestaef7ea
Ansible ハンズオン on AWS - DevelopersIO 2017
Ansible ハンズオン on AWS - DevelopersIO 2017
Shuji Watanabe
What's hot
(20)
Magical WordPress Development with Vagrant
Magical WordPress Development with Vagrant
A journey through the years of UNIX and Linux service management
A journey through the years of UNIX and Linux service management
Advanced Shell Scripting
Advanced Shell Scripting
garry pal ing
garry pal ing
Comets notes
Comets notes
4412 SDRAM
4412 SDRAM
Configuration Management with Cfengine
Configuration Management with Cfengine
Linux basic3
Linux basic3
Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101
Hubot: a look inside our robot friend
Hubot: a look inside our robot friend
Ssh2 install
Ssh2 install
How to simplify OSGi development using OBR - Peter Kriens
How to simplify OSGi development using OBR - Peter Kriens
Thin
Thin
Como programar melhor jogando game boy
Como programar melhor jogando game boy
Automazione quotidiana in php
Automazione quotidiana in php
Introduction to ansible
Introduction to ansible
Go初心者がGoでコマンドラインツールの作成に挑戦した話
Go初心者がGoでコマンドラインツールの作成に挑戦した話
(WHAT) To Do or Not To Do: Staying Up To Date with PHP Versions
(WHAT) To Do or Not To Do: Staying Up To Date with PHP Versions
Ruby 1.9
Ruby 1.9
Ansible ハンズオン on AWS - DevelopersIO 2017
Ansible ハンズオン on AWS - DevelopersIO 2017
Similar to Zram
Samba 4 - debian instalacao
Samba 4 - debian instalacao
Eduardo Charquero
Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本
Lingfei Kong
How to mount and unmount filesystem
How to mount and unmount filesystem
COMSATS
Solaris_quickref.pdf
Solaris_quickref.pdf
RobertoBravo58
EC2
EC2
Igor Kapkov
Configuration Surgery with Augeas
Configuration Surgery with Augeas
Puppet
Augeas @RMLL 2012
Augeas @RMLL 2012
Raphaël PINSON
Dev ops
Dev ops
Tom Hall
Really useful linux commands
Really useful linux commands
Michael J Geiser
php drupal mysql MAMP
php drupal mysql MAMP
Jing Cheng
Stacki - The1600+ Server Journey
Stacki - The1600+ Server Journey
Salesforce Engineering
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackIQ
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
Omar Reygaert
Augeas
Augeas
lutter
Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...
Henning Sprang
Vagrant for real
Vagrant for real
Michele Orselli
Introduction to JumpStart
Introduction to JumpStart
Scott McDermott
Vyg monitor
Vyg monitor
Anar Godjaev
ASM
ASM
Anar Godjaev
Vagrant for real
Vagrant for real
Codemotion
Similar to Zram
(20)
Samba 4 - debian instalacao
Samba 4 - debian instalacao
Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本
How to mount and unmount filesystem
How to mount and unmount filesystem
Solaris_quickref.pdf
Solaris_quickref.pdf
EC2
EC2
Configuration Surgery with Augeas
Configuration Surgery with Augeas
Augeas @RMLL 2012
Augeas @RMLL 2012
Dev ops
Dev ops
Really useful linux commands
Really useful linux commands
php drupal mysql MAMP
php drupal mysql MAMP
Stacki - The1600+ Server Journey
Stacki - The1600+ Server Journey
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
Augeas
Augeas
Automatic systems installations and change management wit FAI - Talk for Netw...
Automatic systems installations and change management wit FAI - Talk for Netw...
Vagrant for real
Vagrant for real
Introduction to JumpStart
Introduction to JumpStart
Vyg monitor
Vyg monitor
ASM
ASM
Vagrant for real
Vagrant for real
Recently uploaded
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
comworks
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Delhi Call girls
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Slibray Presentation
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Puma Security, LLC
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
BookNet Canada
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
shyamraj55
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
Precisely
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
naman860154
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
Fwdays
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
Scott Keck-Warren
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Kalema Edgar
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Safe Software
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
BookNet Canada
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
ThousandEyes
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
null - The Open Security Community
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
OnBoard
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Alan Dix
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Allon Mureinik
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
Neo4j
Recently uploaded
(20)
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
How to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
Zram
1.
#!/bin/bash ### BEGIN
INIT INFO # Provides: zram # Required-Start: # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Increased Performance In Linux With zRam (Virtual Swap Compressed in RAM) # Description: Adapted from systemd scripts at https://github.com/mystilleef/FedoraZram ### END INIT INFO DEFAULTS="/etc/default/zram" # Include defaults if available [ -r "$DEFAULTS" ] && . "$DEFAULTS" # Get lsb functions . /lib/lsb/init-functions start() { # Add support of defaults file parameter - ZRAM_NDEVS if [ -z "$ZRAM_NDEVS" ] || [ "$ZRAM_NDEVS" -le "0" ]; then # get the number of CPUs num_cpus=$(grep -c processor /proc/cpuinfo) else # or just use user specified num_cpus=$ZRAM_NDEVS fi # if something goes wrong, assume we have 1 [ "$num_cpus" != 0 ] || num_cpus=1 decr_num_cpus=$((num_cpus - 1)) # find module and it's param name error_file=$(mktemp ${RC_NAME}XXXXXX) # storage for error message param_name=$(/usr/bin/env modinfo --parameters zram 2>$error_file | head -1 | cut -d: -f1) error_message=$(<$error_file) rm -f $error_file mod_found=$? # load dependency modules if [ "$mod_found" == 0 ]; then log_begin_msg "Loading zRAM kernel module" modprobe zram "$param_name=$num_cpus" log_end_msg $? else log_failure_msg "Failed to load zRAM kernel module: ${error_message}" # shit happens, yep. exit $mod_found fi # get the amount of memory in the machine mem_total_kb=$(fgrep MemTotal /proc/meminfo | grep -E --only-matching '[[:digit:]]+') mem_total=$((mem_total_kb * 1024)) # Add support of defaults file parameter - ZRAM_USE_PERCENT if [ -z "$ZRAM_USE_PERCENT" ] || [ "$ZRAM_USE_PERCENT" -le "0" ] ||
2.
[ "$ZRAM_USE_PERCENT" -gt
"100" ]; then # use 100% of ram for zRAM storage (suitable for low-ram laptops) use_percent=100 else # or just use user specified use_percent=$ZRAM_USE_PERCENT fi zsize=$((use_percent * mem_total / num_cpus / 100)) # initialize the devices for i in $(seq 0 $decr_num_cpus); do echo $zsize > /sys/block/zram$i/disksize done # get page size page_size=$(/usr/bin/env getconf PAGESIZE || /usr/bin/env getconf PAGE_SIZE) # Creating swap filesystems for i in $(seq 0 $decr_num_cpus); do msg="> Making swap on /dev/zram$i" mkswap -p $page_size /dev/zram$i 2>&1 >/dev/null [ "$?" -eq "0" ] && log_success_msg $msg || log_failure_msg $msg done # Switch the swaps on for i in $(seq 0 $decr_num_cpus); do msg=">> Activating swap on /dev/zram$i" swapon -p 100 /dev/zram$i [ "$?" -eq "0" ] && log_success_msg $msg || log_failure_msg $msg done # TODO FIXME need strict error reporting # log_end_msg 0 } stop() { # Switching off swap ASAP for zswap in $(fgrep /dev/zram /proc/swaps | cut -d' ' -f1); do swapoff $zswap done # Custom kernels can contain zram compiled-in [ -z "$(fgrep zram /proc/modules)" ] || rmmod zram } case "$1" in start) start ;; stop) stop ;; restart) stop sleep 3 start ;; *) echo "Usage: $0 {start|stop|restart}" RETVAL=1 esac
Download now