Using zram and zswap in Linux

  Рет қаралды 21,989

SecureRandom

SecureRandom

Күн бұрын

Пікірлер: 65
@LeeZhenYong
@LeeZhenYong 3 жыл бұрын
6:33 zswap is such a great feature! It seems to work similarly to how macOS compresses idle RAM. I have 16GB RAM and 10GB of swap, but decided to enable zswap anyway because it's just a much better use of resources.
@ivanrasierer3257
@ivanrasierer3257 3 жыл бұрын
Hello. Which zswap.max_pool_percent has better performance in this configuration?
@jarroddeskins9161
@jarroddeskins9161 9 ай бұрын
Hey thanks! Even two years later its relevant. I want to use zram for temporary. Because it will increase lifespan of SSD because they can only do so many overwrites. Browsing the internet pretty much chews up my SSD. It hasn't gone bad yet, but it will one day. I just hope it doesn't require SystemD because I prefer other init. Anyway thanks!
@jarroddeskins9161
@jarroddeskins9161 9 ай бұрын
Oh yes! It's running perfectly in OpenRC. I suppose I should have known, being that zram runs at kernel level. Now when I surf the net, all temporary internet files go to a RAM drive which is A) Not eating up overwrites on my SSD B) very secure because if I turn off my PC all internet data is PURGED. My PC never swaps unless I use chat4all or stable diffusion, because my GPU is only 12 gig. And swapping slows down the last 20% or so of image generation. But I put the part of the drive that is used during generation of image/chat onto a zram RAM drive and now it is much faster and won't be overwriting my SSD every time. It's my GPU that swaps when 12 gigabytes video ram isn't enough, not the CPU, so having my PC swap to system RAM DRAMATICALLY sped up image and chat generation. (I have 32 gigs RAM) This zram is quite useful for conserving overwrites on SSDs. And zswap allowed me to use system RAM as a swap for the GPU. I could hug you right now. Thanks for helping improve the security and performance of my shit.
@radvilardian
@radvilardian 3 ай бұрын
Nice video bro, glad i found you.
@thebibleproof
@thebibleproof 2 жыл бұрын
Definitely subscribed! Thank you.
@crazyaccess
@crazyaccess 2 жыл бұрын
Great quality and efforts brother…
@cosmo_4785
@cosmo_4785 3 жыл бұрын
i have- physical ram: 4G /swapfile size: 4G zram size: 512M zswap: enable what can i change to impove performance.
@NickDyers
@NickDyers 2 жыл бұрын
remove your swap partition, and remove zram
@Bonez0r
@Bonez0r 6 ай бұрын
You sound almost exactly like the guy from The Action Lab on youtube. 😃
@AmidMajd
@AmidMajd 3 жыл бұрын
Super good and helpful video, Thanks!
@cosmicusstardust3300
@cosmicusstardust3300 Жыл бұрын
I had to disable zram swap because I experienced a strange issue where Firefox would load directly into it, even though I have 128 GB of RAM. Also, whenever the 4 GB swap got filled by Firefox, it would result in a hard crash.
@RedSntDK
@RedSntDK 6 ай бұрын
How many percent did you set it to? I've heard it can get unstable when set to 100%.
@linuxinside6188
@linuxinside6188 3 жыл бұрын
I use artix linux , which has runit as init system , will this work ? Can you show like runit service script for that ?
@securerandom5420
@securerandom5420 3 жыл бұрын
Hey LI, I'm not accustom to the runit init system. However, these are supported in the kernel itself so it should work regardless of which you use. Essentially what you're doing here with systemd is making a startup script for the swap file. So you don't "have" to use systemd as long as you can execute those commands in the unit file at startup.
@chrisdanger-godlike3048
@chrisdanger-godlike3048 2 жыл бұрын
what is your hint? i am using 4gb swap partition an 32gb ram. now, i need more swap. can i create 10gb swap file and add with zswap the 4gb partition?
@chrisdanger-godlike3048
@chrisdanger-godlike3048 2 жыл бұрын
@@mikewright9210 hi, i have create a 10GB swap file and deactivated swap partition (4GB), in terminal with top i see: RAM: MiB Spch: 27935,4 total, 2533,3 free, 6656,2 used, 18745,9 buff/cache swap: MiB Swap: 10240,0 total, 10216,0 free, 24,0 used. 20434,9 avail Spch i do not really understand the RAM buffer, but in my eyes, my computer do not need swap!\o/ mostly the swap use just some MB. So the meanings of 4GB swap is not very much...
@juanluucas
@juanluucas 3 жыл бұрын
i got 32gb ram but my manjaro only use ~3gb , can Zswap help me to get better performance ?.
@securerandom5420
@securerandom5420 3 жыл бұрын
Juan, zswap wont help you at all until your computer actually uses enough memory to take advantage of it. If you have 32G of RAM and you consistently only use 3 there is probably no need to turn it on. Unless of course you're just interested in learning how to do it.
@juanluucas
@juanluucas 3 жыл бұрын
@@securerandom5420 ooh i see. what can i do with the extra ram? sorry im new in linux. i hear about preload, but that program looks old
@securerandom5420
@securerandom5420 3 жыл бұрын
@@juanluucas Preload is actually pretty awesome and will make your applications quite a bit snappier. But if you're *trying* to use more RAM, you could always mount /tmp and /usr/tmp on tmpfs for a slight performance boost to the applications that write there.
@juanluucas
@juanluucas 3 жыл бұрын
thank you, you are amazing!
@gnupph
@gnupph 3 жыл бұрын
I have 64GB of RAM and ramdisk (tmpfs at /tmp) is the only thing I bought this much of RAM
@linusman6826
@linusman6826 3 жыл бұрын
Will Zram be better for an eMMC laptop with 4GB ram?
@securerandom5420
@securerandom5420 3 жыл бұрын
Yes if you actually start filling up that 4GB of RAM because it will help keep writes off the eMMC. There will be no difference if the RAM is never filled and it doesn't swap.
@SamuelAmanda-m2c
@SamuelAmanda-m2c 4 ай бұрын
526 Marquardt Bridge
@smalinux
@smalinux 4 жыл бұрын
Thank you!
@0xssff
@0xssff 3 жыл бұрын
why the udev rule though?
@rustydust8648
@rustydust8648 2 жыл бұрын
can you please tell me how to change compression algorithm in zram?
@prashanthb6521
@prashanthb6521 2 жыл бұрын
Edit the zram dot conf file.
@rustydust8648
@rustydust8648 2 жыл бұрын
@@prashanthb6521 never mind you should disable it, it is a not the right way to go about setting up zram it doesnt allocate/reserve the space for zram imagine you have 16gb ram, and 8 gb is zram you will use 14gb ram without going to zram when full 16gb is filled up, it will try to store in zram, but zram will have to clean up some space in ram to exist as all 16 gb is filled, this creates a deadlock situation, it will make your pc freeze and for the record, yes i tested
@LuiseMcgirt-l4h
@LuiseMcgirt-l4h 3 ай бұрын
McDermott Summit
@RohithGolle
@RohithGolle 2 жыл бұрын
actually priority in linux goes this way -20 highest priority to 19 lowest priority
@YARAKalwei
@YARAKalwei 4 ай бұрын
265 Griffin Fields
@RalphCornelius
@RalphCornelius 4 ай бұрын
484 Murray Club
@RosaZimmerman-w6f
@RosaZimmerman-w6f 3 ай бұрын
Champlin Plains
@JulianaAntony-r8q
@JulianaAntony-r8q 3 ай бұрын
Mattie Land
@Troy-s7q
@Troy-s7q 4 ай бұрын
010 Hudson Creek
@IV.Odelia-y3f
@IV.Odelia-y3f 5 ай бұрын
Nicolas Shoals
@ChristopherCoburn-j4m
@ChristopherCoburn-j4m 3 ай бұрын
Felipa Light
@ariel_chess
@ariel_chess 6 ай бұрын
Is it only me or do you kinda sound like Stitch?
@MarilynSnyder-p5k
@MarilynSnyder-p5k 3 ай бұрын
Herzog Run
@lordofthemound3890
@lordofthemound3890 3 жыл бұрын
I thought lower numbers -3 vs -2 or, say 0 actually have a HIGHER priority (i.e. -20 is highest priority and 19 is lowest priority).
@BenderdickCumbersnatch
@BenderdickCumbersnatch 3 жыл бұрын
No. Higher is higher priority: "priority is a value between -1 and 32767. Higher numbers indicate higher priority."
@jeffreymorgan5808
@jeffreymorgan5808 2 жыл бұрын
So this can be used to hide messages or apps to hide from gf
@lordofthemound3890
@lordofthemound3890 2 жыл бұрын
@@BenderdickCumbersnatch What am I thinking of then? Niceness (or Nice value)? How does Niceness and priority interact?
@CareyLawrence-z9y
@CareyLawrence-z9y 4 ай бұрын
Zboncak Ranch
@mikewebster438
@mikewebster438 4 ай бұрын
405 Wyman Run
@PhilipHulda
@PhilipHulda 4 ай бұрын
979 Edwardo View
@CarlosSmith-s1p
@CarlosSmith-s1p 4 ай бұрын
Ziemann Ports
@pawanyadav9854
@pawanyadav9854 3 жыл бұрын
Great video
@AlethaRoble-u1k
@AlethaRoble-u1k 4 ай бұрын
Abigale Course
@6srer
@6srer 3 жыл бұрын
💀
@fatpanda1597
@fatpanda1597 Жыл бұрын
sudo apt install zram-tools sudo nano /etc/default/zramswap --> -------------------------------------------------------------------------------- ALGO=lz4 PERCENT=25 -------------------------------------------------------------------------------- Done. Nothing more to change.
@steeltormentors
@steeltormentors Ай бұрын
do you know what's the best algo? also is there a penalty / negative effects of using zram? using swap file the cons are clear: 1. Slow, 2. Eats the "health" of the SSD quicker. I haven't seen the cons in zram? is there any?
@fatpanda1597
@fatpanda1597 Ай бұрын
@steeltormentors lz4 is fastest, there are no negatives, it saves SSD lifespan, only thing I would care for is to shut down system normally when using it.
@steeltormentors
@steeltormentors Ай бұрын
@@fatpanda1597 oh i usually suspend my linux system not shutdown...does that mean it's not recommended to use the zswap / zram if I suspend a lot? shutting down takes time to set up my workspace flow. I appreciate the response, happy new year!
@fatpanda1597
@fatpanda1597 Ай бұрын
@@steeltormentors i mean to avoid forced shutdowns, power outage etc.
How to Sandbox Services with SystemD
13:42
SecureRandom
Рет қаралды 1,3 М.
Linux File System/Structure Explained!
15:59
DorianDotSlash
Рет қаралды 4,3 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
Why I Can't Use Linux - My Top 3 Reasons
26:05
Tek Syndicate
Рет қаралды 152 М.
Why You Should Use ZRAM on Your Raspberry Pi
20:20
Gary Explains
Рет қаралды 20 М.
The 5 Things That Taught Me The Most About Linux
18:41
DistroTube
Рет қаралды 98 М.
Inside the V3 Nazi Super Gun
19:52
Blue Paw Print
Рет қаралды 2,9 МЛН
Looking at Swap on Proxmox: Configuration, zswap, zram, swappiness and more.
12:38
Fedora vs Debian and Arch Linux
17:32
Chris Titus Tech
Рет қаралды 546 М.
Linux Crash Course - The df and du Commands
20:28
Learn Linux TV
Рет қаралды 31 М.
18 Commands That Will Change The Way You Use Linux Forever
29:50
Akamai Developer
Рет қаралды 1,3 МЛН