You are not logged in.

#1 2019-11-13 18:11:50

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

How to lower swappiness in Busenlabs and Debian gnu/Linux.

Ok what may you ask is swappiness and why could it possibly be important to anyone ? Fair enough, swappiness dictates a gnu/Linux OS's propensity to take stuff which it feels isn't as important out of system RAM and write it to disk, to the swap partition or swap file on your OS. It does this to free up memory so it's readily available for whatever to use. However the default setting you're going to commonly find in gnu/Linux distro's is ridiculous (usually it's set to 60), the higher it's set, the more tendency the OS has to write junk to hdd, then pull it off of the drive if needed again for something.

With the average pc having plenty of RAM, a high swappiness value is foolish, disk i/o (writes and reads) are MUCH slower than things kept in RAM. So it's long been the recommendation that this be lowered to 10 for desktop gnu/Linux users. Have done so myself forever and a day. It's a fundamental performance tweak, esp on lower memory hardware but applies as well to high-spec. First let's check what the swappiness is set at already on your OS. In terminal ...

cat /proc/sys/vm/swappiness

If it comes back with 60, Houston we have a problem. With all of that out of the way, how might we adjust this mystical swappiness thing ? I'm glad you asked. tongue We are going to do this terminal nix-ninja style with a command line editor in terminal. So if you don't have the mighty nano (terminal text editor)installed do so. Let's see if it is first. In terminal type ...

dpkg -l |grep nano

If installed it'll show up, if it isn't already, install it, again in terminal ...

apt install nano

Once installed, let's use that puppy, type ...

sudo nano /etc/sysctl.conf

The file we want opens with elevated privileges, so we can edit the sucker. We scroll down to the bottom of the thing and add this.

# Lower swappiness to a more reasonable level.
vm.swappiness= 10

Ok to save the file in nano, hold down the Ctrl + hit the X key, then hit the Y key and finally hit the Enter/Return key on your keyboard. Next time you reboot and from then forward, swappiness will be set at 10 or we could do so now w/o reboot too.

sudo sysctl -p

End result again in particular on a low-spec system with memory constraints, a snappier and faster performing OS. Versus one which would start bogging down and swapping things out to disk, if someone left swappiness set to a value of 60. Even when there's still plenty of free memory available for use.

Vll! smile

Last edited by BLizgreat! (2019-11-14 17:15:52)

Offline

#2 2019-11-13 18:48:23

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

Dang it having real trouble speaking(typing)English today apparently. Had to edit and restructure this simple tute 10 times !!! Arghhhh, this wouldn't be an issue or so bad if I spoke another language but I DON'T, English is it !!! Arghhhhhh ! tongue

Anyway for a much more responsive OS, do the above. The OS will still use swap if needed, just won't do so when there's still ample RAM available and won't bog things down writing junk out to your hdd. Also DO NOT set swappiness = 0. Haven't checked in awhile but remember that in newer kernel's doing so actually disabled swap altogether. Same kinda thing as "sudo swapoff -a" folks.

Last edited by BLizgreat! (2019-11-13 18:49:18)

Offline

#3 2019-11-14 02:24:51

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,097
Website

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

