Skip to main content

zRAM for your IoT Single Board Computer running Linux

Linux zRAM configuration
zRam is a code inside kernel, that once activated, creates a RAM based block device which acts as a swap disk, but is compressed and stored in memory, allowing very fast I/O and increasing the amount of memory available before the system starts swapping to disk.
zRam is integrated into the Linux kernel 3.2 and above, so it's included already in Ubuntu 12.04.
Previously on my 2GB machine, without zRAM, when i open lots of browser tabs, the system start choking, while HDD start copying data to SWAP causing a total slowdown. Now after activating zRam, instead of freezing after running out of RAM, the system worked like nothing happened. I didn't notice any difference at all. It looked just like adding more RAM ;)
From my experience, zRam is useful for people using computers with 1GB or 2GB RAM. Since zRam is compressing data, it require some processor resources. Not much, but always. For that reason i do not recommend to use it with old processors. Also if you have 4GB RAM most likely it won't be necessary to use it.
To activate it, type in terminal:
sudo apt-get install zram-config
To remove [type the following]:
sudo dpkg --purge zramswap-enabler
sudo dpkg --purge zram-config

To verify the service daemon [type the following]:
cat /proc/swaps

there should be some /dev/XXX entry on the zRAM service.


Filename                                Type            Size    Used    Priority
/dev/zram0                              partition       336928  172     5
If you have issues installing zRAM on ubuntu, 

invoke-rc.d: initscript zram-config, action "start" failed.
dpkg: error processing package zram-config (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
 zram-config
E: Sub-process /usr/bin/dpkg returned an error code (1)
type the following before re-installing zRAM:
sudo apt-get install linux-image-extra-$(uname -r)
sudo apt-get install zram-config

Comments

Popular posts from this blog

Library for performing speech recognition, online and offline

This github project has a very detail description on some of the most popular speech recognition engines with installation steps and how-tos. Speech recognition engine/API support: CMU Sphinx  (works offline) Google Speech Recognition Google Cloud Speech API Wit.ai Microsoft Bing Voice Recognition Houndify API IBM Speech to Text Snowboy Hotword Detection (works offline) https://github.com/Uberi/speech_recognition

The most effective SEO tools for your website

Look no further, I have gathered a list of Search-Engine-Optimization (SEO) tools for anyone to maintain and monitoring your website traffic and performance. A very good list of SEO tools can be found in this SEO checker article https://smallseotools.com/website-seo-score-checker/ For a simple quick status check on your website, this SEO tool  will give you the insight information about your website. https://smallseotools.com/website-seo-score-checker/ Also, for performance checking, you should always enable gzip compression on your web server. To check if your web server is gzip enabled, CheckGZIPCompression tool is a great tool. Is your web site optimized for Chat APPs and social networks ? Most likely NOT ! RichLinkPreview is an awesome tool to validate your web site for Chat APPs and social networks.