Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 27 May 2018, 04:26
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
XenialDog 64bit (Ubuntu 'Xenial Xerus' LTS, 64-bit)
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 22 of 27 [395 Posts]   Goto page: Previous 1, 2, 3, ..., 20, 21, 22, 23, 24, 25, 26, 27 Next
Author Message
wiak

Joined: 11 Dec 2007
Posts: 693
Location: not Bulgaria

PostPosted: Sun 21 Jan 2018, 05:24    Post subject:  

Oh, thanks dancytron, I just tried zramctl and it seems my system is actually just using lzo. Just reading the algorithm variable just said "[lzo] lz4"; I thought that meant lz4 was being used but zramctl suggests otherwise... So maybe I have to use that script you provided to fix that - but I'd rather somehow use zram-config; is there a simple way to make sure it uses lz4 that you know of?

wiak
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 693
Location: not Bulgaria

PostPosted: Sun 21 Jan 2018, 05:24    Post subject:  

Oh, thanks dancytron, I just tried zramctl and it seems my system is actually just using lzo. Just reading the algorithm variable just said "[lzo] lz4"; I thought that meant lz4 was being used but zramctl suggests otherwise... So maybe I have to use that script you provided to fix that - but I'd rather somehow use zram-config; is there a simple way to make sure it uses lz4 that you know of?

EDIT: Well that script you found seems to work anyway, but I'd still like zram-config method to work with lz4 out of the box - should surely be possible? (I don't want to also have to run the separate zram.sh script). I should study the scripts (zram.sh and also whatever is provided by zram-config, I suppose..., which may just be a matter of learning how to use that zramctl utility).

EDIT2: I tried:

Code:
swapoff -a
zramctl -r /dev/zram0
zramctl -a lz4 -s 512M /dev/ram0
swapon /dev/zram0


But got error: swapon: /dev/zram0: read swap header failed

Not sure about the 512M or alternatively just tried 512000, but still get same error message. Clearly the answer will be in that script you found that I haven't studied yet...

okay, seems I had to again modprobe zram as in the zram.sh script and insert a mkswap command as also in that script - seems to be easier to use the script thus far, but I suspect there must be a startup script used by whatever comes with zram-config that could be modded to immediately provide lz4 rather than lzo, but I don't know how as yet. Any light shined on this would be appreciated.

wiak

Last edited by wiak on Sun 21 Jan 2018, 06:22; edited 1 time in total
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1472
Location: GERMANY

PostPosted: Sun 21 Jan 2018, 06:11    Post subject:  

Hi everyone !

Let me try to explain what i observed .

Let me do it Step by Step .

Have a Swap-Partition on Harddrive .
I have installed zram-config via Synaptic .
Zram is automatically activated on Bootup.Also Swap-partition.

Installed (additionally) dancytrons Script in /usr/local/bin (made it executable )
Now my Observation .

