Discussion:
Swap partition size (future proofing)
David Fletcher
2005-02-01 08:22:48 UTC
Permalink
I've just ordered the parts to build a new PC :)

The motherboard (Intel D865PERL) has four memory module sockets which can take
a total of 4G RAM.

I have ordered a single 1G memory module, leaving me plenty of scope to expand
the memory later if I want to.

Searching the Fedora List archive, I found various suggestions for
increasing swap space by either adding a partion if there is unused space on
the HDD or using mkswap to create a swap file in an existing partition. Hard
drive space is fairly cheap these days so I want to set it up "right first
time" so that I don't have to mess about if (when) I add more memory later.

Suggested swap partition sizes from the archives range from the same size as
the RAM to twice the size of the RAM.

Given that I'm going to start with 1G of RAM, but could (but maybe won't) end
up with 4G of RAM, I'm thinking that maybe 6G would be a sensible size for
the swap partition.

What do the members think?

Thanks,

Dave Fletcher
Tony Dietrich
2005-02-01 08:48:48 UTC
Permalink
Post by David Fletcher
I've just ordered the parts to build a new PC :)
The motherboard (Intel D865PERL) has four memory module sockets which can
take a total of 4G RAM.
I have ordered a single 1G memory module, leaving me plenty of scope to
expand the memory later if I want to.
Searching the Fedora List archive, I found various suggestions for
increasing swap space by either adding a partion if there is unused space
on the HDD or using mkswap to create a swap file in an existing partition.
Hard drive space is fairly cheap these days so I want to set it up "right
first time" so that I don't have to mess about if (when) I add more memory
later.
Suggested swap partition sizes from the archives range from the same size
as the RAM to twice the size of the RAM.
Given that I'm going to start with 1G of RAM, but could (but maybe won't)
end up with 4G of RAM, I'm thinking that maybe 6G would be a sensible size
for the swap partition.
What do the members think?
Thanks,
Dave Fletcher
Dave

The rule of thumb is twice the RAM, but the more RAM you have, the less swap
is used.
I'd start with 2Gig, and add as required if/when you upgrade. The process is
easy enough, but keep watching your memory usage, as you may find you
actually don't need to increase swap size.
If you really really don't want to worry about changing swap later, go with
6Gig ... it should suffice for just about everything, unless you run memory
intensive programs.
I can't think of a standard FC application that would hog memory that much.
(OK, you can all tell me you know better now, but I am generalising :p)
--
Tony Dietrich
-------------
Abraham Lincoln didn't die in vain. He died in Washington, D.C.
Paul Howarth
2005-02-01 08:50:08 UTC
Permalink
Post by David Fletcher
I've just ordered the parts to build a new PC :)
The motherboard (Intel D865PERL) has four memory module sockets which can take
a total of 4G RAM.
I have ordered a single 1G memory module, leaving me plenty of scope to expand
the memory later if I want to.
Searching the Fedora List archive, I found various suggestions for
increasing swap space by either adding a partion if there is unused space on
the HDD or using mkswap to create a swap file in an existing partition. Hard
drive space is fairly cheap these days so I want to set it up "right first
time" so that I don't have to mess about if (when) I add more memory later.
Suggested swap partition sizes from the archives range from the same size as
the RAM to twice the size of the RAM.
Given that I'm going to start with 1G of RAM, but could (but maybe won't) end
up with 4G of RAM, I'm thinking that maybe 6G would be a sensible size for
the swap partition.
What do the members think?
It depends entirely on what you intend to do with this machine. If it's
a regular desktop machine and you've got 1G of RAM, you probably don't
need any swap at all. If you're going to be doing work with large
databases or other memory-intensive applications, you might need lots of
swap, but remember that performance is going to go downhill as soon as
you start actually using the swap space.

Back in the "old days", a good rule of thumb was to use twice as much
swap space as you had RAM. I suspect that's where you got the 6GB figure
from. But really it's case of how much memory, both real and virtual,
that your applications are going to use that should be the deciding
factor, not the amount of actual RAM in your system.

