Linux Debian support - Swap aprtition size

This is Interesting: Free IT Magazines  
Home > Archive > Linux Debian support > October 2005 > Swap aprtition size





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Swap aprtition size
Steve

2005-10-24, 9:42 am

Hello,

I was just wondering about swap partitions. What size do you use?

The old rule of thumb was to use 1-2.5 times the RAM. I also read it was
not good to exceed 256 Meg and if you had enough RAM, you probably can get
away without a swap partition. I also read that if you have a large swap
partition it is better to break it up into several small ones. I have
recently read that the swap partition should be at least the size of your
RAM. This is in case your system does a core dump to swap. If it is too
small, the dump may overwrite the data on your hard drive.

I put Debian Sarge on a machine 2X to play with it. Once with a 30Gig HD
and the 2.4 kernel. I let it auto partition just to see what it'd do. It
used 1Gig for the swap, which is the amount of my RAM. Seemed like a lot
from what I had read but OK, it worked great.

The next time I installed I used linux26 to get the 2.6 kernel. Again I
used the auto partition. This time I had my 200 Gig Seagate in the
machine, still 1 Gig RAM. The auto partition created a 2.7Gig swap
partition?

It just made me wonder what you guys have for a swap partition?

I have another machine with 512 Meg RAM, 160Gig HD. I have a 1Gig stick on
the way from newegg for that machine. Do I need to increase the size of my
swap partition?

Filesystem Size Used Avail Use% Mounted on
/dev/hdb1 9.2G 1.8G 7.0G 21% /
tmpfs 252M 0 252M 0% /dev/shm
/dev/hdb3 140G 112G 28G 81% /home
/dev/hda1 115G 86G 30G 75% /Win98

free:
Swap: 498004 38768 459236

I do a lot of graphics (maps) in Gimp that are over 10Meg file size. When
I run top, I can see my RAM max out quickly, as does my swap file. My
machine becomes very slow for a while.

Thanks in advance.

Steve
Bill Marcum

2005-10-24, 9:42 am

On Sat, 15 Oct 2005 19:49:47 -0600, Steve
<THIS_EMAIL@IS.FAKE> wrote:
>
> I do a lot of graphics (maps) in Gimp that are over 10Meg file size. When
> I run top, I can see my RAM max out quickly, as does my swap file. My
> machine becomes very slow for a while.
>

Using swap will cause your machine to run slowly. If you run out of
swap, processes may be killed at random to free more memory. The good
news is, if you need more swap, you don't need to repartition your hard
drive; you can use a swap file.

dd if=/dev/zero of=/swapfile bs=1M count=1000
mkswap /swapfile
swapon /swapfile
cat >> /etc/fstab <<END
/swapfile none swap sw 0 0
END


--
If the American dream is for Americans only, it will remain our dream
and never be our destiny.
-- René de Visme Williamson
zekolas

2005-10-24, 9:42 am

Steve wrote:
>
> I have another machine with 512 Meg RAM, 160Gig HD. I have a 1Gig stick on
> the way from newegg for that machine. Do I need to increase the size of my
> swap partition?
>
> Steve


Well it really depends on what you use your system for, there is no
right answer, however it is always good to have more swap then you need
then less. Best way to figure out how much swap you need is just monitor
your system as you use it, and see how much swap it is using.

For example I have 1.5 gigs of ram and at first I had a 2 gig swap, even
when I have open office, firefox, thunderbird, gaim, azurus and then
fired up americia's army I never used more then 150 megs of swap or so.
So next time I did a clean install I cut my swap down to 1 gig. However
Hard drive space is cheap so it is good to go on the large size.


You do not need to increase swap space just because you increase ram. If
anything since your system will have more ram, it will use less swap.

I know a few people that have 2 gigs of ram, and claim their system ran
faster when they shrunk their swap from 2 gigs down to 200megs. The idea
is the system will manage memory more strict and reduce swapping.
Robert Glueck

2005-10-24, 9:42 am

Steve wrote:
> Hello,
>
> I was just wondering about swap partitions. What size do you use?
>
> The old rule of thumb was to use 1-2.5 times the RAM. I also read it was
> not good to exceed 256 Meg and if you had enough RAM, you probably can get
> away without a swap partition. I also read that if you have a large swap
> partition it is better to break it up into several small ones. I have
> recently read that the swap partition should be at least the size of your
> RAM. This is in case your system does a core dump to swap. If it is too
> small, the dump may overwrite the data on your hard drive.
>
> I put Debian Sarge on a machine 2X to play with it. Once with a 30Gig HD
> and the 2.4 kernel. I let it auto partition just to see what it'd do. It
> used 1Gig for the swap, which is the amount of my RAM. Seemed like a lot
> from what I had read but OK, it worked great.
>
> The next time I installed I used linux26 to get the 2.6 kernel. Again I
> used the auto partition. This time I had my 200 Gig Seagate in the
> machine, still 1 Gig RAM. The auto partition created a 2.7Gig swap
> partition?
>
> It just made me wonder what you guys have for a swap partition?
>
> I have another machine with 512 Meg RAM, 160Gig HD. I have a 1Gig stick on
> the way from newegg for that machine. Do I need to increase the size of my
> swap partition?
>
> Filesystem Size Used Avail Use% Mounted on
> /dev/hdb1 9.2G 1.8G 7.0G 21% /
> tmpfs 252M 0 252M 0% /dev/shm
> /dev/hdb3 140G 112G 28G 81% /home
> /dev/hda1 115G 86G 30G 75% /Win98
>
> free:
> Swap: 498004 38768 459236
>
> I do a lot of graphics (maps) in Gimp that are over 10Meg file size. When
> I run top, I can see my RAM max out quickly, as does my swap file. My
> machine becomes very slow for a while.
>
> Thanks in advance.
>
> Steve


For an interesting discussion of swap space and free RAM
memory see

http://sourcefrog.net/weblog/softwa...ernel/swap.html
http://sourcefrog.net/weblog/softwa...l/free-mem.html

Robert


SteveSch

2005-10-24, 9:42 am

Thank you all very much.

Great links.

Steve
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com