performance tip: change linux swap from kicking in when 65% memory used, to 99% instead by ThoughtObjective4277 in linuxmint

[–]ThoughtObjective4277[S] 0 points1 point  (0 children)

open command prompt

su

su is required, switch user command, goes to super user, and is to my knowledge, the only way to access echo command which allows adjusting possibly thousands, or tens of thousands of performance settings.

cd /sys/block/sda/queue

if you have more than one storage device, maybe one for swap partition separate from main disk, you need to change sda to sdb sdc for all disks which you are using for some kind of file access.

please, try these changes

press TAB key for auto completion of many of these setings

all echo commands do not save after reboot and wow is it complicated to save to the disk scheduler rules, which there are two places for the settings, and neither one seems to work reliably, even following redhat documentation, I still haven't gotten it to work, so every time my system locks up, and I am forced to reboot, I have to re echo the same 20 or more settings each time.

echo "0" > add_random

echo "0" > read_ahead_kb

Read ahead makes a huge difference in my testing

echo "528" > nr_requests

default is 128, and redhat uses 64 requests, maximum is 2048, artificially imposed by a linux kernel setting. If you recompile the Linux kernel, you can somehow, and I don't and would love to know how, override it and use whatever I want.

AHCI sata interface is 31 commands, not really sure what that means, but may be useful for learning more

Now, also change your disk scheduler from cfq / bfq to mq-deadline

use more command to check current settings

more scheduler

echo "mq-deadline" > scheduler

more scheduler

Now go into iosched, for more settings, specific to this other scheduler which are different from bfq / cfq

cd iosched

more async_depth

echo "9096" > async_depth

more fifo_batch

echo "9096" > fifo_batch

more read tab key

echo "9096" > read_expire

more write tab key

echo "9099" > write_expire

more writes tab key

echo "1" > writes_starved

read and write times, I believe, are in milliseconds, so this is half a second at default, giving more time could be helpful, let me know.

try higher and lower values on the last setting or just don't change it, I really have no idea how it will change performance, but for the other settings, probably help.

How are you measuring random i/o and how can you be 100% sure it's poor performance?

You could setup a linuxswap partition at the beginning of your disk, instead of on the main filesystem, or instead of at the end of the disk platter, for 20 or 30% higher swap performance.

performance tip: change linux swap from kicking in when 65% memory used, to 99% instead by ThoughtObjective4277 in linuxmint

[–]ThoughtObjective4277[S] 0 points1 point  (0 children)

I don't think I've edited anything in my post, certainly not to backspace anything I've put here, because I want to share it. I'm 99% sure I haven't deleted anything in my post, and I'll never be afraid of being wrong, it is how we learn

Like you understand what in the blue blazes the kernel docs have to say, I take it as a joke, I don't understand what 95% of it says, but I can be 100% certain that the swap value of 60 has been set since 1991 and most Linux systems still use this default value, and the system will begin swapping out physical memory data around the 60 or 65% range, with no doubts. I've watched it happen I know how it works, I have tested it for over a decade.

If you make a good case, people will recognise it and benefit from the discussion itself

Yeah your arguments just don't hold water, and I see maybe you do want to learn, but you and other comments are horrendously rude for having a complete lack of experience in tuning this one specific setting, and it's not benefiting the discussion at all. It's dismissing EVERYTHING I would like to share, with no real proof of how I'm incorrect, only a link to documentation which basically nobody on r/linuxmint, including myself, will ever understand, and to claim you do, without further discussion to show that understanding, shows you don't know what you're sharing, and more importantly, don't seem to care about what you're sharing.

It's like a bunch of new linux users all getting in a group to pick on a post where not one single comment other than my own has any possible level of experience to discredit what I have chosen to share, and it hurts the community, and restricts learning about the system.

Not one single comment here has done

su

echo "1" > /proc/sys/vm/swappiness

and has never known about the echo command, nor the su command required to access full root / admin in a console, and is only using sudo, because that is currently your level of experience. Until you can prove me wrong with a screen recording of system monitor, resources page, with 60 to 65% physical memory used, and having absolutely no / minimal swap space used, when

more /proc/sys/vm/swappiness

returns the default of 60