Having a big swap partition won't do any harm, so if you have lots of
disk space there's no harm in having a big swap partition, you just may
not see the benefit of it. If you have more than one disk, try splitting
the swap space amongst the disks as that's likely to give better
performance.

Paul.
--
Paul Howarth <paul at city-fan.org>
Edward
2005-02-01 11:20:43 UTC
Permalink
Post by David Fletcher
I've just ordered the parts to build a new PC :)
The motherboard (Intel D865PERL) has four memory module sockets which can take
a total of 4G RAM.
I have ordered a single 1G memory module, leaving me plenty of scope to expand
the memory later if I want to.
Just a side note - the others are already answering your questions
below, if you have not received the 1Gb yet, cancel and change it to
two 512Mb modules. In most cases it will only cost you about $10 more or
so, but the PERL can use Dual Memory Channels. In my year or so working
with those boards I can almost guarantee you at least 10% speed increase
in the system as a whole.

Regards,
Ed.
Scot L. Harris
2005-02-01 14:17:38 UTC
Permalink
Post by David Fletcher
Suggested swap partition sizes from the archives range from the same size as
the RAM to twice the size of the RAM.
Given that I'm going to start with 1G of RAM, but could (but maybe won't) end
up with 4G of RAM, I'm thinking that maybe 6G would be a sensible size for
the swap partition.
I think that old rule of thumb is less valid now than it used to be when
we had systems that had 512K of memory.

Anymore, swap space is kind of an emergency use kind of thing. If your
system starts using any significant amount of swap space you will
immediately see performance problems. As such it is best to size your
memory to handle the applications you plan to use.

Personally I don't think it makes much sense in most cases (not all) to
have more than about 1GB of swap space on a system. Again this rule of
thumb I have used for many years is some what dated now that disk drives
are so large and relatively cheap. It does not cost as much anymore to
waste huge amounts of disk on swap.

If you are trying to get performance out of the system in general more
memory will work better. You may also want to check into potential
performance gains you may see by using multiple memory chips instead of
one large one. Many motherboards make better use of multiple chips
instead of one large one.
--
Scot L. Harris
webid at cfl.rr.com

Cow-tippers tipped a cow onto the server.
Matthew Miller
2005-02-01 18:09:51 UTC
Permalink
Post by Scot L. Harris
Personally I don't think it makes much sense in most cases (not all) to
have more than about 1GB of swap space on a system. Again this rule of
I agree -- if you're swapped out so much that you need 6GB, you'll probably
die of old age before it swaps back in....
--
Matthew Miller mattdm at mattdm.org <http://www.mattdm.org/>
--> Fedora Users & Developers Conference, hosted by Boston University <--
February 18th, 2005 <http://fedoraproject.org/wiki/FUDCon1>
jim branagan
2005-02-03 04:18:55 UTC
Permalink
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/users/attachments/20050202/6f506d7c/attachment.html
jim branagan
2005-02-03 04:18:55 UTC
Permalink
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/users/attachments/20050202/6f506d7c/attachment-0002.html
Matthew Miller
2005-02-01 18:09:51 UTC
Permalink
Post by Scot L. Harris
Personally I don't think it makes much sense in most cases (not all) to
have more than about 1GB of swap space on a system. Again this rule of
I agree -- if you're swapped out so much that you need 6GB, you'll probably
die of old age before it swaps back in....
--
Matthew Miller mattdm at mattdm.org <http://www.mattdm.org/>
--> Fedora Users & Developers Conference, hosted by Boston University <--
February 18th, 2005 <http://fedoraproject.org/wiki/FUDCon1>
Thomas Cameron
2005-02-01 15:39:04 UTC
Permalink
----- Original Message -----
From: "David Fletcher" <fm_maillists at ntlworld.com>
To: <fedora-list at redhat.com>
Sent: Tuesday, February 01, 2005 2:22 AM
Subject: Swap partition size (future proofing)
Post by David Fletcher
I've just ordered the parts to build a new PC :)
The motherboard (Intel D865PERL) has four memory module sockets which can take
a total of 4G RAM.
I have ordered a single 1G memory module, leaving me plenty of scope to expand
the memory later if I want to.
Searching the Fedora List archive, I found various suggestions for
increasing swap space by either adding a partion if there is unused space on
the HDD or using mkswap to create a swap file in an existing partition. Hard
drive space is fairly cheap these days so I want to set it up "right first
time" so that I don't have to mess about if (when) I add more memory later.
Suggested swap partition sizes from the archives range from the same size as
the RAM to twice the size of the RAM.
Given that I'm going to start with 1G of RAM, but could (but maybe won't) end
up with 4G of RAM, I'm thinking that maybe 6G would be a sensible size for
the swap partition.
What do the members think?
Thanks,
Dave Fletcher
Dave -