To try a new swappiness (as I'm doing right now) try this:

sudo sysctl vm.swappiness=10

The change will only last till reboot.

If you like the result, follow BL'z guide.

(Now to find something memory-intensive to test it...)


John
--------------------
( a boring Japan blog, idle Twitterings and GitStuff )
In case you forget, the rules.

Offline

#4 2019-11-14 09:46:52

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

Good add John, thanks.

Though this is 120% harmless either way. Is bound to make a real difference on low memory systems. On highspec pc's should adjust it too but not even going to be noticeable for many. If you have 16gbs-ram on a pc, should never even see the swap touched, even with the stupe 60 default left alone. On low-spec though, someone could have 100's of MB's of RAM free and the OS will still start swapping things out to disk. Really slows things down. Overall though this has been in my must do, essential basic tweak category on everything gnu/Linux forever. smile

Offline

#5 2019-11-15 01:35:54

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 761

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

Gotta love BLZ's posts...his humor and knowledge shines through!

Good tip to add to the tweaking  tips and tricks smile


Real Men Use Linux

Offline

#6 2019-11-15 01:45:51

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

^ Hey thanks, feels good too. Sharing is caring thing. Do hope the BL team considers making this default. Mentioned out of at least a couple dozen distro's, only ever found one which had this set out-of-box. Fairly well certain it was PClinuxOS(lxde version and this was 8 or so yrs ago)and it was set too low anyway. Went to change it as a part of my tweak regiment and it was set at swappiness=0 already. Changed it to 10 and got on with life. Anyway, thanks for the kind words DeepDayze. smile

Last edited by BLizgreat! (2019-11-15 01:47:03)

Offline

#7 2019-11-15 02:16:42

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 761

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

BLizgreat! wrote:

^ Hey thanks, feels good too. Sharing is caring thing. Do hope the BL team considers making this default. Mentioned out of at least a couple dozen distro's, only ever found one which had this set out-of-box. Fairly well certain it was PClinuxOS(lxde version and this was 8 or so yrs ago)and it was set too low anyway. Went to change it as a part of my tweak regiment and it was set at swappiness=0 already. Changed it to 10 and got on with life. Anyway, thanks for the kind words DeepDayze. smile

The Liquorix Kernels use 10 for swappiness too.

Anytime...your posts are great to read!


Real Men Use Linux

Offline

#8 2019-11-15 04:15:52

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,097
Website

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

BLizgreat! wrote:

Do hope the BL team considers making this default.

Changing system settings from the Debian default is a big step that could take some users by surprise. About swappiness, although a lot of people recommend 10 these days, there are others who say it makes no, or little, difference. See the top post here:
https://askubuntu.com/questions/184217/ … s-to-10-20

So something for "tips and tweaks", sure...


John
--------------------
( a boring Japan blog, idle Twitterings and GitStuff )
In case you forget, the rules.

Offline

#9 2019-11-15 05:42:11

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

These dys ? I found this within a couple wks after I'd started messing with gnu/Nix 8 or so yrs ago and this basic tweak had already been around a long time before then. I've seen it firsthand of course, 47 FF tabs open on a P4(single core)with 512mbs and running smoothly without touching the swap. Prior to doing this ie: Untweaked Linux Mint 10, crappy, laggy, swapping it's butt off, same for plenty of others, I was distro hopping like a person possessed back then.

On a lower-spec system it's going to make a serious difference and a distro like BL is going to attract a good chunk of people in that category, with 2gbs or so, can be night and day. Esp with how RAM hoggish web-browsers are now. So xyz-nixer has 2gbs, 1.3 or 4 is used, has plenty left but nope swappiness=60 and OS starts swapping out like crazy. End result a laggy, far less responsive OS and poor user experience. Feel free to try it out yourself of course, open a browser and start piling on tabs. See how quick (esp a poorly tweaked)FF-etc starts gobbling memory and when you've still got plenty of free RAM available, watch swapping kick-in. Also if someone does have an SSD, one of the common sense advisement is avoid frivolous disk writes. For those folks, the crappy default swappiness isn't going to have the same performance hit as someone with a mechanical drive but it's still wasteful and stupid and with either type it's undue wear and tear.

Though you guys get to make such decisions. Someone can easily apply this tute or find a gazillion mentions of this tweak online. Not my call, feel I've done my good deed in mentioning this for the BL crowd. So mission accomplished on my end. smile

Also have to do it, keeping it real. Please don't go there with the Debian card. I like and respect you but for real, if the 352 distro's based on Debian really held them in much regard, none of them would include non-free out-of-box fellow nixer. Which I wuv Debian but think their stance on that issue is absolutely retarded. They did all the work, Ubuntu(then LM)slapped in as much proprietary drivers and firmware as they could fit and now ? They have millions upon millions of users and Debian's sitting in a dark corner wondering why nobody uses it.

Sheesh even this 10yr old Dell laptop needs some closed source to run well. Output of vrms package says 6 non-free and 2 contrib (which I don't actually need), those are for the b43 module/driver I keep onhand as a backup to the wl.ko for my wireless. In many ways Debian has and is cutting it's own throat. So I'll take my queue from bottom line results. What clearly works, makes my installs faster, lighter, more stable or secure etc. What any particular neck-beard at Debian might have to say about it, couldn't care less if the guy can't show me a better way with solid backing.

Last edited by BLizgreat! (2019-11-15 05:49:04)

Offline

#10 2019-11-15 06:03:19

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

Also one more did you really just cite a Buntite as a credible source of techie info ?!??! Lmao .. certainly are some but a small minority and no doubt many of those peeps don't actually run Ubuntu as a daily driver anymore regardless. Recently had to give up on the LM forum, had a soft spot for it, since I started out with LM10. Just couldn't take it anymore between the clueless newbies and the equally clueless veterans, reading their posts made my eyeballs bleed. smile

User join date from 12yrs ago, asking a question a complete noob could and should easily solve themselves. "Hey my boot time is 3mins, HELP ME." User, 1,000's of posts, tons of pretty orange status boxes and a join date of 5-6yrs ago. His response to something I'd posted ? "I bookmarked this, never tried installing a different display manager, really interesting" AhhhhhhhHHHHHHHHH !!!! You've been running gnu/Linux for 5 friggin yrs and haven't done something so basic yet !?!??!?! I didn't tell him that but had to make a real effort not to slap the guy on ignore. So among the LM and Ubuntu communities, I don't focus on whatever discussions they have, I can't bare to read what they say/think about gnu/Linux. It's too friggin painful.

Offline

#11 2019-11-15 06:07:05

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,097
Website

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

BLZ this has got nothing to do with Debian policy on non-free etc. They want to keep themselves absolutely safe from potential lawsuits so they can go on existing for ever, and I totally respect that choice. It's not about RMS idealism at all IMO. Meanwhile we users and distrolette spinners can add the non-free stuff that Big D themselves make it easy to get.

Anyway, system settings. Like I said, from my googling (inadequate no doubt) people say, depending on your hardware and useage case,  60>10 might help, might do nothing, or might make things worse. In that case, I don't see why BL should force the change on everyone till there's a deafening cry (from more than one person, with the greatest respect) to do it.

And Debian has a great number of people more knowlegable than me thinking about this stuff, and I imagine they had reasons to keep swappiness at 60 by default.

No harm in users trying something different - sure go for it - but that's different from BL slipping it in unnoticed.

Last edited by johnraff (2019-11-15 06:20:05)


John
--------------------
( a boring Japan blog, idle Twitterings and GitStuff )
In case you forget, the rules.

Offline

#12 2019-11-15 06:11:14

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,097
Website

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

...and I thought you'd jump on the Ubuntu link.  roll
(It's not the forum btw.)

At least read the fscking post I linked - it's not all that long - and see if the guy is really talking out of his rear end or not. It was posted in 2012, but basics don't change. I'm not knocking the idea of tweaking swappiness, just saying it might not be as clearcut as you make it.

Last edited by johnraff (2019-11-15 06:24:05)


John
--------------------
( a boring Japan blog, idle Twitterings and GitStuff )
In case you forget, the rules.

Offline

#13 2019-11-15 06:56:08

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

Nope gotta do it.

And Debian has a great number of people more knowlegable than me thinking about this stuff, and I imagine they had reasons to keep swappiness at 60 by default.

No harm in users trying something different - sure go for it - but that's different from BL slipping it in unnoticed.

Does not bode well dude. If applying such a basic and fundamental tweaks is cause for such controversy among the distro maintainers, then jebuz fellow nixer and again with the vague references to these uber-geeks, oh people much more knowledgeable than me, oh I'm sure they have reasons vs actually testing, which all things gnu/Nix can be done on fairly easily, learning enough to have a solid opinion on things, it's all bottomline fact oriented stuff eh. Many things tech and gnu/Linux are flat black and white. It works or it doesn't period. If someone doesn't know that, know how to do such and thus actually gain some degree of knowledge and skill-set on whatever aspect of gnu/Nix, then again, yowza ! The prime directive of any distro should be to be as good as it can get. To give users the best experience and performance possible. So if a 15yr old harmless tweak is so unthinkable and dramatic. Looking doubtful for folks as end users, ever getting much to speak of, shrugs.

Ahhh anyway, looks like I gotta sign off. Nix-nomad for reason(s.) I'll base my views, config choices and optimization methods on 8yrs of first hand experience and an insane amount of time, effort and experimentation devoted to learning about gnu/Linux. However many the good nixer here, BL team and in the community. Wish ya'll well in your journey fellows. wink

Last edited by BLizgreat! (2019-11-15 06:57:56)

Offline

#14 2019-11-15 07:04:44

ohnonot
...again
Registered: 2015-09-29
Posts: 4,168
Website

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

johnraff wrote:

BLZ this has got nothing to do with Debian policy on non-free etc. They want to keep themselves absolutely safe from potential lawsuits so they can go on existing for ever, and I totally respect that choice. It's not about RMS idealism at all IMO. Meanwhile we users and distrolette spinners can add the non-free stuff that Big D themselves make it easy to get.

Anyway, system settings. Like I said, from my googling (inadequate no doubt) people say, depending on your hardware and useage case,  60>10 might help, might do nothing, or might make things worse. In that case, I don't see why BL should force the change on everyone till there's a deafening cry (from more than one person, with the greatest respect) to do it.

And Debian has a great number of people more knowlegable than me thinking about this stuff, and I imagine they had reasons to keep swappiness at 60 by default.

No harm in users trying something different - sure go for it - but that's different from BL slipping it in unnoticed.

Wise words. Thanks for your patience, johnraff.

The ArchWiki seems to recommend (but not strongly recommend) reducing the default 60.
The linked article explains the reasoning for using 60 as default. Once again it comes down to Linux (and Debian) being used mostly for non-desktop scenarios.

Offline

#15 2019-11-15 07:30:05

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,097
Website

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

^Thanks for those links.

Interesting note about VFS cache pressure.

People with swap on a hard disk and SSD would likely be interested in priority too.

I have an old laptop with 2GB 1GB RAM that would be perfect for testing this stuff on, but I don't really have the time right now.

Meanwhile, if there seemed to be a consensus on the forum here to move the OOTB default of 60 down, and other dev team members were for it, I'd certainly not object. But I don't have the time at the moment to give the testing, googling and discussion a high priority, relative to a lot of other stuff that needs doing before Lithium comes out.

Last edited by johnraff (2019-11-17 03:34:32)


John
--------------------
( a boring Japan blog, idle Twitterings and GitStuff )
In case you forget, the rules.

Offline

#16 2019-11-16 03:57:36

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

Anon BL user discovers default swappiness has been changed AND without ample notice(public debate)and detailed info as to why or the workings of swappiness:

OMG, what is this ????! How could they do this to me ?! They slipped in something which improves the overall performance of my operating system !!! I can't believe it and will never be able to trust those dirty so and so's again ! D:

Ya know what I got out of slapping up this tute ? Relating to something I've known about and used for 8 friggin years ? I got to put the movie I was watching on YT on pause, stop looking over info (googling) about something on my gnu/Nix 2-dork list and tab over to text-editor to spend 20-30mins finishing this off, checking for typos and coming here to post this to BL forum so it'd be hopefully helpful in improving things for anonymous nixers I don't know and almost surely will never meet IRL. So what I go out of the deal folks ? I got 30mins of my life I'll never get back, that's what. Had time to cool off a bit, still like BL teams and plenty nixers here but yep do have to curb babbling among this gnu/Nix community for varied reasons. Again if discussing an ancient, totally harmless and a matter of a couple secs effort to reverse or adjust tweak is considered so controversial and pushing the envelope by senior members of the community, I'm definitely in the wrong place.

Dang it do miss the glory dys of #! forum. Machinebacon and many others, the nix-mad-scientists, free thinkers and compulsive tweakers, many folks who actually knew wth they're talking about and sharing interesting junk about gnu/nix and tech and things overall !!! Sheesh people it's gnu/Linux, a geeks and hackers OS. A platform for those who want to tweak and config things to be as they prefer. To be anything they prefer (at that moment or for that usecase.)To optimize and fiddle until something cool is created. Then share some interesting info. Clearly this is a minority view (esp now.)

Btw: Broke down and read the buntites views on swappiness and yeppers was as painful as expected. Arghhhh !

Last edited by BLizgreat! (2019-11-16 03:58:50)

Offline

#17 2019-11-16 05:56:17

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,097
Website

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

BLizgreat! wrote:

if discussing an ancient, totally harmless and a matter of a couple secs effort to reverse or adjust tweak is considered so controversial and pushing the envelope by senior members of the community, I'm definitely in the wrong place.

You've got it totally wrong.

Here in the "Tutorials & Tips" section you posted a really useful and easy tweak any user can try and likely to get improved performance from their computer. Great! Excellent! People reading that will learn a bit more about what happens on their machine, and how they can control it. They can try 10%, or possibly some other value they find suits them best. cool

But, you go on to suggest - more-or-less insist - that BunsenLabs now add this tweak to the default system. What would that achieve? OK some people would get a snappier machine - Good Thing - but none of the new users you're presumably hoping to reach would know anything about how it happened. Surely there are some tweaks that depend on use cases and hardware, and users should be expected to do them themselves? Then, that's why we've got this forum section! roll

Yes, I'm one of the devs here, but I don't think I actually posted that a tweaked swappiness should never be added to BL's default settings, but that changing system settings was not something to do lightly. For a start, I'd want to know exactly what it was all about, be able to justify the setting we chose, and help anybody who had problems with it. Googling, reading and testing on the hardware I have. Alternatively, if another team member whom I trust had done such research and said it was OK, then OK. And that no other team member objected would be another condition. So it might happen, but not today.

---
And would you like to explain why this is wrong?

hated Ubuntuite wrote:

Reducing swappiness a little may be justified if you know what you're doing, but reducing it to as low as 10% can leave the system tolerant to very low cache sizes and leave the system more liable to have to swap at short notice.

---
OT/
I'm sorry if BunsenLabs doesn't strike you as such a cool and geeky place as CrunchBang. I also miss Machinebacon and a lot of the other people who used to hang out then. BL still aims to be easy to tweak and config to taste, and I don't think it's all that different from #! in that way. In Lithium, for example, it's much easier to switch to a different window manager without having to redo all your config from scratch. But CrunchBang was also a nice-looking full-featured system that people could use right out of the box to get their work done without tweaking anything, but also without being loaded down with heavy daemons and fancy GUIs. It wasn't the lightest system at all, never claimed to be, but hit a nice "sweet spot" for some people (me included) and that's what BunsenLabs aims to do too.

People use Linux for all kinds of different reasons, and can choose the setup they like best. smile


John
--------------------
( a boring Japan blog, idle Twitterings and GitStuff )
In case you forget, the rules.

Offline

#18 2019-11-16 06:02:22

cog
brushpopper
From: New Mexico, USA
Registered: 2015-10-27
Posts: 343
Website

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

^ I agree with @johnraff here.  swappiness is almost a thing of the past unless your trying to run something on really old or anemic hardware.  The default 60 should never be changed unless the user "needs" it.

@BLizgreat! you might look at it a different way.  None of us have changed but the hardware specs and code base has that we all use.

Last edited by cog (2019-11-16 06:16:16)


It is another beautiful day at the Red Pony Saloon and continual soiree.  - Henry Standing Bear

Offline

#19 2019-11-16 06:50:59

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

Had mucho more to say but why bother ? At this point pretty much flushed 1.5-2hrs of my life right down the crapper already. Gonna watch a movie now. Much more enriching and relevant to me. tongue

Old saying about leading a horse to water, can't make drink pops in ma head. True depending on context, though again ... anyone imbued with the blessed common sense would know, yep you can make a horse drink. Shove a hose down that baby's throat and I can make it drink as much as I like. O course wouldn't engage in such azzhat-ness outside a survival situation, for me and the stubborn horse. tongue

Offline

#20 2019-11-16 10:34:25

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

AHHHHHH !!! Going to babble anyway. Some I've already covered in this now, wish I hadn't have bothered thread !!!

Yep, hardware has changed and the people behind much of the software have noticed and changed too. Such as the uncommonly used web-browser(s) After all who bothers having a web browser on their computer, surely not very many ? Lmao ... some of the stats people report make my eyes bug out. If ever saw such from FF (and others are even worse) if I couldn't sort it quickly, I'd be using another browser within 2dys, PERIOD !!! Though obviously these nixers are talking about poorly or untweaked browsers, no doubt running on poorly config'ed and untweaked gnu/Nix installs. As mentioned anyone who'd take the trouble to find a minimal Debian based distro is almost certainly not on ultra-spec hardware, though it'd run great there as well of course. So 4gbs-mem or less, many no doubt with 2gb systems are the very people who search out these type of distro's. Adjusting swappiness assuredly is relevant to someone with a 4gb system. With any less memory it should dang well be considered a no-brainer tweak.

Also ... a good chunk of the people who make up desktop gnu/Nix are mostly clueless folks. Think of many such as window$ users with delusions of granduer. In other words they really don't know chit about gnu/Linux or tech. Lucky if they can find their cyber-butt with both cyber-hands and any of the 52 cyberbutt detector utils readily available and well documented online. Avg window$ user, pop open an admin console (aka: Root terminal in gnu/nix), they'd be like, hey man, did you install something on my computer !!! Just cause someone's been using window$ OR gnu/Linux for 10yrs doesn't mean they know or have learned much of anything about it, shrugs. Just keeping it real. As a distro maintainer would consider it that person(s) job to actually learn things relevant to getting better and smoother performance out of the distro for the benefit of it's usebase. Ah screw it ... not my call, nor really concern. Will never run an out-of-box distro again. Wasn't most of the time back in #!-ville(I wasn't running #!.) At least not for more than brief periods to play with it/them.

Being kinda aholish here but it chaffes my buttocks to have to debate this with you John-san. Though like and respect ya dude. Have been advising people to do this FOREVER. Back in the #! forums too (8yrs ago.) Thus you've seen or should have the responses from users who actually applied adjusting swappiness. Things along the lines of ...

Hey damn ... it's running a lot better, faster and smoother now, thanks CBizgreat!. This is going on my tweak list dude ! Etc etc. Just saying dang it, tis a fact. Not that such info isn't all over the place online anyway but the fact of the matter is avg nixers will never bother learning what the hades swappiness is, will never learn about virtual memory management in gnu/nix or gazillion other far more complicated things than swappiness and this thread will sink into the depths of the tips + tricks section soon enough. Distro devs/maintainers may want to show some initiative if having a kickarse gnu/Nix distro is the end-goal, shrugs. It's basically either someone does such for them or it'll never be done. Good distro's will do so and as a result will run better and have happier users. Though if something like this causes such shockwaves, sheesh forget about it. Saying oh jane/joe avg nixer will set it up if they like it that way. Anyone whose spent the time, effort and energy I've dovoted to learning about gnu/Nix very likely isn't going to be running BL nor any other out-of-box anyway. Even though am sure(know BL)runs great. Just keeping it real jane/joe have nothing like the knowledge or skills to apply many tweaks (they never will) and swappiness is a simple, straight-forward low hanging fruit kind of thing. Though works well ... Apparently in 8+ years you never bothered learning about it John-san and know you've seen swappiness mentioned plenty of times already and have more than a few low-mem systems sitting around. Ah anyway, movie time. smile

Done with this nonsense ... apply tweak, don't. Blahblahblah.

Last edited by BLizgreat! (2019-11-16 10:35:34)

Offline

#21 2019-11-16 12:01:12

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

@John-san, sorry fellow nixer, in my view you are in fact a very knowledgeable, skilled and experienced nixer overall. Just that this situation irritates me. It's gnu/Nix as such more than one way to skin cats. Perhaps debate adding this as an option in the bl-welcome deal ? Then all parties are happy ? It's a matter of echo'ing one friggin line to sysctl.conf afterall. smile

Apologize my friend, I got carried away here.

Offline

#22 2019-11-16 16:22:00

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

More babble, from the Ubuntu docs on swap and swappiness.

The default setting in Ubuntu is swappiness=60. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. A value of swappiness=10 is recommended, but feel free to experiment.

Seems mister quoted Buntite didn't bother reading his own distro's notes on swappiness. Who have thunk it, a buntu user who's never read the docs ?!?!? Unheard of I tells ya's. big_smile Also yep, it's a friggin mess man. Been awhile since I've bothered but trying to search for valid info on swappiness setting is a painful case of the blind, leading the retarded, all of em walking around in circles anyway. LMAO, whereas a Redhat doc says on their stuff (mentions a new formula was in place) but said default 60 at that time meant 80% RAM exhaustion before swapping of APPLICATION related files kicks in. Meaning apps you're actually using, thus really screwing up their performance. Starts swapping other junk out at a much lower % surely. However again .. from first hand experience, when was briefly using LM10 OS(untweaked)would start swapping like mad, when there was still plenty of free RAM.

Found another who posted output of htop, which should be fairly hard even for a tektard to misinterpret, said showing 50% RAM still free and OS swapping like it's going out of style. Also as noted you'll see more than a tad of tutes, esp for people with plenty RAM recommending swappiness=0 and again, believe in newer kernels, that outright disables swap and my general opinion on it on a RAM rich OS would still be 10, though perhaps 20 for the appropriate setting.

Have 4gbs to work with here, always have and overwhelmingly always will leave it set to 10, only exception to that would be some really obscure corner case, in which I'd then adjust it otherwise, shrugs. Finding a flat out formula which explains it is more challenging than should be, oh well. Haven't bothered dorking with opening webpgs till swap kicks in. Imagine for me (on this 4gb dinosaur with swappiness 10), the way FF and the OS are tweaked, probably have to open 98-120 normal websites, before any swap would kick in. With OS running smooth as silk the whole while. Dammit ... I'm bound to try it now !

Update: Nope if others would like to test the waters. My connection isn't tops today, good enough to watch a movie on but forget this, stopped at 53 random websites, one of them a paused movie on YT I'm about to get back to and "free -m" says.

              total        used        free      shared  buff/cache   available
Mem:           3498        1457        1319          68         721        1438
Swap:          4099           0        4099


Would still have to spend a bunch of time opening webpgs I don't give a crap about for this nonsense. Forgetaboutit. wink

Last edited by BLizgreat! (2019-11-16 18:34:57)

Offline

#23 2019-11-17 04:24:37

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 6,097
Website

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

Testing going on right now on my 1GB laptop. Google Maps, YouTube etc usually bring it to a stop. Though seems a bit better today - maybe the latest Firefox is actually an improvement?

Bootup RAM ~210M

Maps in one Firefox tab, Youtube music (but static image for video) in another.

Swappiness at 60:
RAM 672M (total 928), Swap 133M
Play with the map a bit...
RAM 700M, Swap 213M
Machine is usable, if not exactly snappy.

Set swappiness to 10, reboot (same Fx tabs):
R 644M, S 94M
then
R 683M, S 173M
Swap slightly down, no startling difference in machine feel.

After closing Fx RAM is down to 132M (!) probably because swap still holds 85M. (Same behaviour with swappiness at 60 or 10.)

Further research will have to wait...


John
--------------------
( a boring Japan blog, idle Twitterings and GitStuff )
In case you forget, the rules.

Offline

#24 2019-11-17 08:44:25

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

Those numbers don't look right to me John. Makes no sense that RAM use so close (600mbs +/- on both)and yet swap is kicking in regardless of swappiness set at 60/10. Oh well, looks like something was done incorrectly to me, swappiness 10 vs 60, are not going to take effect at the same level, at that close of a margin. Setting it to 10 the system would have to use mucho more memory before swapping would kick in than when set at 60, that's not what's happening in your stats.

The reason for post. Because I like to babble, nah more importantly thought of something related. Seen a bunch of proposed formula's for figuring out exactly how this works, some saying it's a flat %, so swappiness=60 would mean when OS has used 60% of physical RAM, it'll start swapping to disk, even with 40% still freely available. That's consistent with what I'd seen in the brief time prior to when I started adjusting this thing. Same time, others propose that it's controlled a different way, works another way.

Being gnu/linux thought crossed my mind, that it's stupid/sloppy for me to just open a bunch of browser tabs to check at what point the swappiness value I've set takes effect and makes the OS start swapping. Hmmmm, surely some nixers have already come up with a better way, google. Yep, one package in the repo's, am sure there are plenty of others. The thing is called stress-ng and let's someone put a set load on whichever systems components, including RAM. Can have it use X-amount of RAM, for X-amount of time and observe the effects.

Haven't bothered using it and of course people should read about the thing before doing so but with a utility like this, it can take all the mystery out of swappiness. A bit of testing and anyone who wants to can find out exactly how much RAM is used, at the point that swappiness/swap kick in ... Think it's cool, though have long known where I stand on this subject. Always has been, almost surely always will be swappiness = 10 for me fellow nixers. Made a VERY noticeable difference in performance, pre/post-tweak. smile

Last edited by BLizgreat! (2019-11-17 08:51:22)

Offline

#25 2019-11-17 12:16:23

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,217

Re: How to lower swappiness in Busenlabs and Debian gnu/Linux.

Gotta do it, John-san just add the friggin relevant ONE line (or 2 if you add a comment to remind you what the hades the swappiness thing is/does)to sysctl.conf and reboot. Test for a bit don't see the point, remove said line or comment it out until you wan't to dork with swappiness again and you're back to 60. This is not a serious thing fellow nixer. Whichever way you went about this, obviously didn't work as shown by those stats. You're acting like this is defusing a fricken bomb or summin ... ohhhhh, do I cut the red or the green wire ? OMG, the pressure !!!

Just edit sysctl.conf and get on with your other projects. This tweak is going to improve desktop gnu/linux user experience for 99.964% of BL users (or certainly won't cause any issues, if you have 32gbs of RAM who friggin cares what swappiness is set at (I still would)and they likely aren't considering using BL either anyway.)

Mentioned in another thread, what Debian goes with default is absolutely irrelevant, that is not any sort of recommendation by them as to desktop gnu/Linux, it's a hang-over from 1994. They expect you to reconfig whatever install(s) to be most appropriate for the use-case, desktop gnu/nix in this case. Sheesh Debian has zero clue what someone's going to set an install up to be. So I guess that by leaving swappiness=60, this is also their recommendation for someone who's using Debian to run a friggin blender or juicer on their kitchen counter too ? Arghhhh, sorry again, this came off a wee bit harshly but don't make this complicated or painful for yourself or for me, okay ?

So no worries, whatever you do ........ as long as you don't touch the green wire, then you're totally screwed man ! tongue

Last edited by BLizgreat! (2019-11-17 12:18:11)

Offline

Board footer

Powered by FluxBB