After booting in Xenial Dog 32 Bit i disable Swap-Partition and disable(automaticallyl enabled Zram manually.
So Conky shows no Swap (zero) .

1. Enabling Zram with zram.sh start now shows 496 MiB Swap Space .
2. Disabling Zram with zram.sh stop now shows 0 MiB (Zero) Swap Space
3. Enabling Zram zram.sh start AGAIN now shows 744 MiB Swap Space ("almost" Double )

So what i mean :
BEFORE just using only zram-config installed with Synaptics ,it created a 496 Mib Swap-Space .
AFTER installing Dancytrons Script (additionally ) and executing Procedure above 1. 2. and 3.
Swap space increased to 744 MiB Swap Space .

Do not have any Idea what it means .Maybe the "NEW" Script is taking over /dominating the "OLD" one ?Who knows ?
Maybe somebody else will get a clue from that .

Regards !

Last edited by backi on Sun 21 Jan 2018, 08:12; edited 1 time in total
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1472
Location: GERMANY

PostPosted: Sun 21 Jan 2018, 07:58    Post subject:  

Hi you guys !

https://wiki.debian.org/ZRam

The script which Dancytron posted .....i use it in DEBIAN DOGS since the Beginning .
Works flawless in Debian .Did not know it could work flawless in Ubuntu .......does it really ??????

Is Debian Dog (Stretch ,Jessie ) able to use lz4 ???Seems so if .....liblz4-tool is installed .
liblz4-tool is not installed by default .l

Xenial Dog there is also no liblz4-tool installed by default.


Searching Google for Zram lz4 compression found an interesting link :
https://starbeamrainbowlabs.com/blog/article.php?article=posts%2F226-Linux-zram.html

Some Thoughts on Zram and lz4 on the MX-Linux Forum :

https://mxlinux.org/forum/viewtopic.php?f=108&t=42935


Regards !

Last edited by backi on Sun 21 Jan 2018, 09:46; edited 2 times in total
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1472
Location: GERMANY

PostPosted: Sun 21 Jan 2018, 09:09    Post subject:  

To open another Can of Worms :

Enable ZSwap to increase performance :

https://ubuntu-mate.community/t/enable-zswap-to-increase-performance/11302
https://wiki.archlinux.org/index.php/Zswap


Should a separate Topic called "Using Zram----Zswap " be created ?
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 1472
Location: GERMANY

PostPosted: Sun 21 Jan 2018, 11:02    Post subject:  

Hi you guys !

I am talking about Xenial Dog (32 bit )
After a lot of doubts I came to this conclusion :
So i did finally completely remove zram-config (formerly installed ) and its remnants :

It means :

removed :zram.config from /etc/inid
removed :zram from /etc/inid.d
removed :init-zram-swapping from /usr/bin
removed :end-zram-swapping from /usr/bin

Now was able to use your Dancytrons script without any conflicting/interfering Effects that came with zram-config formerly installed .

Doing zramctl in Terminal showed clearly lz4 is enabled when doing "zram.sh start" in Terminal .

root@xenial:~# zramctl
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lz4 743.8M 4K 64B 4K 1 [SWAP]
root@xenial:~#

Not quite sure if installing lz4-tool was necessary, which i did before .

For Debian i can not proof if lz4 is activated because command "zramctl" does not work in Debian ........maybe someone knows how to accomplish this in Debian Dog .
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 693
Location: not Bulgaria

PostPosted: Sun 21 Jan 2018, 19:45    Post subject:  

backi wrote:


Some Thoughts on Zram and lz4 on the MX-Linux Forum :

https://mxlinux.org/forum/viewtopic.php?f=108&t=42935

Regards !


Hi backi,

Coincidentally, and independently, I also came across a quick post on the mxlinux forum that suggested liblz4-tools was required so I had also yesterday installed that on my xenialdog64 system with zramconfig and rebooted. zramctl still however suggested lzo was being used rather than lz4 (the script dancytron found/provided did indeed however make zramctl indicate lz4 was being used - there is a line early on in that script which calculates the size of zram it provides). I would still like to find out how to achieve the same using zramconfig only - I read somewhere, I can't alas remember where, that it might be something to do with some other crypt software default - my quick check on that has revealed nothing so far. Also thought might be a zram config file for systemd that allows manual change from lzo to lz4 but haven't found that yet either. I'll unpack zramconfig deb package and see if I can find any clue in there if no one has 'the answer' or in the end, if can't otherwise find a zramconfig solution, also just use the zram.sh script. I'll report back of course if I find anything, which may take a while cos it is raining and my roof has been leaking so may have to work on things like that for a bit...

I also btw came across zswap alternative, but haven't looked into that yet (I think what I read said something had to be in the kernel for zswap to be used - maybe it already is - let us know if you try zswap and if it appears better in any way).

Though I'm mainly using a core II duo with 2 GB RAM, I'm also working on bringing my old Pentium M 1 GB RAM machine back to life (a Fujitsu Siemens Amilo M1424 - used to be 512MB but I upgraded it to 1GB) so will be using zram or similar with that. I also use xenialdog32 with that one (using forcepae kernel option).

cheers, wiak
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 693
Location: not Bulgaria

PostPosted: Sun 21 Jan 2018, 20:25    Post subject:  

Hi backi, dancytron,

Well I have now worked out one way how to get lz4 with zram-config. I extracted the deb and discovered:

/lib/systemd/system/zram-config.service

which contains:

Code:
[Service]
ExecStart=/usr/bin/init-zram-swapping
ExecStop=/usr/bin/end-zram-swapping
...


I thus modified the /usr/bin/init-zram-swapping bash script to contain the indicated extra line (this is all that needs done to get zram lz4):

Code:
# initialize the devices
for i in $(seq ${NRDEVICES}); do
  DEVNUMBER=$((i - 1))
  echo lz4 > /sys/block/zram${DEVNUMBER}/comp_algorithm  #wiak added
  echo $mem > /sys/block/zram${DEVNUMBER}/disksize
  mkswap /dev/zram${DEVNUMBER}
  swapon -p 5 /dev/zram${DEVNUMBER}
done


I thought all would be fine after that so, restarted that systemd service with:

Code:
systemctl restart zram-config.service


EDIT: Fixed (I had put $i instead of ${DEVNUMBER} in first attemp...

zramctl now successfully gives:

Code:
root@xenial64:~# zramctl
NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lz4         466.7M   4K   65B    4K       1 [SWAP]
/dev/zram1 lz4         466.7M   4K   65B    4K       1 [SWAP]


wiak

Last edited by wiak on Sun 21 Jan 2018, 20:34; edited 1 time in total
Back to top
View user's profile Send private message 
dancytron

Joined: 18 Jul 2012
Posts: 1042

PostPosted: Sun 21 Jan 2018, 20:33    Post subject:  

Try "{DEVNUMBER}" in place of "i"?

edit: You fixed it while I was posting.
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 693
Location: not Bulgaria

PostPosted: Sun 21 Jan 2018, 20:34    Post subject:  

Posts crossed dancytron - I had already done that and edited my above post. hahaha so many crossed posts! Wink
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 693
Location: not Bulgaria

PostPosted: Sun 21 Jan 2018, 21:09    Post subject:  

By the way, if you want to increase the percentage of RAM used for zram swap to the same as the lz4-modded debian script dancytron provided, inside bash shell script /usr/bin/init-zram-swapping you can change the line:

Code:
mem=$(((totalmem / 2 / ${NRDEVICES}) * 1024))


to:

Code:
mem=$(((totalmem * 75 / 100 / ${NRDEVICES}) * 1024))


or make similar calculation mods for smaller or larger zram swap sizes.

Of course there is a limit as to how much actual RAM it is good to allocate to zram (since your system will run out of physical RAM and start using zram when it otherwise wouldn't and so on...). I'd stick with the lower zram amount you find you actually need to help avoid as much swapping as possible anyway.

wiak

Last edited by wiak on Sun 21 Jan 2018, 21:14; edited 1 time in total
Back to top
View user's profile Send private message 
dancytron

Joined: 18 Jul 2012
Posts: 1042

PostPosted: Sun 21 Jan 2018, 21:11    Post subject:  

1.8 Gig Intell Dual Core, 3 Gig of Ram.

Seems to work.

Before, if I hit a bad webpage that leaked ram (or just had a ridiculous amount of stuff running)and it started to swap, that was it. I wrote a little "kill chrome and firefox" script, and if I could run it before it froze completely, then in about 5 minutes I could have my computer back, otherwise it was a hard shutdown.

To test, I opened Firefox 57 and opened about 20 tabs with lots of video and other crap and got it to start swapping. Then I opened up another Firefox, opened up about 8 more tabs, including CBSN live news. Conky shows mem at 88% 2.6 GiB and swap at 35% 810 MB. CBSN is playing fine. I am posting from it now. It has hiccuped a few times and is slower than normal, but it seems stable.

A big improvement. Now swapping 51%.

p.s. Just to be clear, I am running DD 64 Stretch, not Xenial Dog, but it seems more or less the same.
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 693
Location: not Bulgaria

PostPosted: Sun 21 Jan 2018, 21:17    Post subject:  

dancytron wrote:
I wrote a little "kill chrome and firefox" script, and if I could run it before it froze completely, then in about 5 minutes I could have my computer back, otherwise it was a hard shutdown.


Yes, major headache - I do similar. XenialDog32 (but not xenialdog64) actually comes by default allowing ctrl-alt-backspace to drop down to commandline if done quickly enough on browser freeze - then startx to get desktop back. But kill script better option for such occurrence probably.

wiak
Back to top
View user's profile Send private message 
dancytron

Joined: 18 Jul 2012
Posts: 1042

PostPosted: Sun 21 Jan 2018, 21:19    Post subject:  

wiak wrote:
dancytron wrote:
I wrote a little "kill chrome and firefox" script, and if I could run it before it froze completely, then in about 5 minutes I could have my computer back, otherwise it was a hard shutdown.


Yes, major headache - I do similar. XenialDog32 (but not xenialdog64) actually comes by default allowing ctrl-alt-backspace to drop down to commandline if done quickly enough on browser freeze - then startx to get desktop back. But kill script better option for such occurrence probably.

wiak


If this zram thing works as well as it seems to, then I think those days are past.
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 693
Location: not Bulgaria

PostPosted: Sun 21 Jan 2018, 21:22    Post subject:  

No, I've been using zram for a while but still occasional browser freezes (chrome sometimes for me) despite not many tabs open! I test zram browser use via opening multiple gmail tabs (since each such tab seems to use a consistent RAM amount and quite a lot of it) and monitor free and available RAM via top running in an always on top window. But yes, browser freeze is certainly very rare now with zram running on my system.

wiak
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 22 of 27 [395 Posts]   Goto page: Previous 1, 2, 3, ..., 20, 21, 22, 23, 24, 25, 26, 27 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1052s ][ Queries: 15 (0.0261s) ][ GZIP on ]