The amount of swap you need can be determined by one thing: How much memory
are you going to use on a regular basis, and how much physical memory do you
have? How much more memory do you need than the amount of physical memory
installed?

In other words, if you are going to be running a desktop PC, I can't imagine
that you will regularly have more than 1GB of processes running which need
physical memory. For a desktop PC you will likely be running your window
manager, some apps like a web browser, an office productivity suite, maybe a
graphics program such as the GIMP, maybe you'll be running a compiler now
and then, and you'll have the network stack loaded. I don't see that you
will come near the 1GB memory capacity you have. You'll likely never touch
swap, so you don't really need a big, wasteful swap file.

Now if you were running a compute server, where numerous people were logged
in concurrently and all of them were running big compiles or
memory-intensive programs, then I could see that it might be realistic to
expect that more than 1GB of memory is going to need to be used at the same
time. You might have more stuff going on than you have physical memory, and
you'd want a healthy swap file.

In my case (and I have exactly the same motherboard, BTW), I am ruuning the
motherboard in a lightly loaded web/mail/dns/ftp server. I have 2GB memory
and a 1GB swap file. I *never* touch swap - the machine simply doesn't have
enough going on to ever need to page information out of physical memory to
the swap file:

[thomas.cameron at mail ~]$ free
total used free shared buffers cached
Mem: 2075228 1843364 231864 0 281348 981732
-/+ buffers/cache: 580284 1494944
Swap: 917968 0 917968

So the real answer is: what are you doing with the machine?

Thomas
James Wilkinson
2005-02-01 17:32:18 UTC
Permalink
Post by David Fletcher
I've just ordered the parts to build a new PC :)
The motherboard (Intel D865PERL) has four memory module sockets which
can take a total of 4G RAM.
I have ordered a single 1G memory module, leaving me plenty of scope
to expand the memory later if I want to.
Congratulations!

You've been given lots of advice. One other thing to bear in mind...

Most of the programs you use will only be able to use up to 3 GB of
memory + swap each. So you'll need 3 maxxed-out processes to use 10 GB
of memory and swap.

You will (presumably) be getting a 32 bit Pentium 4: as I understand it,
the only Intel x86-64 processors currently available are Xeons. Intel
are planning 64 bit Pentium 4s, but I doubt that they'll use the mPGA478
socket on your motherboard.

With 32 bits, and without PAE, a process can address up to 4 GB of
virtual memory. That includes the real memory it's using, swap space,
memory mapped files, shared memory, and as-yet unused memory that will
only be backed by something physical if it is ever used.

With the 4G+4G patch to the Linux kernel, this was nearly all available
to the process. This has been turned off in recent Fedora kernels:
instead 1 GB of that address space has been reserved for the kernel,
leaving 3 GB for processes.

Um: to clarify: that 3 GB is a size, not an indication of where it's
located. On a suitably configured box, it might all be located beyond 10
GB in physical RAM and on the swap file. But there can't be more than 3
GB of it.

A program can *sort-of* get round this by using PAE. But for this to
work, the program *source* itself has to be written with PAE in mind.
That's rarely done. It's useful for big databases, where accessing
memory through PAE merely has to be faster than disk accesses, but it's
not really for general programming.

You're just at the edge of where not having 64 bit support still makes
sense.

James.
--
James Wilkinson | Five miles as the hippopotamus bounces...
Exeter Devon UK |
E-mail address: james |
@westexe.demon.co.uk |
David Fletcher
2005-02-01 19:05:52 UTC
Permalink
Thanks for all of the advice.

