-
Senior Member
registered user
zram, anyone have an opinion on this?
-
Senior Member
registered user
Anyone?
.
Compressed swap in RAM, zram is an experimental linux innovation that
provides swap performance improvement in systems that might otherwise
swap to other media, such as hard drives or SDDs, for examples: older
computers, netbooks or any computer 'low on ram' considering the random
access memory demands of all its program(s) being used concurrently.
The following sites may be of some help in understanding zram as used
by several linux distributions. Warning, these may not be self-consistent:
http://www.webupd8.org/2011/10/incre...inux-with.html
http://mystilleef.blogspot.com/2011/...in-fedora.html
http://oprod.net/index.php/news/1-news/92-compress-ram-with-zram-in-slackware\
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=648249
http://weirdfellow.wordpress.com/201...ram-with-zram/
-
Member
Hi utu,
instead of swap disk, it uses a part of phisical RAM like swap file. It's right ?
I think you need to have more 1GB of RAM to really increase performance with zRAM
-
Member
I read more about zram.
usually if you use swap, you have already a low ram system
there is no doubt that swap in RAM is faster then HDD, but with zram you make less memory available to applications
and finally how is the compressing memory on the fly using zram ?
The ramdisk in knoppix is not the same concept of zram ?
-
Senior Member
registered user
@ Blacksimon
In Knoppix 6.7.1, I note that a device has been defined,
that is /dev/zram0. I can find no other references to zram
in 6.7.1.
zram is a block device, and a lot of linux activity outside of
Knoppix as I have noted in post #2 concerns zram.
I was hoping this forum might have some interest or activity
on this subject.
I can see how this might help the netbook situation.
I can't yet grasp how this might help virtual systems.
I expect if one has a lot of ram and doesn't have lots of
high-powered apps going simultaneously that zram doesn't have
much to offer. Although it might be a nice feature to assure
that one almost never would crash because of running too
low on ram. If there's no significant overhead for this.
-
Member
Hi Utu,
yes in knoppix 6.7.1 /dev/zram0 is defined but not inizialized, i think.
take a look at the value = 0 in file called disksize in /sys/devices/virtual/block/zram0
and then at the file Kconfig in /usr/src/linux-headers-3.0.4/drivers/staging/zram
and even at Kconfig in /usr/src/linux-headers-3.0.4/drivers/staging
i read again the user's comment in http://www.webupd8.org/2011/10/incre...inux-with.html
I tried in terminal:
Code:
root@Black:~# modprobe zram disksize=524288 #probably do not need ad i've to modify directly file called disksize
root@Black:~# mkswap /dev/zram0
mkswap: error: swap area needs to be at least 40 KiB
Usage: mkswap [-c] [-pPAGESZ] [-L label] [-U UUID] /dev/name [blocks]
root@Black:~# swapon -p 100 /dev/zram0
swapon: /dev/zram0: read swap header failed: Argomento non valido
root@Black:~#
but nothing. Sure i'm wrong
and like you say it might be a nice feature for net-book with only 1GB Ram and low power CPU
for now I optimize knoppix moving the browser cache, log, tmp and spool in tmpfs
http://www.fewt.com/2010/07/move-you...es-to-ram.html
bye
-
Senior Member
registered user
@ Blacksimon
My experience has been chiefly with a LiveUSB built from
the CD-size Knoppix 6.7.1, and had seen only the /dev/zram0 there,
no src files. I expect you found these in a DVD version.
Still, you mention no documentation on how to use this material.
I've never used swap with Knoppix since I switched to LiveUSB.
My portable has 4 Gb of ram, and the most complicated apps I use
are IceWeasel, LibreOffice and Synaptic.
My expectations are
1. Finished products for driver and configuration in a CD-size
Knoppix seem useful for 512k-ram-or-less situations.
2. For such ram-limited computers, compiling the finished products
seems like a Catch22 situation: you'd need them to do their compilation;
3. I'd really like a roadmap on how to do an implementation, given
the infrastructure that's apparently provided in a DVD distribution; and
4. I would favor a hidden, standard implementation that's there to
provide 'more ram' in situations one doesn't anticipate but may
run into sometime. Standard, not an option, just there, part of the
infrastructure of a robust OS.
I think we are probably only bringing the Unix swap idea into the
current era of relative i/o device speeds & clever and fast algorithms
to compact and restore large blocks of data, and realizing how we might
better utilize what we have.
Hoping also to hear from the 'virtual' crowd to see if this offers
them anything useful.
-
Member
Hi Utu,
yes I use LiveUSB DVD version and I've not found any further documentation about how to use it.
I've never used swap too and even with only 1gb of ram on my netbook, knoppix 6.7.1 works well, only when I work with high-resolution photos in Gimp I see some slowdown.
For everything else, I fully agree with you.
while waiting for suggestions from the community there is to read this article: http://www.thegeekstuff.com/2008/11/...mpfs-on-linux/
I do not know if there is a difference between zram, tmpfs and ramfs
-
Senior Member
registered user
zram and 7.0.1
.
From a usually reliable source in Germany, I received the following
response in regard to where I might find some roadmap to using zram in Knoppix:
The delay between your question and my answer means that I did a lot of
updates, zram ist working now,
A good description on how to test zram can be found at:
http://www.webupd8.org/2011/10/incre...inux-with.html
and an overview at Wikipedia at
http://en.wikipedia.org/wiki/ZRam
Knoppix 7.0.1 will use 75% of the available RAM, but at maximum 4GB, for
compressed swapspace in ram. In the best case, you can double or triple
your "virtual working RAM" with zram without swapping to disk. In the
worst case, you lose a few header bytes due to incompressible data, or
get "out of memory" kills (like before, without zram) when even
compressed swap runs out of space.
75% seems to be a decent number for me. I don't trust a "fully
compressed" RAM like recommended in the URL given above, since you
always need some extra MB as immediately available "emergency RAM"
without having to negotiate with the swap area. In my tests, I got
strange effects when using 100% of the available Ram as zram space, like
ramdisks suddenly being "full" with no data inside.
-
Member
Activating Zram...
Hi utu,
finally I find the way...
Code:
modprobe zram #I do not think is necessary if your system has / dev/zram0
echo $((100*1024*1204)) > /sys/block/zram0/disksize #Allocate 100MB to zram. (Check if the file disksize is present in CD version)
mkswap /dev/zram0 #create swap in Ram
swapon -p 100 /dev/zram0 #activate swap. You can specify the priority of the swap device
Code:
root@Black:~# free
total used free shared buffers cached
Mem: 1018724 943440 75284 0 58860 599440
-/+ buffers/cache: 285140 733584
Swap: 102396 0 102396
Now it's time to test performance...
Best Regards
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
For Lenovo IdeaPad 3 15IIL05 15IML05 15ADA05 15ARE05 Palmrest Keyboard Touchpad
$59.25
NEW Palmrest Keyboard For Lenovo Thinkpad E15 Gen 2 20T8 20T9 Black 5M10W64513
$80.99
Genuine Lenovo IdeaPad 5-15IIL05 5-15ITL05 palmrest BL keyboard 5CB0Z31242
$118.90
Lenovo IP 5 16IAU7 16" 2.5K Chromebook i3-1215U 8GB Ram 128GB eMMC Chrome OS
$219.99
Lenovo 500w Gen 3 Laptop, 11.6" IPS Glass, N6000, 8GB, 128GB SSD, Win 11 Home
$186.99
Lenovo Ideapad 1i 15.6" FHD Notebook Intel Core i5-1235U 8GB RAM 256GB SSD
$349.99
Lenovo ThinkPad Yoga 11e 11.6" 2in1 Touch Intel Core i3 4GB RAM 128GB SSD Win10
$59.00
Lenovo 11.6" Laptop PC Computer Intel 4GB RAM 64GB SSD HDMI WIFI Windows 10
$89.99
Lenovo K14 AMD Laptop, 14" FHD IPS LED , Ryzen 5 5600U, GB, 256GB SSD
$569.00
Lenovo Flex 7 14IRU8 14" 2.2K Touch Intel Core i7-1355U 16GB 1TB SSD W11H
$549.99