LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Multiple swap partitions? (http://www.linuxquestions.org/questions/slackware-14/multiple-swap-partitions-130589/)

[GOD]Anck 01-01-2004 01:45 PM

Multiple swap partitions?
 
Just a quick question today. :) Is there any noticeable advantage to having multiple swap partitions anymore? I know the swap limit used to be 128 MB so to have a bigger swap space you needed to create more then one swap partition, but this limit doesn't exist anymore. The system I'm building has two disks. Would there be any performance advantage to splitting swap over both of them instead of just having one swap partition?

EnigmaZ 01-01-2004 01:46 PM

Good question...i've got a dell on the way with two hd's also and wondering same thing...

[GOD]Anck 01-01-2004 02:42 PM

From what I've been reading on Google, dividing swap space over multiple physical devices yields a performance increase because it allows for overlapping I/O activity, especially if the devices are also on seperate controllers... the vast majority of the posts I found are dated years back so I don't really have any idea how relevant or useful this is in our current situation, but I suppose the theoretical part still holds true.

But then again, apparantly the swap partitions on different devices are used in a round-robin system. It seems to me that this may not always be the most efficient way, for example if you wanted to page something big from /dev/hda, you would preferrably write it to the swap space on /dev/hdc instead of splitting it over the two, thus making /dev/hda do a lot of extra seeking... or am I wrong here?

Hmmm this intrigues me. :)

r_jensen11 01-01-2004 05:57 PM

Too bad I can only fit my hard drives on my primary cable... Stupid 6 year old Gateway 2k tower....

XavierP 01-01-2004 06:02 PM

Swap files are used less and less now since we all have loads of memory - swap size is normally twice your memory. Create a single swap file of, say 256mb, and forget about it. Unless you are doing a lot of very processor/memory intensive things ou probably won't notice a huge difference.

OTOH, ther's no harm in trying. :) Why not give it a go and let us know how you got on?

sh0 01-01-2004 06:08 PM

I heard about that there is more performance if you place the swap on hdd or hdc using the other ide channel then the system but since the swap isn't used that much mhhh

I also heared that if you need the swap it's best to put it first on a hd.

DaOne 01-01-2004 06:16 PM

In earlier installs I haven't included swap partitions having 1GB of physical memory. In this last install, I did make a 512MB swap partition...I haven't noticed any difference at all. :confused:

[GOD]Anck 01-01-2004 06:22 PM

Quote:

Originally posted by XavierP
Swap files are used less and less now since we all have loads of memory - swap size is normally twice your memory. Create a single swap file of, say 256mb, and forget about it. Unless you are doing a lot of very processor/memory intensive things ou probably won't notice a huge difference.

OTOH, ther's no harm in trying. :) Why not give it a go and let us know how you got on?

We don't *all* have loads of memory. ;) The system I'm working with is built with spare parts and has 96 MB of RAM, so optimizing it is kind of an issue. :D I've decided to go ahead and see how it does with a 128 MB swap partition at the beginning of both hard drives... wish me luck. ;)

DaOne 01-01-2004 06:27 PM

Quote:

Originally posted by [GOD]Anck
We don't *all* have loads of memory. ;) The system I'm working with is built with spare parts and has 96 MB of RAM, so optimizing it is kind of an issue. :D I've decided to go ahead and see how it does with a 128 MB swap partition at the beginning of both hard drives... wish me luck. ;)
I guess it would make sense in your application...

and Good Luck! ;)

trickykid 01-01-2004 07:43 PM

Quote:

Originally posted by [GOD]Anck
We don't *all* have loads of memory. ;) The system I'm working with is built with spare parts and has 96 MB of RAM, so optimizing it is kind of an issue. :D I've decided to go ahead and see how it does with a 128 MB swap partition at the beginning of both hard drives... wish me luck. ;)
Your not going to see a difference and I think your just wasting space really oin the second drive. I have systems that only have 128 megs of RAM and I only create a swap on the first drive right after the /boot partition. In most cases I rarely even touch the swap.
Putting it at the beginning of the first drive is the most logical solution and its not necessary to just separate them onto both drives, in which even in your case you won't see any difference.

When creating swap, you want to hope that your system never really needs to use it, only when your running resource intensive applications, etc. The only time my desktops hit and use swap is when I'm ripping dvd's and I'm approaching about a gig or more in the filesize of my ripped movie, etc.

harrygraham 01-02-2004 12:00 AM

Quoting from Sams FreeBSD Unleashed:

The proper (or improper) placement of your swap partition can have a significant impact on the performance of your system. So here are some guidelines for choosing where to put your swap partition.

- Put the swap partition as close to the beginning of the disk as possible. Lower numbered cylinders on the disk can be accessed slightly faster than higher numbered cylinders.

- If you have multiple drives on your system, as a general rule, you should put the swap partition on the fastest drive on your system.

- If the fastest drive on your system is also the most heavily accessed by users, Web
servers, mail transfer agents, and so on, you will probably want to violate the previous point and put the swap partiton on the least-accessed drive on your system. Not
only does this allow more time for the drive to access the swap space instead of accessing other things, but it increases the chances that the hard disk heads will already be positioned within the swap partiton when swapping is needed. Little things like the time it takes the hard disk heads to cross the disk to where the swap partition is located really can make a difference during high loads and heavy swapping.

End of quote

I think the same principles apply to Linux. I don't think two swap partitions will speed things up. Might even slow things down. BTW I feel your pain, man. I'm working with an oldie as well. :)


All times are GMT -5. The time now is 03:55 AM.