I think I'll see what the auto swap partition size is with 1G RAM, then maybe
double it.

The reason I want to have lots of memory available is, I have a Bronica SQ-B
camera, which produces 6cm square images on 120 roll film. When I scan these
on my Epson Perfection 2450 Photo, I can end up with a digitised image which
is 5100 pixels square. Amongst other things, I want to start using the
digital equivalent of the graduated neutral density filter using two
differently exposed images of the same scene, which needs much more than the
3x128M RAM and Celeron 633 I've currently got. And with a 3GHz P4 it should
be much faster calculating the dithering for doing prints.

Dave Fletcher
David Fletcher
2005-02-01 19:05:52 UTC
Permalink
Thanks for all of the advice.

I think I'll see what the auto swap partition size is with 1G RAM, then maybe
double it.

The reason I want to have lots of memory available is, I have a Bronica SQ-B
camera, which produces 6cm square images on 120 roll film. When I scan these
on my Epson Perfection 2450 Photo, I can end up with a digitised image which
is 5100 pixels square. Amongst other things, I want to start using the
digital equivalent of the graduated neutral density filter using two
differently exposed images of the same scene, which needs much more than the
3x128M RAM and Celeron 633 I've currently got. And with a 3GHz P4 it should
be much faster calculating the dithering for doing prints.

Dave Fletcher
David Fletcher
2005-02-01 08:22:48 UTC
Permalink
I've just ordered the parts to build a new PC :)

The motherboard (Intel D865PERL) has four memory module sockets which can take
a total of 4G RAM.

I have ordered a single 1G memory module, leaving me plenty of scope to expand
the memory later if I want to.

Searching the Fedora List archive, I found various suggestions for
increasing swap space by either adding a partion if there is unused space on
the HDD or using mkswap to create a swap file in an existing partition. Hard
drive space is fairly cheap these days so I want to set it up "right first
time" so that I don't have to mess about if (when) I add more memory later.

Suggested swap partition sizes from the archives range from the same size as
the RAM to twice the size of the RAM.

Given that I'm going to start with 1G of RAM, but could (but maybe won't) end
up with 4G of RAM, I'm thinking that maybe 6G would be a sensible size for
the swap partition.

What do the members think?

Thanks,

Dave Fletcher
Tony Dietrich
2005-02-01 08:48:48 UTC
Permalink
Post by David Fletcher
I've just ordered the parts to build a new PC :)
The motherboard (Intel D865PERL) has four memory module sockets which can
take a total of 4G RAM.
I have ordered a single 1G memory module, leaving me plenty of scope to
expand the memory later if I want to.
Searching the Fedora List archive, I found various suggestions for
increasing swap space by either adding a partion if there is unused space
on the HDD or using mkswap to create a swap file in an existing partition.
Hard drive space is fairly cheap these days so I want to set it up "right
first time" so that I don't have to mess about if (when) I add more memory
later.
Suggested swap partition sizes from the archives range from the same size
as the RAM to twice the size of the RAM.
Given that I'm going to start with 1G of RAM, but could (but maybe won't)
end up with 4G of RAM, I'm thinking that maybe 6G would be a sensible size
for the swap partition.
What do the members think?
Thanks,
Dave Fletcher
Dave

