LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-01-2004, 12:45 PM   #1
[GOD]Anck
Member
 
Registered: Dec 2003
Location: The Netherlands
Distribution: Slackware
Posts: 171

Rep: Reputation: 35
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?
 
Old 01-01-2004, 12:46 PM   #2
EnigmaZ
LQ Newbie
 
Registered: Jan 2004
Location: Chicago, IL
Distribution: Slackware
Posts: 29

Rep: Reputation: 15
Good question...i've got a dell on the way with two hd's also and wondering same thing...
 
Old 01-01-2004, 01:42 PM   #3
[GOD]Anck
Member
 
Registered: Dec 2003
Location: The Netherlands
Distribution: Slackware
Posts: 171

Original Poster
Rep: Reputation: 35
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.
 
Old 01-01-2004, 04:57 PM   #4
r_jensen11
Senior Member
 
Registered: Apr 2003
Location: Minnesota, USA
Distribution: Slack 10.0 w/2.4.26
Posts: 1,032

Rep: Reputation: 45
Too bad I can only fit my hard drives on my primary cable... Stupid 6 year old Gateway 2k tower....
 
Old 01-01-2004, 05:02 PM   #5
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
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?
 
Old 01-01-2004, 05:08 PM   #6
sh0
LQ Newbie
 
Registered: Nov 2003
Location: Germany
Distribution: Slackware 7.0 - 10.0
Posts: 26

Rep: Reputation: 15
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.
 
Old 01-01-2004, 05:16 PM   #7
DaOne
Member
 
Registered: Jan 2003
Location: USA
Distribution: Slackware
Posts: 498

Rep: Reputation: 30
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.
 
Old 01-01-2004, 05:22 PM   #8
[GOD]Anck
Member
 
Registered: Dec 2003
Location: The Netherlands
Distribution: Slackware
Posts: 171

Original Poster
Rep: Reputation: 35
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. 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.
 
Old 01-01-2004, 05:27 PM   #9
DaOne
Member
 
Registered: Jan 2003
Location: USA
Distribution: Slackware
Posts: 498

Rep: Reputation: 30
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. 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!
 
Old 01-01-2004, 06:43 PM   #10
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
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. 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.
 
Old 01-01-2004, 11:00 PM   #11
harrygraham
Member
 
Registered: Apr 2001
Location: Ottawa, Canada
Posts: 157

Rep: Reputation: 18
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
2 swap partitions librano Linux - Newbie 6 08-25-2004 01:55 PM
eight swap partitions? linuxtesting2 Linux - General 7 07-20-2004 06:15 AM
/ and swap partitions (but want more) How to? acummings Slackware 3 07-17-2004 12:33 AM
Do I need 2 swap partitions? CloudBuilder Linux - Newbie 2 11-14-2003 03:09 PM
swap partitions rakemup Linux - Software 5 12-10-2001 09:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration