What is the best swap partition size

Forum rules
Before you post please read how to get help
Post Reply
Mavigraph
Level 1
Level 1
Posts: 5
Joined: Tue Jun 28, 2011 6:31 am

What is the best swap partition size

Post by Mavigraph »

Hello,

I have a 2.4Ghz P4 w/1G mem and 120G HD. I'm installed Xfce and discovered that I need a swap partition. What size would be best for my system?

Thanks,
User avatar
kc1di
Level 16
Level 16
Posts: 6254
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: What is the best swap partition size

Post by kc1di »

Mavigraph wrote:Hello,

I have a 2.4Ghz P4 w/1G mem and 120G HD. I'm installed Xfce and discovered that I need a swap partition. What size would be best for my system?

Thanks,
The old thinking was that you should have 2x the amount of ram in your system so in your case 2G.
But newer thought says you don't even need a swap partition if you have enough ram.

I have 2g on my machine and it never gets used.

hope this is helpful.
Dave
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
lmintnewb

Re: What is the best swap partition size

Post by lmintnewb »

Believe the general rule of thumb is 1.5 times the amount of RAM you have. In your case 1gig/ram * 1.5 = 1.5gb swap partition. Am not a nix guru but is my understanding that your system relies on the swap partition for things like suspend/hibernation. So while swap hopefully doesn't get used all that much while your PC is up and running. Seems like a good idea to at least have a swap for your linux OS.

I'd also advise you to adjust the swappiness setting to the more reasonable value for desktop/laptops. Google vm.swappiness=10 if you'd like to find out how to go about doing it and why ... etc. On a comp with less than 2gbs/ram. Personally think resetting the swappiness from the default of 60 to the recommended 10 makes sense. Cutting down on unneeded disk writes and so forth.
jeffreyC
Level 4
Level 4
Posts: 321
Joined: Mon Jun 07, 2010 9:34 pm

Re: What is the best swap partition size

Post by jeffreyC »

If you use suspend or hibernate you need swap larger than your RAM
Also I agree that swappiness should be set to 10 or less, 60 is a hold over from old days, and also makes more sense for servers.
Get Dropbox and an extra 250 mb http://db.tt/wAizqw0
mikecz
Level 2
Level 2
Posts: 76
Joined: Sat Jun 11, 2011 5:14 pm

Re: What is the best swap partition size

Post by mikecz »