The rule of thumb is twice the RAM, but the more RAM you have, the less swap
is used.
I'd start with 2Gig, and add as required if/when you upgrade. The process is
easy enough, but keep watching your memory usage, as you may find you
actually don't need to increase swap size.
If you really really don't want to worry about changing swap later, go with
6Gig ... it should suffice for just about everything, unless you run memory
intensive programs.
I can't think of a standard FC application that would hog memory that much.
(OK, you can all tell me you know better now, but I am generalising :p)
--
Tony Dietrich
-------------
Abraham Lincoln didn't die in vain. He died in Washington, D.C.
Paul Howarth
2005-02-01 08:50:08 UTC
Permalink
Post by David Fletcher
I've just ordered the parts to build a new PC :)
The motherboard (Intel D865PERL) has four memory module sockets which can take
a total of 4G RAM.
I have ordered a single 1G memory module, leaving me plenty of scope to expand
the memory later if I want to.
Searching the Fedora List archive, I found various suggestions for
increasing swap space by either adding a partion if there is unused space on
the HDD or using mkswap to create a swap file in an existing partition. Hard
drive space is fairly cheap these days so I want to set it up "right first
time" so that I don't have to mess about if (when) I add more memory later.
Suggested swap partition sizes from the archives range from the same size as
the RAM to twice the size of the RAM.
Given that I'm going to start with 1G of RAM, but could (but maybe won't) end
up with 4G of RAM, I'm thinking that maybe 6G would be a sensible size for
the swap partition.
What do the members think?
It depends entirely on what you intend to do with this machine. If it's
a regular desktop machine and you've got 1G of RAM, you probably don't
need any swap at all. If you're going to be doing work with large
databases or other memory-intensive applications, you might need lots of
swap, but remember that performance is going to go downhill as soon as
you start actually using the swap space.

Back in the "old days", a good rule of thumb was to use twice as much
swap space as you had RAM. I suspect that's where you got the 6GB figure
from. But really it's case of how much memory, both real and virtual,
that your applications are going to use that should be the deciding
factor, not the amount of actual RAM in your system.

Having a big swap partition won't do any harm, so if you have lots of
disk space there's no harm in having a big swap partition, you just may
not see the benefit of it. If you have more than one disk, try splitting
the swap space amongst the disks as that's likely to give better
performance.

Paul.
--
Paul Howarth <paul at city-fan.org>
Edward
2005-02-01 11:20:43 UTC
Permalink
Post by David Fletcher
I've just ordered the parts to build a new PC :)
The motherboard (Intel D865PERL) has four memory module sockets which can take
a total of 4G RAM.
I have ordered a single 1G memory module, leaving me plenty of scope to expand
the memory later if I want to.
Just a side note - the others are already answering your questions
below, if you have not received the 1Gb yet, cancel and change it to
two 512Mb modules. In most cases it will only cost you about $10 more or
so, but the PERL can use Dual Memory Channels. In my year or so working
with those boards I can almost guarantee you at least 10% speed increase
in the system as a whole.

Regards,
Ed.
Scot L. Harris
2005-02-01 14:17:38 UTC
Permalink
Post by David Fletcher
Suggested swap partition sizes from the archives range from the same size as
the RAM to twice the size of the RAM.
Given that I'm going to start with 1G of RAM, but could (but maybe won't) end
up with 4G of RAM, I'm thinking that maybe 6G would be a sensible size for
the swap partition.
I think that old rule of thumb is less valid now than it used to be when
we had systems that had 512K of memory.

Anymore, swap space is kind of an emergency use kind of thing. If your
system starts using any significant amount of swap space you will
immediately see performance problems. As such it is best to size your
memory to handle the applications you plan to use.

Personally I don't think it makes much sense in most cases (not all) to
have more than about 1GB of swap space on a system. Again this rule of
thumb I have used for many years is some what dated now that disk drives
are so large and relatively cheap. It does not cost as much anymore to
waste huge amounts of disk on swap.

If you are trying to get performance out of the system in general more
memory will work better. You may also want to check into potential
performance gains you may see by using multiple memory chips instead of
one large one. Many motherboards make better use of multiple chips
instead of one large one.
--
Scot L. Harris
webid at cfl.rr.com

