SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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?
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?
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.
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.
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.
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...
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.