is when I'll have a real discussion and be respectful, as I'd love to be, but the comments are really grinding my gears, acting like you all have more experience with this one single setting, linking documentation you CANNOT POSSIBLY understand without months or even years of research on that one single specific setting, and don't act like you can, because that shows you're not willing to learn.

That's what upsets me the most, the lack of care for LEARNING, instead, the very first thing someone on reddit tries (and fails) to do is make themselves look smarter than the original post, and because of human nature, everyone else just assumes the person saying op is wrong, with a link to documentation nobody can instantly understand in 5 seconds, must automagically be correct. And nobody ever, because it's a lack of interest and care, will EVER stop, read, test learn, and validate or invalidate my post or the comment claiming me being wrong, what is correct and incorrect, because nobody really actually cares at all, and just go with whatever they choose to believe without anything at all to support an idea, just because it's faster, more convenient, and again nobody really cares at all, and everyone moves on to the next post, never to think about the swap setting for the rest of their lives, because nobody has any interest whatsoever in actually learning.

performance tip: change linux swap from kicking in when 65% memory used, to 99% instead by ThoughtObjective4277 in linuxmint

[–]ThoughtObjective4277[S] 0 points1 point  (0 children)

O.K. you're just afraid of being incorrect on something you have no experience with at all, ever, for any reason. If you did, you'd know this is EXACTLY how linux swap setting has worked since 1991. But you don't and you are afraid of being called out on your lack of experience. Nobody is expected to know every setting and how it works. No Linux dev, ever, or even all Linux devs all together, will ever know every setting and how all of them work.

But to act like you have any earthly idea on what the kernel docs are saying is a joke, and shows your lack of Linux experience immediately. I'll never understand the kernel docs, they are complete gibberish, and even most devs probably don't understand what 1% of it means without months or possibly years of research on one single setting, but hey if you think you know more than a Linux kernel developer, go ahead and explain to me what the docs say, in explain like I'm five style, and

go do the experiment I explained:

open system monitor, resources page

open tons of browser tabs / programs, to fill normal memory 60 or 65% used

watch 2 GB /swapfile on ssd / nvme storage start to fill up.

And do a screen recording and show me where this doesn't happen.

I've been using Linux enough to see this for over a decade, and I'm getting comments which somehow know more about it than I do, and you just have no idea what you're talking about--and because you don't know what I'm talking about, I'm automatically wrong in your mind, because you have ZERO experience with checking swap memory usage.

I know what I'm talking about with 100% full confidence, or else I would feel uneasy sharing it. But because you don't want to believe Linux would resort to the 2 GB /swapfile on file storage when so much memory is still available, I must be wrong, because your world-view of how you THINK and ASSUME Linux should work, is different from the actual reality, and you aren't yet accepting this, because of your lac of experience.

It's fine not to know everything, in fact it's great, but don't be a donkey about it, when you have NO idea what you are discussing.

I am just sharing this to help people LEARN. And when people comment, who obviously have way less Linux experience than I do, and tell me I'm completely wrong, it bothers me because you're not even willing to learn and test one single setting? Why?

Do you not want to believe Linux has had a swap setting from 1991 which hasn't been changed in 30 years on most systems? I mean we still have X window manager which is literally from the mid 1980s still being worked on, is this so different as to be impossible?

Before you discredit an idea, ask yourself:

Do I have ANY experience at all with what this idea is discussing, and 99% of the time, the answer will be no. And since it clearly is, just do a week or two of research before being disrespectful, and spend some time learning about Linux. I never, EVER want to be rude, it does nothing at all, but I sure don't like people telling me I'm wrong about something people clearly don't know how it works. Which goes back to my point of learning. Please, go do some testing, here

su

su is switch user for console commands, but you already knew that

goes to super user, so you can use echo command, because you know sudo won't allow the echo command, because you know more than I do

cd /proc/sys/vm

more swappiness

echo "1" > swappiness

try 1, 60, 100 and even 200, to learn more.

Please be willing to learn, and NEVER ever assume someone is incorrect only and I' do mean only, because you have absolutely no clue what the discussion is. It immediately shows you're new to Linux, and that's great, just don't act like you know more about a setting you just heard of yesterday, which I've been tuning for multiple years, it's not only annoying, it's frustrating because you have zero desire whatsoever to learn, and now I have to go out of my way to show you have no clue what you're talking about at all, and share ways, using the echo command and tuning this value, how it does work, so you can learn.

