Hi,
but don't have time to read all of it... there is a comment
somewhere in
there though that shows that Linus should shoot himself though.
What happened was that once upon a time Linus said that anyone who says Disk Is Cheap needs to be shot. However some time later a suggestion was put forward for cleaning up swap space more effectively for those systems where VM/Swap issues were a primary concern (Low Memory/Disk Space) - which Linus rejected, I think because the overhead it would create is not justified for the few systems which would benefit - his point being that since Disk Is Cheap (tm) they can always add more swap! Thus we await news of Linus' suicide....
To increase a servers speed- add more RAM, to increase it further add EVEN MORE RAM.
This is true but only to the point that you have more than enough RAM. After that alot of other issues come into play (also I/O intensive processes will not necessarily see much of a performance increase no matter how much RAM...). Where you will have alot of 'idle' processes these can be quite happily swapped out, thereby using 'alot' of swap space but actually benefitting performance (because they live in swap semi-permanently). Thus VM management makes more RAM available to more intensive (and rarely idle) processes, meaning you can get better performance with not so much RAM by allotting plenty of swap to effectively get rid of those processes which hog RAM without needing it very often. With me so far? These benefits fall away as soon as you start filling RAM with processes which do not benefit from being swapped out too often. You then require intensive swap activity for VM Management when any 'active' process requests more memory - pushing another 'active' process out to disk in the meantime.
My bets are: loadsa RAM, small swap. I think the 2xRAM thing was also partly due to RAM being expensive once-upon-a-time.
My Bet is loadsa RAM, plenty swap. There is a logic to the 2XRAM thing - which I think is fairly summed up as follows : As I understand it a memory page will temporarily inhabit both RAM and SWAP whilst in the process of being swapped (ie it will Mirror its own memory space in both as it is copied from one to the other). Therefore you theoretically need as much swap per process-page as RAM for this to happen. So 1:1 RAM:SWAP would not truly meet theoretical VM requirements - you need an allowance. So a further 50-100% is reasonable. (Of course in practice you never really swap everything so you're back to square one ...)
This thread had me going because I could never decide how much swap to set up, but I think I about sussed it when I moved from RedHat 6 to Debian 2.2 and decided to try and get a good guestimate from the running Red Hat machine rather than just a number that I thought sounded good. Penned a few thoughts but unfortunately the whole thing gets a little waffly, apols for this :
What I tried was to make as full a list as possible of the processes which will run and get a decent estimate of their usual memory requirements (I think some good examples have already been posted - but a little work with 'top' on my running box got me some reasonable figures). I then split the list into two parts : 1) processes which (I think) will startup and then fall into the background quickly and require very little additional processing for 'long' periods (thus will likely be swapped out), and 2) those which once up are probably best staying in RAM for their entire life (eg MP3 encoders, PPPD sessions and the like - and Practically Any Desktop App). This was more a gut thing than any intimate knowledge of the processes. I made sure I had at least as much RAM for as many 'busy type' processes as I could envisage running simultaneously plus some allowance (as it was I only had 128Mb but this seemed OK). Firstly I allowed as much swap as RAM as my starting block (thus 128Mb - 1:1). Then I allowed enough swap for the SUM of the requirements of all of the 'idle type' processes and added a reasonable allowance (50%), then I added some allowance for the other 'busy type' processes (another 50% of their requirements). I found that got me to about 300M so I allowed 512M Swap (being generous - Disk is Cheap(tm)).
I tend now (post change) to use about 90M RAM while doing normal stuff (eg. playing an MP3 file while surfing the web under Gnome - with a couple of other apps/terminals open) with a little swap usage (those 'quiet' processes...?). However - when I fire up The Gimp and edit an XCF File that has 20 Layers, with plenty of undo levels (I allow 64Mb 'Tile - Cache' under Gimp) while still playing an MP3 (or even burning one) I can see (and hear) the swap usage shoot up. I have yet to see greater than 10% (50Mb) Swap usage so I was maybe over generous but this is actually a good thing performance wise - you DO NOT want to use too much swap - think of those little number/word puzzles with the plastic tiles and one place free where you slide the tiles around trying to make the pattern/word and you'll get the gist of this. You need room to move to avoid fragmenting your memory and swap space which will take ages for VM Management to sort it - knocking your performance for six.
Sorry if this is absolute codswallop in the end but it sort of worked for me so I hope it is of value. My Machine runs pretty smoothly even when I have alot of processes active, though a leaner kernel would probably be a good thing - but thats a different story.
Cheers Earl
[earl.brannigan@lindenhouse.co.uk] www.lindenhouse.co.uk Intellectual : Someone who can spend a whole day locked in a room with a tea cosy without once thinking of trying it on. Highbrow : Someone who can listen to the entire William Tell Overture without once thinking of the Lone Ranger.