Have your hy­brid swap and eat it too…

Linux Format - - TUTORIAL SWAP FILE -

Sys­temd-swap is a tool that man­ages how you use zswap or zram. zswap com­presses data that ap­pli­ca­tions don’t use and places it into a cache. The ker­nel then moves the data to the hard disk, and in most cases this speeds up the swap op­er­a­tion.

The sys­temd-swap util­ity can be used to cre­ate zram in­stead, which cre­ates a vir­tual disk in the com­puter’s mem­ory, to min­imise the num­ber of swap op­er­a­tions. Both meth­ods re­quire mem­ory space and so when zswap uses less mem­ory, zram will make use of that mem­ory to stop the swap process from oc­cur­ring. Es­sen­tially, you need to choose one of the two ap­proaches.

To install the tool, go to https://github.com/ Ne­fe­lim4ag/sys­temd-swap and find the git ad­dress and down­load: $git clone https://github.com/Ne­fe­lim4ag/ sys­temd-swap.git Even though sys­temd-swap is out­side of the stan­dard dis­tri­bu­tion pack­ages, the soft­ware is well writ­ten. You have the op­tion to install with the make com­mand or cre­ate a pack­age file for Arch or De­bian. The De­bian pack­age works on Ubuntu, too.

As soon as you’ve in­stalled sys­temd-swap, you can con­fig­ure it to use your choice of zram or zswap. The pack­age in­stalls the con­fig­u­ra­tion files. In /etc/sys­temd/swap.conf, set zram_ en­abled or zswap_en­abled depend­ing on your needs. Use sys­temd to ac­ti­vate it: $ sys­tem­ctl start sys­temd-swap.ser­vice

Newspapers in English

Newspapers from Australia

© PressReader. All rights reserved.