?

Story: Two methods disable swap partition ubuntu 11.10Total Replies: 17
Author Content
nikkels

Apr 07, 2012
9:24 AM EDT
I think disabling your swap is moronic.
dinotrac

Apr 07, 2012
9:25 AM EDT
@nikkels --

Why is that?
tbuitenh

Apr 07, 2012
10:05 AM EDT
One might want to disable swap when a different Linux is using the same swap partition to hibernate to - but then this is not the way because it doesn't prevent the swap from being enabled during boot. With the huge disks of today this is not likely to be needed in practice - just give each install its own swap partition.

When some buggy program slowly uses all available memory, disabling swap will make the inevitable crash come sooner, which can be a good thing, but in such a case it's better not to allow that program to use more than a certain amount of memory (I can't remember the command for it right now, but I've done that long ago).

When you have installed on a USB flash drive, disabling swap may allow the drive to live a bit longer, but in that case you should have installed without a swap partition.

When swap isn't used it doesn't do any harm, and when it is used you normally want it to be used...
dinotrac

Apr 07, 2012
10:34 AM EDT
@tbui --

Do you think that's what he's referring to? If you installed with swap, it's stupid to disable it as opposed to installing without swap?

I'm not a kernel internals guy, so I don't know the cost of merely having swap enabled.
nikkels

Apr 07, 2012
10:45 AM EDT
https://help.ubuntu.com/community/SwapFaq

@dinotrac

It's a personal opinion, and of course, just like anything else, debatable.

But read and save the article. Nice info.

dinotrac

Apr 07, 2012
10:56 AM EDT
@nikkels -

Thanks for the link. Does look like you're better off not having a swap partition/file if you don't need it.

That makes sense to me, and mirrors some experience from my ancient mainframe days -- back to a combination of extended RAM (once upon a time mainframes could not address more than 16mb) and improved paging algorithms.
Fettoosh

Apr 07, 2012
12:35 PM EDT
@nikkels,

Your good link led me to another very informative article here: Understanding swap files in Linux

@Dino,

Quoting:Does look like you're better off not having a swap partition/file if you don't need it.


It is a pretty nice day here in Southeast Michigan, I assume it is the same around Chicago, so why are you looking for an argument? :-)

1, How can one tell whether a swap space is NOT going to be needed before hand?

2. What are the costs of allocating swap space especially now with disk space so small and aggressive swapping can be minimized?

3. Is there a good Linux monitoring tool/utility that you know of and runs in the background to keep a history of system resources usage and develop a trend with recommendation? Am I asking for too much?

4. As noted in the article, servers and desktops need are different in usage. On desktops, with lots of memory, swap space might not needed, but on servers, it is a totally different case. I agree with Nikkels, swap must be enabled.

tbuitenh

Apr 07, 2012
12:49 PM EDT
If your system swaps when you think it shouldn't, reduce the swappiness. If it still swaps with swappiness=0, you need more RAM and disabling swap would be a bad idea (because you'll run out of memory).
dinotrac

Apr 07, 2012
12:53 PM EDT
>How can one tell whether a swap space is NOT going to be needed before hand?

You can never be 100% certain, but you can decide how averse you are to the consequences of a rare OOM condition.

You can determine how likely an OOM condition is by analyzing your load, AND, if you're like me, you can check on your machine from time to time and shut things down that you don't need.

Fettoosh

Apr 07, 2012
1:28 PM EDT
I have couple very old machines (15 yrs, Compaq Evo1.5GHz CPU, 1.5GB memory & DeskPro 1.0GHz CPU, 512MB memory, 20GB disk) that I use for testing. I am running Kubuntu 12.04 with KDE 4.8.2. on both. They run OK and the beefier one, which has an old nVidia GForce 4x graphics, seems to be faster.

I want to checkout and determine where the bottle necks are. Does anyone know of a good tool that runs in the background to collect system resource usage into a data file?

dinotrac

Apr 07, 2012
2:03 PM EDT
Well, there's always old standboys like sar, vmstat, iostat, etc.
Fettoosh

Apr 07, 2012
3:38 PM EDT
Quoting:old standboys like sar, vmstat, iostat, etc


I was thinking of a tool more like System Monitor to select sensors and direct output to a log file instead.

Run it to create a baseline then change system parameters and run it again. Repeat for several times then evaluate. That would give an idea about system sensitivity to changes of various parameter and helps tune a system and/or suggest to increase specific resources.

BFM

Apr 07, 2012
8:00 PM EDT
If you have a laptop and want to hibernate ypur system you had better have a swap partition of 1.5 to 2 times your memory size. Where do you think the system goes when you hibernate it?
nikkels

Apr 07, 2012
8:28 PM EDT
Running your system without swap space is like running your car without insurance or running your life without a medical scheme. Amen.

@ Fettoosh Thanks for the link
tracyanne

Apr 07, 2012
8:36 PM EDT
Quoting:Where do you think the system goes when you hibernate it?


Bora Bora
gus3

Apr 07, 2012
9:07 PM EDT
BFM wrote:Where do you think the system goes when you hibernate it?
S4 is "hiberation". S3 is suspend-to-RAM. My desktop has no swap, but it supports S3 via the power button (custom config).
dinotrac

Apr 07, 2012
9:24 PM EDT
@nikkels --

Not really. When somebody smashes into your car, you can't push the big red button and make everything right again.
gus3

Apr 07, 2012
9:39 PM EDT
@dinotrac, if that big red button summons cousin Guido, everything will be right again when you push it. Trust me. ;-)

Posting in this forum is limited to members of the group: [ForumMods, SITEADMINS, MEMBERS.]

Becoming a member of LXer is easy and free. Join Us!