Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do you calculate swap drive space?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
BonezTheGoon
Bodhisattva
Bodhisattva


Joined: 14 Jun 2002
Posts: 1375
Location: Albuquerque, NM -- birthplace of Microsoft and Gentoo

PostPosted: Wed Jul 17, 2002 11:19 pm    Post subject: How do you calculate swap drive space? Reply with quote

What method do you think is "best" for performance (speed without sacrifice of stability) in choosing a swap partition size in relation to the amount of physical RAM.

--OR--

Do you think that physical RAM has any part in choosing the swap size, if not how do you choose?

(almost did a poll but what's the point with such a complex poll?)

Thanks in advance!!

Regards,
BonezTheGoon
Back to top
View user's profile Send private message
klieber
Administrator
Administrator


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Wed Jul 17, 2002 11:24 pm    Post subject: Re: How do you calculate swap drive space? Reply with quote

BonezTheGoon wrote:
Do you think that physical RAM has any part in choosing the swap size, if not how do you choose?


Well of course physical RAM has a part in choosing swap size. If you run programs that, when combined together, need 128MB of RAM and you've only got 64MB of physical memory installed, you need 64MB of swap.

As for how I choose, if I'm being particularly anal that day, I'll figure out how many programs/daemons/services I'm likely to run on that box, look at their memory requirements, figure out how much RAM I have and add enough swap (plus a buffer) to compensate for it.

Or, if I'm lazy, I'll look at the new 120GB drive that I just bought, say "fsck it" and give myself a 1GB swap partition so I don't have to worry about it.

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Thu Jul 18, 2002 2:48 am    Post subject: Reply with quote

Ditto. I generally don't leave machines under half a gigabyte of RAM+swap (depending on what they do), but my current machine with a GB of RAM has a GB of swap because, like klieber, it's a large (80 GB) disk.
_________________
I don't believe in witty sigs.
Back to top
View user's profile Send private message
Shak
n00b
n00b


Joined: 13 Jul 2002
Posts: 34
Location: Huddersfield UK

PostPosted: Thu Jul 18, 2002 3:44 pm    Post subject: Reply with quote

I use the "old school" theory of 2 x the RAM therefore 1024MBs for me :)

Shak
Back to top
View user's profile Send private message
BonezTheGoon
Bodhisattva
Bodhisattva


Joined: 14 Jun 2002
Posts: 1375
Location: Albuquerque, NM -- birthplace of Microsoft and Gentoo

PostPosted: Thu Jul 18, 2002 3:55 pm    Post subject: Reply with quote

delta407 wrote:
Ditto. I generally don't leave machines under half a gigabyte of RAM+swap (depending on what they do), but my current machine with a GB of RAM has a GB of swap because, like klieber, it's a large (80 GB) disk.


So you don't see any need to have 2GB of swap? The more the merrier? he he. I am just trying to find out what the informed public uses, so I can get a better feeling of what I myself think is reasonable (so as much description as everyone can stomach on their own personal thought process would be appreciated!). I am sort of used to the M$ way of doing things, where even if you had 2GB of physical RAM running the same exact things a machine with 128MB of physical RAM is, you still need double your physical -- therefore you spend 4GB on swap/VirtualMem.

So you guys might say then that if you have 2GB of physical RAM and the machine will never use that much then a swap could be omitted entirely?

Just asking asking asking, feel free to tell me to shut-up! (Like a four year old I am, why is the sky blue, why do we have mountains, why why why)

Regards,
BonezTheGoon
Back to top
View user's profile Send private message
klieber
Administrator
Administrator


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Thu Jul 18, 2002 4:43 pm    Post subject: Reply with quote

BonezTheGoon wrote:
So you guys might say then that if you have 2GB of physical RAM and the machine will never use that much then a swap could be omitted entirely?


I would never eliminate swap entirely. Linux has some agressive memory handling to improve performance -- it swaps unused/less-used pages out to disk simply to make things faster. Thus, it's always a good idea to have at least a few MB of swap.

Again, the "correct" way to figure swap is to look at what is going to be running on the machine. If it's going to be a massive database server, 2GB of RAM might not be enough and you may need to allocate lots of swap. If it's a desktop machine and you're just going to be surfing the web, checking email and other stuff, all within what would commonly be considered "normal usage", then rip out 1GB of that RAM, send it to me and make do with 1GB of RAM and a bit of swap. :)

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
BonezTheGoon
Bodhisattva
Bodhisattva


Joined: 14 Jun 2002
Posts: 1375
Location: Albuquerque, NM -- birthplace of Microsoft and Gentoo

PostPosted: Thu Jul 18, 2002 7:06 pm    Post subject: Reply with quote

OK OK I see I wasn't very specific. On a desktop machine, a toy machine, for gaming and browsing and other such distractions in life. It is also you (the users) primary machine, so you don't want it to be slow.

Now then, I am looking for what people do "in practice" -- Not in theory, or the "correct" way of doing it. I understand that optimizing a server to be custom tailored for each app and thread it will be running is really cool and all, but I am looking for a general method that you use on your desktop (I know I didn't state that before, my mistake) -- Just your quick and dirty method that you use on your main desktop.

Keep in mind I don't think there is a wrong answer to this question and I am really mostly just taking some sort of detailed poll -- not trying to get support. It's like a science fair project or something, I will come away with a better understanding (is my theory anyway.)

Thanks,
BonezTheGoon
Back to top
View user's profile Send private message
phong
Bodhisattva
Bodhisattva


Joined: 16 Jul 2002
Posts: 778
Location: Michigan - 15 & Ryan

PostPosted: Fri Jul 19, 2002 2:45 pm    Post subject: Reply with quote

The rule of thumb I've always used is to make the swap space equal to twice that of your physical RAM. Now that I think about it though, that doesn't make any sense at all. A machine that is strapped for RAM needs more swap space than one that has tons...

Of course, my Gentoo experimental machine is a P133 with 64 megs of ram and a dinky 128 meg swap and two slow, small hard drives cobbled together from parts lying around here. Took ages to compile, but runs like a charm and boots a zillion times faster than it ever did with Red Hat or Mandrake.
Back to top
View user's profile Send private message
gsfgf
Veteran
Veteran


Joined: 08 May 2002
Posts: 1266

PostPosted: Sun Jul 21, 2002 4:17 pm    Post subject: Reply with quote

I use 2x phys RAM, so 1.5GB for me. Of course w/ flux, opera, VMWare, QTDesigner, and sypheed (basically all i use) i use about 100MB RAM and no swap
Back to top
View user's profile Send private message
DArtagnan
l33t
l33t


Joined: 30 Apr 2002
Posts: 942
Location: Israel, Jerusalem

PostPosted: Sun Jul 21, 2002 7:26 pm    Post subject: Reply with quote

Right now I compile ( update the QT 3.0.5 )
Code:

10:38pm  up  3:49,  1 user,  load average: 2.46, 2.44, 2.52
72 processes: 65 sleeping, 7 running, 0 zombie, 0 stopped
CPU states: 89.1% user, 10.8% system,  0.0% nice,  0.0% idle
Mem:   256508K av,  215096K used,   41412K free,       0K shrd,     968K buff
Swap:  208836K av,   19536K used,  189300K free                  115396K cached


How is possible that my SWAP is not used for full ?
Very rarely that my SWAP is on use...
Maybe i did some wrong?
_________________
All for one and one for All
--

MACPRO machine...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum