Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Where is my Swappiness Coming From Now? [Solved]
Where is my Swappiness Coming From Now? [Solved]
Last thing I did setting up a new 9.4 install was attempt adjusting swappiness. 1st try was a gksu/editor with my user logged into Gnome. System hung, restarted, no biggie. But swappiness returned to the stock setting of 60. Logged out, did it again from Nano in a root console - same result. The 60-value setting is obviously being re-applied at boot. SO the topic question remains - any advice? Or possibly, why am I attempting to do this incorrectly?
Last edited by acewiza on 2018-03-16 02:58, edited 1 time in total.
Nobody would ever ask questions If everyone possessed encyclopedic knowledge of the man pages.
Re: Where is my Swappiness Coming From Now?
I've never really seen the need to change from the default, but I have had questions about swap and saved some links...
http://northernmost.org/blog/swap-usage-5-years-later/
http://www.linuxjournal.com/article/10678
http://blog.scoutapp.com/articles/2015/ ... -you-worry
http://northernmost.org/blog/swap-usage-5-years-later/
http://www.linuxjournal.com/article/10678
http://blog.scoutapp.com/articles/2015/ ... -you-worry
Kernel maintainer Andrew Morton has stated that he uses a swappiness of 100 on his desktop machines, "my point is that decreasing the tendency of the kernel to swap stuff out is wrong. You really don't want hundreds of megabytes of BloatyApp's untouched memory floating about in the machine. Get it out on the disk, use the memory for something useful." TL;D
resigned by AI ChatGPT
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: Where is my Swappiness Coming From Now?
I'm guessing next I'll be told it's always been like that?
Nobody would ever ask questions If everyone possessed encyclopedic knowledge of the man pages.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: Where is my Swappiness Coming From Now?
^ Hey, look, I was going to link you to this:
http://forums.debian.net/viewtopic.php?f=30&t=47078
But you seem to make some good contributions around here generally so I thought I'd let you have one for free
http://forums.debian.net/viewtopic.php?f=30&t=47078
But you seem to make some good contributions around here generally so I thought I'd let you have one for free
deadbang
Re: Where is my Swappiness Coming From Now?
I just directly edited /proc/sys/vm/swappiness before. Was I stupidly not actually doing anything? Wow. I thought it was doing something. System Placebo effect.p.H wrote:I do not understand what you mean. Could you please elaborate ?acewiza wrote:I'm guessing next I'll be told it's always been like that?
Nobody would ever ask questions If everyone possessed encyclopedic knowledge of the man pages.
Re: Where is my Swappiness Coming From Now?
A search on swappiness in this site did not return any useful information in the 1st page of hits. I'm still curious where I got the idea (years ago) to edit /proc/sys/vm/swappiness. Am I having another systemd epiphany?Head_on_a_Stick wrote:^ Hey, look, I was going to link you to this:
http://forums.debian.net/viewtopic.php?f=30&t=47078
Nobody would ever ask questions If everyone possessed encyclopedic knowledge of the man pages.
Re: Where is my Swappiness Coming From Now?
Hi
You can do:
nano /etc/sysctl.d/99-sysctl.conf
---
# Changing the swap usage: decreasing it:
vm.swappiness = 10
vm.vfs_cache_pressure = 50
Reboot
Read docuementation, if you need changes.
You can do:
nano /etc/sysctl.d/99-sysctl.conf
---
# Changing the swap usage: decreasing it:
vm.swappiness = 10
vm.vfs_cache_pressure = 50
Reboot
Read docuementation, if you need changes.
ThinkPad E14: Arch, Debian Stable
GUI: Xfce
For new: Try MX Linux, Linux Mint; later join Debian Stable
GUI: Xfce
For new: Try MX Linux, Linux Mint; later join Debian Stable
Re: Where is my Swappiness Coming From Now?
There is still management overhead, unless it is set to zero, more the higher it is set. Probably insignificant, so I guess you're right, for all practical purposes.Bulkley wrote:I think adjusting Swappiness is out dated. Modern computers have so much memory that the issue is moot.
And I don't get the logic here: "...hundreds of megabytes of BloatyApp's untouched memory floating about in the machine."
Apps I'm not using on a regular basis get closed. This particular 16Gig system typically uses around 50-60% RAM, depending on the number of VM's it is presently running. It will experience a noticeable slowdown occasionally, because launching another VM (which uses big chunks of RAM) at some point will start swapping when it doesn't really need to - unless swappiness is turned down.
I think the whole Swap thing is an outdated holdover from the bygone era when systems always seemed to be RAM or storage challenged in one way or another. SO again, it certainly seems "outdated" on it's face now.
Nobody would ever ask questions If everyone possessed encyclopedic knowledge of the man pages.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: Where is my Swappiness Coming From Now?
That file gets recreated afresh every boot so to change it permanently a sysctl setting is neededacewiza wrote:edit /proc/sys/vm/swappiness
See proc(5) for more.
deadbang
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: Where is my Swappiness Coming From Now? [Solved]
/proc is not a real filesystem, and anything under it is not a real file. It is just a convenient user interface to the kernel internals. And of course its contents is volatile.
So you must not use an editor to write into /proc/sys (the writable part in /proc), because editors usually expect to work on regular files. One mostly write values in /proc/sys with
or
A value can be set at startup with config files such as /etc/sysctl.{conf,d/*.conf}.
So you must not use an editor to write into /proc/sys (the writable part in /proc), because editors usually expect to work on regular files. One mostly write values in /proc/sys with
Code: Select all
echo "value" > /proc/sys/parameter
Code: Select all
sysctl -w parameter="value"
What you think is irrelevant to this thread.Bulkley wrote:I think adjusting Swappiness is out dated
That's what you think, but you're wrong. Un bunch of processes are running and never closed. For example : the display manager which starts your desktop environment session. All these processes keep unused data in memory (often data which are used only at startup and shutdown). These unused data can be swapped out to disk so that the memory is available for more useful data.acewiza wrote:And I don't get the logic here: "...hundreds of megabytes of BloatyApp's untouched memory floating about in the machine."
Apps I'm not using on a regular basis get closed.
Re: Where is my Swappiness Coming From Now? [Solved]
p.H wrote:That's what you think, but you're wrong. Un bunch of processes are running and never closed. For example : the display manager which starts your desktop environment session. All these processes keep unused data in memory (often data which are used only at startup and shutdown). These unused data can be swapped out to disk so that the memory is available for more useful data.acewiza wrote:And I don't get the logic here: "...hundreds of megabytes of BloatyApp's untouched memory floating about in the machine."
Apps I'm not using on a regular basis get closed.
That is the way I understand it also. Many apps allocate memory they only use once, or allocate more than they need. The kernel is always swapping, whether it's to disk or other pages in ram. By decreasing the tendency to get this unused or rarely used out to the swap file, you reduce the amount available for active page swaps. Also this decreases the amount left for file caching, which can cause more i/o than the swap you are trying to stop.
It's all speculation though without running some benchmarks for particular use. It sounds trendy though to lower swappiness, like it only controls one thing. It's a pretty complicated subject.
The reason I was interested is because it seems swapping 'out' seems to he happening a lot more on stretch than it did on jessie. Especially after a week or so of uptime, and after many suspend/wake cycles. I was concerned about it, until I realized the stuff going out wasn't really ever being swapped back in, or at least not that I could notice.
resigned by AI ChatGPT
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: Where is my Swappiness Coming From Now? [Solved]
Allocating more memory than needed is not a problem, because the kernel does not immediately allocate any physical memory. Physical memory pages are allocated on the fly when they are actually used (page fault).
Re: Where is my Swappiness Coming From Now? [Solved]
That's a good point, what I was thinking was not really more than needed and never used, but more than needed in a certain situation. For instance, I'm pretty sure that firefox-esr allocates a buttload of memory somewhere somehow for playing audio/video, which I never use at all through the browser. This can go to swap on disk and get out of my way and I have more physical ram for what I actually do. Just speculation though, I haven't really dug into it that much. Xorg and some terminal programs seem have pages that get swapped out to disk easily also.p.H wrote:Allocating more memory than needed is not a problem, because the kernel does not immediately allocate any physical memory. Physical memory pages are allocated on the fly when they are actually used (page fault).
I'd like to explore better ways to pin it down, so far I've been using top, hitting f, selecting swap with spacebar, then q and watching a little while. there's got to be a better way...
resigned by AI ChatGPT