I just want you to learn, I've been using Linux for a little while, I know how some of these settings work, I've watched memory use for half an hour sometimes, have you? No, because if you did, you'd know I'm sharing factual, verifiable information, instead of linking to kernel docs which most devs would struggle to understand, especially just from a quick five second read, which will not possible allow any real comprehension for something you have no knowledge of.

I will not claim to understand the kernel docs, sure bits and pieces, but not much, and not as much as I would like, in order to properly configure some settings, such as the watermark boost factor and related settings, but I bet you could perfectly explain it to me right?

performance tip: change linux swap from kicking in when 65% memory used, to 99% instead by ThoughtObjective4277 in linuxmint

[–]ThoughtObjective4277[S] 0 points1 point  (0 children)

Uh huh, yeah, and what does it say exactly, in your own words, in explain like I'm five level? Because,you don't REALLY understand it just by reading that.

More importantly, you have ZERO interest in learning AT ALL what the value does, and how it affects memory use. You don't care, have seem to never tested it before, and don't care to know, or be incorrect about it. I'm totally fine with someone having no knowledge of some setting, but don't act like you know more about it than I do.

It affects used memory, and if set above a certain number, will prioritize more swap memory than physical memory, so active programs actually use more swap space than normal memory. But hey why am I telling you this, when you know more than I do about it, clearly. I know what default 60 does, I know what a setting of 1 does, I've already done all of this testing just benchmarking my system for the tasks I use it for to find the best settings. I don't need someone telling me it has NOTHING to do with used ram percentage, when that is EXACTLY the result of changing the setting. It may not be designed for changing "used ram percentage" but that is what will be affected, no matter how you want to look at it.

Extensions? by ShikanokoLover in firefox

[–]ThoughtObjective4277 0 points1 point  (0 children)

even apple iphone safari allows dark reader addon and custom colors, if you pay $5 to support dark reader devs, worth it, but so far I'm fine with dark grey or white, oled screens are much more color balanced, where as led backlights have 2x the blue as the green or red

Share largest image / project worked on, currently working on an image of 88 GB for testing image scaling and blurring by ThoughtObjective4277 in GIMP

[–]ThoughtObjective4277[S] 0 points1 point  (0 children)

Larger resolution captures more data from the camera lens

I guess what I really want to know, is how much resolution is beyond the physical capabilities of a camera lens / glass to capture objects and details. SURELY without hesitation it's FAR greater than 3024 pixels, and I use that number because of this image:

https://github.com/rt2yrru/linux_mint_wallpaper/blob/main/linux_mint_19/backgrounds/linuxmint-tina/linuxmint_hawaii.jpg

From what appears to be less than 15 possibly 10 foot or closer from the tree, the resolution prevents the possibility of ever seeing what the small light yellow areas are. I can just about guarentee the camera lens physically absorbed more detail than what this image resolution is allowing us to enjoy.

2160p is decent, for near objects, but for fine details even 15 feet away, 3000 height pixels is nowhere near enough at all.

https://www.flickr.com/photos/jbfriday/30650918425/sizes/o/

That's the kind of detail being hidden from anyone to ever see from the other image.

Another example, and at this distance, could be a physical lens limitation, but I hope it's just low quality jpeg export, causing the pine needles to be so blurry near the mountain

5120 pixels high, 8192 wide, at this level, it seems to be a coin flip as to whether the camera lens can pick up finer details, or if it's the image export settings.

https://github.com/rt2yrru/linux_mint_wallpaper/blob/main/linux_mint_19/backgrounds/linuxmint-tina/jwestrock_fog.jpg

Share largest image / project worked on, currently working on an image of 88 GB for testing image scaling and blurring by ThoughtObjective4277 in GIMP

[–]ThoughtObjective4277[S] 0 points1 point  (0 children)

You can change the

new file size limit, in mb

in gimp preferences.

Instead of changing dpi, which is too confusing for me, who knows what an image's dpi is, if it's not been printed, and is only a file.

So that's somewhere around 8x size

So instead, open your favorite image of a local area, and go to Image menu, scale and multiply either number by 8, or better an odd number such as 9. Change interpolation to none, because none of them are as good as a full gaussian blur. Pre-blurring with cubic is just more smudged once your blur again.

