johnsfine |
03-20-2010 04:11 PM |
Quote:
Originally Posted by uncle-c
(Post 3905773)
I had been using the system for so long without any swap I am now begining to wonder if it would be any use at all
|
It is very possible for use of swap space to make the system run faster in cases where you don't "need" swap space, meaning the things you are running won't flat out fail for lack of swap space.
The important fact is that most "swapping" is not from the swap space. I expect some argument about the word "swapping" there. But there is no better word for the practical meaning.
Most "swapping" is from read only mappings.
Swapping to/from swap space is inherently twice as expensive because it is to/from, while read only mappings are only from. So the Kernel is biased against the activity described by the narrower meaning of "swapping" (to/from swap space).
But actual access patterns vary by far more than two to one. So many disk accessed might be saved by each pair of disk accesses to swap something stale to/from swap space.
Quote:
Originally Posted by Quakeboy02
(Post 3905842)
As you've kinda figured out, swap serves no real purpose until you need it.
|
Based on previous threads, I won't try to convince you otherwise. But I want to make sure the OP and others reading this thread know there is an opposing viewpoint on that.
Quote:
I've just settled into recommending 1GB or so of swap for everyone.
|
On one hand, that is as invalid as every other rule of thumb for swap size. If you don't know what will be run on the system you have no basis for estimating the appropriate amount of swap space. On the other hand, virtually no one knows enough about what they will run on their Linux system and how memory will be used to make an informed decision about swap space size. Your unsupported guess of 1GB is probably better than most guesses. (Small enough to usually not waste important disk space when it is too large; Big enough to give a decent chance of at least understanding the problem when it is too small and big enough to rarely be too small for ordinary home users of Linux).
Quote:
Those who need more will eventually understand that what they really need is more RAM.
|
Hopefully those who just need more swap space will figure that out too.
There really are cases where more swap space allows massive problems to be solved and only slightly slower than they could be solved with absurd and expensive amounts of ram. Swap space is a lot less expensive than ram. Most people don't need enough of either for the cost to be significant. But if you do need a lot it's worth figuring out which you need.
|