Cow-tippers tipped a cow onto the server.
Thomas Cameron
2005-02-01 15:39:04 UTC
Permalink
----- Original Message -----
From: "David Fletcher" <fm_maillists at ntlworld.com>
To: <fedora-list at redhat.com>
Sent: Tuesday, February 01, 2005 2:22 AM
Subject: Swap partition size (future proofing)
Post by David Fletcher
I've just ordered the parts to build a new PC :)
The motherboard (Intel D865PERL) has four memory module sockets which can take
a total of 4G RAM.
I have ordered a single 1G memory module, leaving me plenty of scope to expand
the memory later if I want to.
Searching the Fedora List archive, I found various suggestions for
increasing swap space by either adding a partion if there is unused space on
the HDD or using mkswap to create a swap file in an existing partition. Hard
drive space is fairly cheap these days so I want to set it up "right first
time" so that I don't have to mess about if (when) I add more memory later.
Suggested swap partition sizes from the archives range from the same size as
the RAM to twice the size of the RAM.
Given that I'm going to start with 1G of RAM, but could (but maybe won't) end
up with 4G of RAM, I'm thinking that maybe 6G would be a sensible size for
the swap partition.
What do the members think?
Thanks,
Dave Fletcher
Dave -

The amount of swap you need can be determined by one thing: How much memory
are you going to use on a regular basis, and how much physical memory do you
have? How much more memory do you need than the amount of physical memory
installed?

In other words, if you are going to be running a desktop PC, I can't imagine
that you will regularly have more than 1GB of processes running which need
physical memory. For a desktop PC you will likely be running your window
manager, some apps like a web browser, an office productivity suite, maybe a
graphics program such as the GIMP, maybe you'll be running a compiler now
and then, and you'll have the network stack loaded. I don't see that you
will come near the 1GB memory capacity you have. You'll likely never touch
swap, so you don't really need a big, wasteful swap file.

Now if you were running a compute server, where numerous people were logged
in concurrently and all of them were running big compiles or
memory-intensive programs, then I could see that it might be realistic to
expect that more than 1GB of memory is going to need to be used at the same
time. You might have more stuff going on than you have physical memory, and
you'd want a healthy swap file.

In my case (and I have exactly the same motherboard, BTW), I am ruuning the
motherboard in a lightly loaded web/mail/dns/ftp server. I have 2GB memory
and a 1GB swap file. I *never* touch swap - the machine simply doesn't have
enough going on to ever need to page information out of physical memory to
the swap file:

[thomas.cameron at mail ~]$ free
total used free shared buffers cached
Mem: 2075228 1843364 231864 0 281348 981732
-/+ buffers/cache: 580284 1494944
Swap: 917968 0 917968

So the real answer is: what are you doing with the machine?

Thomas
James Wilkinson
2005-02-01 17:32:18 UTC
Permalink
Post by David Fletcher
I've just ordered the parts to build a new PC :)
The motherboard (Intel D865PERL) has four memory module sockets which
can take a total of 4G RAM.
I have ordered a single 1G memory module, leaving me plenty of scope
to expand the memory later if I want to.
Congratulations!

You've been given lots of advice. One other thing to bear in mind...

Most of the programs you use will only be able to use up to 3 GB of
memory + swap each. So you'll need 3 maxxed-out processes to use 10 GB
of memory and swap.

You will (presumably) be getting a 32 bit Pentium 4: as I understand it,
the only Intel x86-64 processors currently available are Xeons. Intel
are planning 64 bit Pentium 4s, but I doubt that they'll use the mPGA478
socket on your motherboard.

With 32 bits, and without PAE, a process can address up to 4 GB of
virtual memory. That includes the real memory it's using, swap space,
memory mapped files, shared memory, and as-yet unused memory that will
only be backed by something physical if it is ever used.

With the 4G+4G patch to the Linux kernel, this was nearly all available
to the process. This has been turned off in recent Fedora kernels:
instead 1 GB of that address space has been reserved for the kernel,
leaving 3 GB for processes.

Um: to clarify: that 3 GB is a size, not an indication of where it's
located. On a suitably configured box, it might all be located beyond 10
GB in physical RAM and on the swap file. But there can't be more than 3
GB of it.

A program can *sort-of* get round this by using PAE. But for this to
work, the program *source* itself has to be written with PAE in mind.
That's rarely done. It's useful for big databases, where accessing
memory through PAE merely has to be faster than disk accesses, but it's
not really for general programming.

You're just at the edge of where not having 64 bit support still makes
sense.

James.
--
James Wilkinson | Five miles as the hippopotamus bounces...
Exeter Devon UK |
E-mail address: james |
@westexe.demon.co.uk |
Loading...