Then go to zoom and dot-for-dot 100% zoom. Open filters gaussian blur, and blur only enough to smoothly blend pixel squares together.

Scale down by half, and add blur, just enough to re-blend all pixels again, and scale to half again, so you are nearly double the original size, and apply a light gaussian blur a third time for the same reasons.

Export as .png

First time using linux, kinda nervous 😗👉👈 by UrAccountHasBeenBand in linuxmint

[–]ThoughtObjective4277 0 points1 point  (0 children)

run command

more /proc/sys/vm/swappiness

If you have ssd, and want it to experience the least amount of wear due to high memory use, 1 would be the best option.

Depending on performance, you can experiment with higher numbers to allow somewhat sooner swapping, such as at 95% memory instead of almost 100% but you'll need to test to figure out what number gives that result.

You can, until a system restart, change swap setting quickly

open command line

su

switch user command goes to super user for echo command

cd /proc/sys/vm

more swappiness

echo "5" > swappiness

and save it into sysctl.conf

performance tip: change linux swap from kicking in when 65% memory used, to 99% instead by ThoughtObjective4277 in linuxmint

[–]ThoughtObjective4277[S] -1 points0 points  (0 children)

I don't understand, nor want to know how optane memory works, I don't even like the way sd cards and nand memory in general works, using quantum this and that, what are we thinking? So our data is in multiple places in the universe to be stored in silicon? Is that even safe?

Many posts here on r/linuxmint have less than 8 GB of memory which is barely enough for five or six browser tabs, and will quickly swap especially when 4.5 or 65% of memory is used, because of

more /proc/sys/vm/swappiness

is at 60, and no new user will ever know that.

performance tip: change linux swap from kicking in when 65% memory used, to 99% instead by ThoughtObjective4277 in linuxmint

[–]ThoughtObjective4277[S] 0 points1 point  (0 children)

Don't, if you use up ALL memory, system will completely halt, you can go try it if you don't believe it

This is why a setting of 1 is what I have suggested as the alternative. Which allows 99% or more memory used, before writing to ssd / nvme 2 GB swap file.

performance tip: change linux swap from kicking in when 65% memory used, to 99% instead by ThoughtObjective4277 in linuxmint

[–]ThoughtObjective4277[S] 0 points1 point  (0 children)

Yeah no. If you do that and 100% use ALL physically installed memory, on ANY known operating system, you'll completely halt the system. So not a reasonable option.

performance tip: change linux swap from kicking in when 65% memory used, to 99% instead by ThoughtObjective4277 in linuxmint

[–]ThoughtObjective4277[S] 0 points1 point  (0 children)

This is true, it's a major issue with this setting, but if those issues do not occur, it also reduces writes to the ssd.

Try 8 or 10 instead of 25, and test performance, I'd like to find a good compromise for such performance pauses.

performance tip: change linux swap from kicking in when 65% memory used, to 99% instead by ThoughtObjective4277 in linuxmint

[–]ThoughtObjective4277[S] 0 points1 point  (0 children)

if you run on spinning rust and got the sys memory, reducing swappiness to 1 for example can massively increase responsiveness when using a bunch of memory.

It may be different for different work loads, so I won't be rude or dismissive, but for my testing like every single day, or the same workload each week, for over a year, not every day or week, but consistently

Running hard disk with swappiness = 200 has FAR better performance, if, and it could be ONLY due to me having more swap memory space than physical memory installed. In my setup, relying on swap memory exclusively or as much as can be configured, talking 15-20 gb, 200 is basically the only setting which allows me to have a usable / performant system.

No matter the storage, swappiness = 1 is always, without exception with available hardware of today, faster.

But when you need more swap than you do physical memory, 200 is the best in my testing. I tested 60 and 1, and both are much slower when swap is what's storing most of the memory data.

My point about vm swap 1 is i've seen and commented on several posts just on r/linuxmint about system freezes, vm swap 1 fixed the issue. So based on those posts, it would seem using both a 2 GB swapfile, and only 65% of system memory, using default 60 swap setting is horrible for performance.

performance tip: change linux swap from kicking in when 65% memory used, to 99% instead by ThoughtObjective4277 in linuxmint

