What's your swappiness set to, eh?
- Gordon Cooper
- Posts: 965
- Joined: Mon Nov 21, 2011 5:50 pm
Re: What's your swappiness set to, eh?
Must say that I have never looked to see if swap is being used, have always set it well above the RAM, possibly remembering a few years
back when I was testing a CAD program update before it was released. Running on Win XP, it had been going about 5 minutes when everything went very slow. So I doubled the virtual memory - a piece of HD allocated for the job. This time, slow after 10 minutes, then became worse. Eventually discovered that the author had omitted the codes to clear temporary memory after each calculation so RAM filled up then the virtual memory, no matter how big it was.
back when I was testing a CAD program update before it was released. Running on Win XP, it had been going about 5 minutes when everything went very slow. So I doubled the virtual memory - a piece of HD allocated for the job. This time, slow after 10 minutes, then became worse. Eventually discovered that the author had omitted the codes to clear temporary memory after each calculation so RAM filled up then the virtual memory, no matter how big it was.
Backup: Dell9010, MX-19_B2, Win7, 120 SSD, WD 232GIB HD, 4GB RAM
Primary :Homebrew64 bit Intel duo core 2 GB RAM, 120 GB Kingston SSD, Seagate1TB.
MX-18.2 64bit. Also MX17, Kubuntu14.04 & Puppy 6.3.
Primary :Homebrew64 bit Intel duo core 2 GB RAM, 120 GB Kingston SSD, Seagate1TB.
MX-18.2 64bit. Also MX17, Kubuntu14.04 & Puppy 6.3.
Re: What's your swappiness set to, eh?
The default value of 60 seems awfully high to me. I don't want my HDD thrashing around until the free memory gets down to 10% or so. With 4GB of installed RAM (minus a small amount used for video), I've seldom seen swap used running Linux unless I'm running resource-hungry applications like Snapshot and DeVeDe or when I've allocated 2GB of RAM to a VM running in VirtualBox. Windows used swap all the time, which resulted in a lot of thrashing. I pointed the Windows swapfile to the secondary HDD, to make life easier for the main HDD. Of course I don't run Windows at all any more, so my HDDs should last a long time (knock on wood).
MX-14; 3.12-0.bpo.1-686-pae kernel using 4GB RAM
2.4GHz AMD Athlon 4600+
NVidia GeForce 6150 LE; 304.121 Display Driver
You didn't slow down because you're old; you're old because you slowed down.
2.4GHz AMD Athlon 4600+
NVidia GeForce 6150 LE; 304.121 Display Driver
You didn't slow down because you're old; you're old because you slowed down.
Re: What's your swappiness set to, eh?
Code: Select all
$ free -h
total used free shared buffers cached
Mem: 7.9G 2.4G 5.5G 0B 145M 1.2G
-/+ buffers/cache: 1.1G 6.8G
Swap: 8.0G 0B 8.0G
Yes, even I am dishonest. Not in many ways, but in some. Forty-one, I think it is.
--Mark Twain
--Mark Twain
-
- Developer
- Posts: 372
- Joined: Mon Apr 16, 2012 4:51 pm
Re: What's your swappiness set to, eh?
I generally work with a kind of mental ratio or balance with swappiness and swap size. No real reason and do not know if it is actually a good way to do things. Just seems to work out well for my figuring.
I like to keep the memory allocation around 4gb total, more is ok.
So for a machine with 1 gb ram I try around 3gb swap, default swappiness
A machine with 2 gb ram, 2gb swap, 50 swappiness
A machine with 3 gb ram 1gb swap, 25 swappiness
4 and up 1gb swap, 10 or less swappiness. The swap I find is just to keep things happy. I don't really think swap is needed at 4gb and above ram for most purposes... but I have seen machines still have plenty of free ram and yet still display hanging / delayed actions due to a lack of swap.
I like to keep the memory allocation around 4gb total, more is ok.
So for a machine with 1 gb ram I try around 3gb swap, default swappiness
A machine with 2 gb ram, 2gb swap, 50 swappiness
A machine with 3 gb ram 1gb swap, 25 swappiness
4 and up 1gb swap, 10 or less swappiness. The swap I find is just to keep things happy. I don't really think swap is needed at 4gb and above ram for most purposes... but I have seen machines still have plenty of free ram and yet still display hanging / delayed actions due to a lack of swap.
- Gordon Cooper
- Posts: 965
- Joined: Mon Nov 21, 2011 5:50 pm
Re: What's your swappiness set to, eh?
In Linux, does the swappiness remain at the set %, or can it vary because of coding in application software?
Backup: Dell9010, MX-19_B2, Win7, 120 SSD, WD 232GIB HD, 4GB RAM
Primary :Homebrew64 bit Intel duo core 2 GB RAM, 120 GB Kingston SSD, Seagate1TB.
MX-18.2 64bit. Also MX17, Kubuntu14.04 & Puppy 6.3.
Primary :Homebrew64 bit Intel duo core 2 GB RAM, 120 GB Kingston SSD, Seagate1TB.
MX-18.2 64bit. Also MX17, Kubuntu14.04 & Puppy 6.3.
Re: What's your swappiness set to, eh?
I doubt that applications have any say at all concerning SWAP. That's OS territory.
I've never run without a SWAP. But I used to (long time ago) have problems occasionally when I had two. Per the free -h I have a total of 8 GB due to two disks. sdb was auto partitioned/installed by the Installer I was using having given it the whole disk to auto-install. I've not had any problems with two SWAP partitions in many years.
I've never run without a SWAP. But I used to (long time ago) have problems occasionally when I had two. Per the free -h I have a total of 8 GB due to two disks. sdb was auto partitioned/installed by the Installer I was using having given it the whole disk to auto-install. I've not had any problems with two SWAP partitions in many years.
Yes, even I am dishonest. Not in many ways, but in some. Forty-one, I think it is.
--Mark Twain
--Mark Twain
- Gordon Cooper
- Posts: 965
- Joined: Mon Nov 21, 2011 5:50 pm
Re: What's your swappiness set to, eh?
Thanks Lucky. Have never had any Swap problems myself, but remembering past XP experiences, was wondering if Swap was completely
managed by the OS, or if a badly written app could rock the boat. On this machine there's more Gigs that I would ever use, so have Swap set to 10 Gigs and I just don't worry about it.
managed by the OS, or if a badly written app could rock the boat. On this machine there's more Gigs that I would ever use, so have Swap set to 10 Gigs and I just don't worry about it.
Backup: Dell9010, MX-19_B2, Win7, 120 SSD, WD 232GIB HD, 4GB RAM
Primary :Homebrew64 bit Intel duo core 2 GB RAM, 120 GB Kingston SSD, Seagate1TB.
MX-18.2 64bit. Also MX17, Kubuntu14.04 & Puppy 6.3.
Primary :Homebrew64 bit Intel duo core 2 GB RAM, 120 GB Kingston SSD, Seagate1TB.
MX-18.2 64bit. Also MX17, Kubuntu14.04 & Puppy 6.3.
Re: What's your swappiness set to, eh?
I have machines used for desktop purposes only, (internet, music, movies, etc), & which have 1GB of ram & no swap at all, I don't have any problems using them on a daily basis.
Re: What's your swappiness set to, eh?
I don't think apps do that regularly, but you can technically have an app running as root modify the swappiness. Let's say that there's a tool that needs for some reason to modify the swappiness, it can simply call this command "sysctl vm.swappiness=xx"I doubt that applications have any say at all concerning SWAP. That's OS territory.
Re: What's your swappiness set to, eh?
Code: Select all
total used free shared buffers cached
Mem: 1.9G 1.6G 286M 0B 21M 1.4G
-/+ buffers/cache: 249M 1.7G
Swap: 7.9G 81M 7.8G