I followed the old Unix rule of 2x RAM (I've got 4gig, so I went with 8gig). Unfortunately, swap & hibernate doesn't seem to work on my machine but with a 250meg HD, I can spare the space.

MikeC
lmintnewb

Re: What is the best swap partition size

Post by lmintnewb »

Mike ... might try digging through some of these threads. Mostly dealing with making sure the uuid's for your swap are right in /etc/fstab to fix suspend/etc issues. No promises but could poss fix ya up.

http://forums.linuxmint.com/search.php < forget it, see below. :D

YIkes, php getting in the way. Well just search for sudo gedit /etc/fstab in the magic minty forum search bar instead. Other stuff kinda comes to mind. Like kernel, firmware upgrades or updating/flashing bios. But that stuff is more hassle. In addition to this, RAMDOM observation. Olivia Newton John used to be hawt. Before she got old and lost a bewb.
User avatar
Roken
Level 5
Level 5
Posts: 737
Joined: Fri Nov 19, 2010 4:55 pm
Location: Warrington, UK

Re: What is the best swap partition size

Post by Roken »

Might I make a suggestion, since there are just too many schools of thought on the subject.

Run your system with no swap partition. If you find yourself running out of memory, make a swap partition = 1/2 your physical ram, and run it. If it's fine, leave it. If you hit problems, double the swap. Then 1.5x until you find the sweet spot.

I suggest this because there are so many answers, and the answers are usually based on what has either been googled, or based on experience on a specific system.

Personally, although I have a swap partition, I honestly can't remember the last time that it was actually used. I don't worry about it because HD space is so cheap these days, and I have 8GB RAM which is fine for pretty much most things I will do with my system. However, I wouldn't dream of saying that because someone has 8GB RAM they don't need a swap file. Let's face it, they may be doing Hi Res image editing wher the image itself will fill 8 GB, so in that case they will need a swap partition.

At the end of the day, it's not difficult to change if you need to, so start small and build up until you don't need more.
Kernel Linux Tex 4.8.13-1-ARCH (64 bit) xfce , burg
Arch
GTX680 4Gb
OSS4
AMD Phenom II X4 (965BE) @ 3.6 Ghz
8Gb RAM
Mavigraph
Level 1
Level 1
Posts: 5
Joined: Tue Jun 28, 2011 6:31 am

Re: What is the best swap partition size

Post by Mavigraph »

Thank You, all for your replies. I believe I will wait and see how much of a need presents itself. My system is max'ed on memory at 1Gig. Also I just want to say this is the most hospitable forum that I've ever been on. I'm still just getting my feet wet on Linux and I believe with folks like you, I'm going to have a great experence with linux.

Thanks
mikecz
Level 2
Level 2
Posts: 76
Joined: Sat Jun 11, 2011 5:14 pm

Re: What is the best swap partition size

Post by mikecz »

lmintnewb wrote:Mike ... might try digging through some of these threads. Mostly dealing with making sure the uuid's for your swap are right in /etc/fstab to fix suspend/etc issues. No promises but could poss fix ya up.

http://forums.linuxmint.com/search.php < forget it, see below. :D

YIkes, php getting in the way. Well just search for sudo gedit /etc/fstab in the magic minty forum search bar instead. Other stuff kinda comes to mind. Like kernel, firmware upgrades or updating/flashing bios. But that stuff is more hassle. In addition to this, RAMDOM observation. Olivia Newton John used to be hawt. Before she got old and lost a bewb.
I've flashed the BIOS, and that didn't seem to make a difference. I have made sure all the stuff in fstab is consistant. I'm thinking its a quirk of the HW I'm using.

Its not a big deal, but thought I'd mention it.

MikeC
lmintnewb

Re: What is the best swap partition size

Post by lmintnewb »

Sounds like a likely culprit Mike, in all my nix newbish glory, lol.

There's some other stuff. But as long as it's not a big deal to you. Then it isn't worth the time involved in figuring it out anyway.
Last edited by lmintnewb on Fri Jul 15, 2011 6:23 pm, edited 1 time in total.
User avatar
MALsPa
Level 8
Level 8
Posts: 2040
Joined: Mon Nov 19, 2007 10:17 pm
Location: albuquerque

Re: What is the best swap partition size

Post by MALsPa »

Mavigraph wrote:I believe I will wait and see how much of a need presents itself.
Not a bad approach to take. Myself, I've got 2 GB RAM. I said, "What the heck, make a 2 GB swap partition and forget about it." If it's ever needed, it's there, but I've never noticed any of it being used. But setting aside 2 GB for swap is no big deal unless the hard drive is quite small, I guess.
wayne128
Level 10
Level 10
Posts: 3412
Joined: Tue Jul 13, 2010 12:15 am

Re: What is the best swap partition size

Post by wayne128 »

mikecz wrote:
lmintnewb wrote:Mike ... might try digging through some of these threads. Mostly dealing with making sure the uuid's for your swap are right in /etc/fstab to fix suspend/etc issues. No promises but could poss fix ya up.

http://forums.linuxmint.com/search.php < forget it, see below. :D

YIkes, php getting in the way. Well just search for sudo gedit /etc/fstab in the magic minty forum search bar instead. Other stuff kinda comes to mind. Like kernel, firmware upgrades or updating/flashing bios. But that stuff is more hassle. In addition to this, RAMDOM observation. Olivia Newton John used to be hawt. Before she got old and lost a bewb.
I've flashed the BIOS, and that didn't seem to make a difference. I have made sure all the stuff in fstab is consistant. I'm thinking its a quirk of the HW I'm using.

Its not a big deal, but thought I'd mention it.

MikeC
@MikeC,

read this link, tom's note mention to check both locations n uuid. perhaps you miss the second location .
else, consider liquorix kernel as many reported it to work.

http://forums.linuxmint.com/viewtopic.php?f=18&t=76789
mikecz
Level 2
Level 2
Posts: 76
Joined: Sat Jun 11, 2011 5:14 pm

Re: What is the best swap partition size

Post by mikecz »

wayne128 wrote:@MikeC,

read this link, tom's note mention to check both locations n uuid. perhaps you miss the second location .
else, consider liquorix kernel as many reported it to work.

http://forums.linuxmint.com/viewtopic.php?f=18&t=76789
I corrected the /etc/initramfs-tools/conf.d/resume file to match the UUID of the swap partition, but no luck.

I'm not going to with the liquorix kernel; I'll wait for a future regular update, or just continue to live withouth.

Thanks for the pointer, though. I'm curious about the shift from /dev files to UUIDs (being an old Unix guy) but that's probably a question for another forum.

MikeC
lmintnewb

Re: What is the best swap partition size

Post by lmintnewb »

The liquorix kernel or custom compiling a vanilla kernel with better support and patches for his hardware was the other stuff I was hinting at. From what Mikes saying though. Can tell he doesn't want to bother going through all the headaches to deal with that kinda stuff and really don't blame someone. Suspend and hibernate not working isn't the end of the world. Even if I'm sure it could be aggravating. Could never get hibernate to work with Mint 10, but suspend did so never bothered messing with it, shrugs.
Post Reply

Return to “Xfce”