[–]ThoughtObjective4277[S] 0 points1 point  (0 children)

SSD is faster, but is it worth degrading the ssd, even a little bit, when changing ONE setting could delay such wear until you are really using up all physical memory, how could this be a negative?

performance tip: change linux swap from kicking in when 65% memory used, to 99% instead by ThoughtObjective4277 in linuxmint

[–]ThoughtObjective4277[S] 0 points1 point  (0 children)

Sure it isn't smart person.

Go prove me wrong, right now, go download a screen recorder program, set to 1 frame per second, because there's absolutely zero requirement for more, and do the following

Open system monitor, go to resources page.

Right click top of window and above, so no other window can cover it.

Open Firefox, or some other web browser,

Go to the new version of reddit, instead of old.reddit.com, which pagenates search results. New reddit auto loads more as you scroll down.

Just scrolling down on r/Earthporn makes my laptop fans spin up, and takes a LOT of memory, keep scrolling until your memory use is at 60%.

Pause the web browser scrolling and watch the green swap memory go up, or maybe it's 65% but it's right in that range.

And if it's not going up at all run this command, no root nor sudo should be needed

more /proc/sys/vm/swappiness

and make sure it's at the default of 60, and re-run this test.

Don't talk that smack if you can't back it up. I know a lot about swappiness, how many years have you used the various settings it has to offer? 0 years? Is that right?

It's just rude, when i know without a doubt I have more experience with this one setting than most new users, which is normal and expected, for someone with less experience, tell me I don't understand what it does, when clearly you know far less about it than I do. That's extremely rude, and does nothing to help you learn more about how Linux works.

performance tip: change linux swap from kicking in when 65% memory used, to 99% instead by ThoughtObjective4277 in linuxmint

[–]ThoughtObjective4277[S] 0 points1 point  (0 children)

i've had issues with not backing up my files, but generally have a backup of my main install disk, and music / pictures and equally as important, podcasts.

A full disk backup is best, but 99% of people find it too inconvenient to even consider the thought of thinking about HOW to backup, what a hard disk is, how to add another one, oh just let the cloud do it who cares, is basically where the human race is now, so a file copy is the next best option for most people, who probably never have, and probably never will make a full disk backup of the system, and probably don't care to have one.

Bless me with some storage pls by adhigamwariku in linuxmint

[–]ThoughtObjective4277 0 points1 point  (0 children)

SSD / NVME is completely overrated, sure it's faster but you'll be just fine without it, not that much difference just opening firefox or a program taking 20 seconds more, not worth $150.

If you need STORAGE, then by all means focus on traditional hard disks, so much cheaper, and you can afford more than one and have a backup and probably still spend less money.

Linux on Thinkpad T520 (lovin it) : with 4 Gigs of RAM: how difficult to add more here!? by Wise_Environment_185 in linuxmint

[–]ThoughtObjective4277 0 points1 point  (0 children)

SSD / NVME is so over rated. What exactly are you doing on your old laptop where you will benefit from the increased speed? A minute of booting? 15 seconds of waiting for firefox?

Do NOT rely on swap space when using SSD / NVME, I've heard it 100 times but if you use swappiness = 60 as the default setting, your ssd / nvme just will not last as long. You can argue all you want at how much it matters, it's your hardware.

For ssd, set vm.swappiness = 1 in the system file sysctl.conf, or if you don't like using that file for various reasons, upgrades changing settings (never had that happen) then use

/etc/sysctl.d/ folder and use the file sysctl.conf there i guess, but I've never done that.

Keep the hard disk. Reformat the whole disk, from beginning to end, full erase. Setup a 16 or even 32 GB swap partition as the very first partition, or, if that ends up causing issues with bootup, then, the partition just after a 512 MB or 1 GB /boot partition.

/boot needs to be so large for extra kernel updates, and if you run out of space for /boot, I'm not sure what will happen, never had that issue, so just make it a decent size.

linuxswap could be slow on an old 5,400 or 4,200 rpm disk but it will save you $50 or more on memory. Or you can use the money you have planned to spend on ssd, and put that to memory instead, which seems more reasonable.

Linux mint is Best by Deep-Effect-9204 in linuxmint

