Using ZRAM and ZSWAP together for ubuntu to boost performance

Do you running Ubuntu on your very old pc? 

I am using ubuntu on my very old pc. with 8GB memory , I3 2300 cpu and i am using ZRAM and ZSWAP together.


here is my dmesg

➜  ~  dmesg| grep -i zswap[    0.000000] Command line: BOOT_IMAGE=/@/boot/vmlinuz-3.14.0-031400-generic root=UUID=7b86576f-3698-449b-8673-eabf6244b063 ro [email protected] zswap.enabled=1 quiet splash vt.handoff=7[    0.000000] Kernel command line: BOOT_IMAGE=/@/boot/vmlinuz-3.14.0-031400-generic root=UUID=7b86576f-3698-449b-8673-eabf6244b063 ro [email protected] zswap.enabled=1 quiet splash vt.handoff=7[    1.077158] zswap: loading zswap[    1.077161] zswap: using lzo compressor➜  ~  dmesg| grep -i zram [   18.402744] zram: Created 4 device(s) ...[   18.744560] Adding 986784k swap on /dev/zram0.  Priority:5 extents:1 across:986784k SSFS[   18.746999] Adding 986784k swap on /dev/zram1.  Priority:5 extents:1 across:986784k SSFS[   18.749486] Adding 986784k swap on /dev/zram2.  Priority:5 extents:1 across:986784k SSFS[   18.751947] Adding 986784k swap on /dev/zram3.  Priority:5 extents:1 across:986784k SSFS
How to enable them?


1. enable zram 

you need the latest kernel, i suggest you install ubuntu 14.04 and install linux kernel 3.14 or newer.

https://wiki.ubuntu.com/Kernel/MainlineBuilds

http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D

you can install zram-config to auto configure zram for you.


2. enable zswap

you need to edit /etc/default/grub

edit line to 

GRUB_CMDLINE_LINUX=\"zswap.enabled=1\"


see it ? zswap.enabled=1 

and run update-grub

to generate boot configure for grub

after done all of these, reboot your system, happy time.

分类: 默认 标签: 发布于: 2014, 点击数: