Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: zram, anyone have an opinion on this?

  1. #1
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631

    zram, anyone have an opinion on this?


  2. #2
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631

    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/

  3. #3
    Member Blacksimon's Avatar
    Join Date
    Oct 2011
    Location
    Italy
    Posts
    93
    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

  4. #4
    Member Blacksimon's Avatar
    Join Date
    Oct 2011
    Location
    Italy
    Posts
    93
    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 ?

  5. #5
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    @ 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.

  6. #6
    Member Blacksimon's Avatar
    Join Date
    Oct 2011
    Location
    Italy
    Posts
    93
    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

  7. #7
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631
    @ 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.

  8. #8
    Member Blacksimon's Avatar
    Join Date
    Oct 2011
    Location
    Italy
    Posts
    93
    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

  9. #9
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631

    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.

  10. #10
    Member Blacksimon's Avatar
    Join Date
    Oct 2011
    Location
    Italy
    Posts
    93

    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

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Cisco ASA5515-K9 Gigabit Ethernet Network Security/Firewall 1 Year Warranty picture

Cisco ASA5515-K9 Gigabit Ethernet Network Security/Firewall 1 Year Warranty

$90.00



Fortinet FortiGate-40C Network Security Firewall picture

Fortinet FortiGate-40C Network Security Firewall

$42.50



Cisco ASA5525-K9 ASA 5525-X Security/Firewall Appliance 1 Year Warranty picture

Cisco ASA5525-K9 ASA 5525-X Security/Firewall Appliance 1 Year Warranty

$138.00



Fortinet Fortigate FG-61E | Firewall Network Security Appliance picture

Fortinet Fortigate FG-61E | Firewall Network Security Appliance

$49.99



Fortinet FortiGate 50E Firewall picture

Fortinet FortiGate 50E Firewall

$45.00



Fortinet Fortiwifi 60D FG-60D Security Appliance Firewall / VPN w/ AC Adapter picture

Fortinet Fortiwifi 60D FG-60D Security Appliance Firewall / VPN w/ AC Adapter

$34.97



Palo Alto PA-220 Next-Gen Firewall 520-000309-00J w/ Power adapter picture

Palo Alto PA-220 Next-Gen Firewall 520-000309-00J w/ Power adapter

$69.98



FORTINET FG-500D FortiGate 500D, 10xGE RJ45 ports, 8xGE SFP slots Firewall picture

FORTINET FG-500D FortiGate 500D, 10xGE RJ45 ports, 8xGE SFP slots Firewall

$126.00



pfSense firewall 2.7.2 Release 8GB Memory - Dual NIC 1 GB - 256 GB SSD picture

pfSense firewall 2.7.2 Release 8GB Memory - Dual NIC 1 GB - 256 GB SSD

$97.77



Fortinet Fortigate FG-61E Firewall Network Security Appliance ATP Bundle 1 years picture

Fortinet Fortigate FG-61E Firewall Network Security Appliance ATP Bundle 1 years

$199.00