Unix Technical Forum

Swap aprtition size

This is a discussion on Swap aprtition size within the Debian Linux support forums, part of the Debian Linux category; --> Hello, I was just wondering about swap partitions. What size do you use? The old rule of thumb was ...


Go Back   Unix Technical Forum > Unix Operating Systems > Debian Linux > Debian Linux support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-19-2008, 07:16 AM
Steve
 
Posts: n/a
Default Swap aprtition size

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-19-2008, 07:16 AM
Bill Marcum
 
Posts: n/a
Default Re: Swap aprtition size

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-19-2008, 07:17 AM
zekolas
 
Posts: n/a
Default Re: Swap aprtition size

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-19-2008, 07:17 AM
Robert Glueck
 
Posts: n/a
Default Re: Swap aprtition size

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/softwar...rnel/swap.html
http://sourcefrog.net/weblog/softwar.../free-mem.html

Robert


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-19-2008, 07:17 AM
SteveSch
 
Posts: n/a
Default Re: Swap aprtition size

Thank you all very much.

Great links.

Steve
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:23 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com