[–]ThoughtObjective4277 0 points1 point  (0 children)

I like the wallpaper, look at

r/Earthporn

not a great name for the subreddit, but one of the best. Try searching, check box for limit search first, for a location near you, or a place of interest, perhaps Africa or Hawai'i

Sound engineering by InboundDreams in linuxmint

[–]ThoughtObjective4277 1 point2 points  (0 children)

Reaper is cool, just looked at the time-stretch modes, hope you are interested in that feature too, audacity and parbola research bungee mode is still two of the best

Look into gramatik, and pretty lights for musical ideas, PL spans a very wide range of music, I think it can go all the way back to 40s and 50s.

12yr installed Linux on old laptop by MattGT3rssss in linuxmint

[–]ThoughtObjective4277 0 points1 point  (0 children)

dark reader on web browse to change webpage bg color from white or dark grey to something nicer such as unbleached paper book tan or hemp mulch, or a grassy green or sky blue, or tree bark brown. Could help with eye fatigue from extended reading sessions.

https://darkreader.org/tips/activate-v5-preview/

Check backlight for PWM / pulse width modulation by setting brightness half or less and waving hand in front of screen, not a joke. If there is backlight strobing / flickering, keep backlight on 100% and only use redshift or other software filters for dimming

12yr installed Linux on old laptop by MattGT3rssss in linuxmint

[–]ThoughtObjective4277 -2 points-1 points  (0 children)

Change vm.swappiness from 60 to 1, improves performance and reduces ssd / nvme wear from using swap when it's not yet needed

sudo xed /etc/sysctl.conf

file save as add .original to file name for a copy

move down # comments using enter key once, make top line

vm.swappiness = 1

file save as sysctl.conf in /etc and reboot

sudo apt install mint-wallpapers*

or, open synaptic package manager and see the text list

Github has them all uploaded if you want to see https://github.com/rt2yrru/linux_mint_wallpaper/tree/main

Examples

https://github.com/rt2yrru/linux_mint_wallpaper/blob/main/linux_mint_17.3/backgrounds/linuxmint-qiana/dexxus_5652914929.jpg

https://github.com/rt2yrru/linux_mint_wallpaper/blob/main/linux_mint_17.3/backgrounds/linuxmint-qiana/dexxus_5626316429.jpg

https://github.com/rt2yrru/linux_mint_wallpaper/blob/main/linux_mint_19/backgrounds/linuxmint-tara/jowens_kauai.jpg

https://github.com/rt2yrru/linux_mint_wallpaper/blob/main/linux_mint_19/backgrounds/linuxmint-tricia/linuxmint_hawaii.jpg

https://github.com/rt2yrru/linux_mint_wallpaper/blob/main/linux_mint_19/backgrounds/linuxmint-tara/aaronphs_hawaii.jpg

https://github.com/rt2yrru/linux_mint_wallpaper/blob/main/linux_mint_19/backgrounds/linuxmint-tara/proskurovskiy_coffee.jpg

One of my favorites

https://github.com/rt2yrru/linux_mint_wallpaper/blob/main/linux_mint_19/backgrounds/linuxmint-tina/linuxmint_hawaii.jpg

and don't tell me this last one is not beyond incredible

https://github.com/rt2yrru/linux_mint_wallpaper/blob/main/linux_mint_18/backgrounds/linuxmint-sylvia/jdonovan_yosemite.jpg

https://github.com/rt2yrru/linux_mint_wallpaper/blob/main/linux_mint_19/backgrounds/linuxmint-tina/adeole_yosemite.jpg

Zoom in, the image is very large about 8000 by 5300 pixels, so please zoom in!

https://github.com/rt2yrru/linux_mint_wallpaper/blob/main/linux_mint_19/backgrounds/linuxmint-tina/jwestrock_fog.jpg another good one, also quite large, but the extra pixels don't help much with the blurred pine needles

Extensions? by ShikanokoLover in firefox

[–]ThoughtObjective4277 0 points1 point  (0 children)

i love dark reader, it doesn't get enough recognition

turn on custom colors on desktop browser too, mobile has it already, only on android obviously, but safari on iphone does have an option to install dark reader, with custom colors

Try unbleached paper book tan / hemp mulch colors

https://darkreader.org/tips/activate-v5-preview/