Skip site navigation (1) Skip section navigation (2)

Re: Memory question

From: Thomas Swan <tswan(at)idigx(dot)com>
To: Arjen van der Meijden <acm(at)tweakers(dot)net>
Cc: "'Matthew Hixson'" <hixson(at)poindextrose(dot)org>,pgsql-performance(at)postgresql(dot)org
Subject: Re: Memory question
Date: 2003-06-30 05:49:39
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Arjen van der Meijden wrote:

>>I've heard that too, but it doesn't seem to make much sense 
>>to me.  If 
>>you get to the point where your machine is _needing_ 2GB of swap then 
>>something has gone horribly wrong (or you just need more RAM in the 
>>machine) and it will just crawl until the kernel kills off whatever 
>>process causes the swap space to be exceeded.  Seems to me that you 
>>should only have that much swap if you can't afford more RAM 
>>or you've 
>>tapped out your machine's capacity, and your application needs that 
>>much memory.
>>   -M@
>I've heard the same, the reason behind it was that there needs to be
>one-to-one copy of the memory to be able to swap out everything and to
>have a gain in the total "memory", you'd need twice as much swap as
>memory to have a doubling of your memory.
>But afaik this behaviour has been adjusted since the 2.4.5 kernel and
>isn't a real issue anymore.
It may be different in vendor released kernels as the default overcommit 
behavior of the Linux kernel may vary.  More detailed discussions can be 
found on the LKML, or you can find some useful summaries by searching 
through the last couple "Kernel Traffic" issues <> .. 
I had some unexpected problems on one system, an older RH distribution,  
until I actually set the swap to be double the 2GB of ram on the system: 

>Please keep in mind that I'm no expert at all on linux, so if you want
>to be sure, you'd better mail to the kernel-mailinglist orso :)
>Anyway, I manage a few machines with 1GB++ memory and none of them has
>more than 1G of swap and none of them uses that swap for more than a few
>MB unless something was terribly wrong, so the actual 'risk' probably
>doesn't have a high chance to occur.
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?

In response to

pgsql-performance by date

Next:From: Jonathan GardnerDate: 2003-06-30 16:02:12
Subject: Re: Memory question
Previous:From: Arjen van der MeijdenDate: 2003-06-28 11:58:09
Subject: Re: 'best practises' to speed up sorting? tuning postgresql.conf

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group