Linux swap partition

kornermi

Member
Nov 4, 2000
127
0
0
I have 256MB system memory. Redhat manual says swap partition size needs to be at least the system memory size but doesn't have to be more than 256MB. So, I set it as 256MB. It turns out, the swap partition is filled only less than 10% of its size most of the time. (from 'df' command) Did I waste extra storage space for the swap partition? Not that it's critical because the storage space is inexpensive, but just curious. Thanks.

 

Klosters

Golden Member
Oct 9, 1999
1,428
0
0
The OS is expecting to see 64 Mb. With 256 Mb Sdram that's recognized, why disappoint RH?
 

Jaraxal

Senior member
Oct 9, 1999
383
0
0
It is generally a good idea to have AT LEAST as much swap room as the amount of memory you have. That allows your system to swap up to your memory amount.


I usually choose twice the amount up to 256MB (256MB real, 512MB swap). Above 256MB I usually just match the memory amount.

For what it's worth, Solaris recommends that you increase the size of the swap file depending on the number of users on the system. It isn't uncommon to see swap sizes over 1GB.

 

nexus9

Senior member
Jan 8, 2000
535
0
0
Yeah, I have a couple of Solaris/Sybase database servers where I work that have 2Gb swap (& 4Gb ram). Disk is cheap...

-Nexus9
 

Sensei

Member
Oct 9, 1999
122
0
0
Servers are a different ballgame. 64 meg swap file is Totally fine for desktop right now. As games develop and what not for linux more then that will change. I have 128 swap and it never ever even swaps. However, I have over 30 meg ram ;)
 

UnixFreak

Platinum Member
Nov 27, 2000
2,008
0
76
I use a 256 meg swap with 128 meg of memory, but then again, I have the disk space to spare, I hardly use any of it, but its nice to have just in case. You can get away with a lot less, especially for regular desktop use.
 

Jaraxal

Senior member
Oct 9, 1999
383
0
0
Very true, servers are a different ball game. The best thing to do would be to set your swap space to something like 256MB. Then run all the applications you usually use and see how much swap space you actually use up.

For windows based machines you can view the history of swp space using something like Norton Utilities, or TaskInfo 2000.

ZDNET - TaskInfo 2000.

Linux has native programs for that. KDE and Gnome provide nice GUI based utilities for it as well.

Then I would go back and reset your swap space to somthing a little more than what your max usage.

This would be the best method as every user is different and every computer is different. This would allow you the optimum setup for your system and usage patterns.