Re: icps, shmmax and shmall - Shared Memory tuning

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: icps, shmmax and shmall - Shared Memory tuning
Дата
Msg-id 20020429191255.A13755@svana.org
обсуждение исходный текст
Ответ на Re: icps, shmmax and shmall - Shared Memory tuning  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
Ответы Re: icps, shmmax and shmall - Shared Memory tuning  (dorian dorian <dorian37076@yahoo.com>)
Список pgsql-general
On Mon, Apr 29, 2002 at 04:38:17PM +0800, Lincoln Yeoh wrote:
> At 02:52 PM 4/29/02 +1000, Martijn van Oosterhout wrote:
> >I'm not saying it's a good idea. Indeed, people saying all the time it's
> >bad. But it is the default. If people don't like then they should set the
> >over_commit sysctl off (I forget the exact name).
>
> Can't find anything on it on the Linux doc site (tldp). Any links?

Somewhere in /proc. It's documented in the kernel source.

> Is it better to turn off overcommit and buy more RAM? That way postgresql
> or some other process doesn't get killed?

All turning off overcommit will do is cause your postgres to die with out of
memory earlier instead. Buying more memory is certainly an option. But it
would be better to work what is actually using the memory. Hypothetically,
if one of your users is DoSing your system, buying more memory won't help.

> All along I had the impression that Linux had big probs with its VM (since
> 2.x) with OOM situations (and not so good impressions of the people in
> charge of it), and so it's mainly because of overcommit? Ack.

No, it's mainly because people disagree what the system should do about it.
Overcommit means that people are allowed to allocate stuff without using it
and that's ok. For example, look at the following program:

while(1)
  malloc(1024000);

With overcommit on, this program is harmless. The program will fill up it's
entire address space and stop. With overcommit off, every other program will
start getting out of memory errors. What is the solution here? Newer
versions of linux will kill a process like this, I don't know what other
OSes do.

Linux's VM problems are unrelated to this. They have to do with system
behaviour as sizeof(Working Set) approaches sizeof(Physical Memory). Bad is
if the machine continuously swaps, good if the machine stays reasonably
responsive. If you are experiencing this situation often, more memory is
necessary.

Hope this clears up any confusion,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Canada, Mexico, and Australia form the Axis of Nations That
> Are Actually Quite Nice But Secretly Have Nasty Thoughts About America

В списке pgsql-general по дате отправления:

Предыдущее
От: "Arsalan Zaidi"
Дата:
Сообщение: Re: icps, shmmax and shmall - Shared Memory tuning
Следующее
От: rich@annexia.org
Дата:
Сообщение: What popular, large commercial websites run PostgreSQL?