Обсуждение: ubuntu swap space

Поиск
Список
Период
Сортировка

ubuntu swap space

От
Kasia Tuszynska
Дата:

Hello Admin Group:

We are configuring Postgres on Ubuntu (LLynx) and trying to figure out what is the best way of dealing with swap since, Ubuntu does not automatically come with swap storage assigned.

Nothing but Postgres will be running on the machine.

I have read that we should assign twice the available RAM to swap, that seems like a lot.

Would Postgres ever use so much space? I understand if I were to load records that were gigs in size but that is very rare or at least I do not expect it in my case.

 

Any recommendations or best practices?

Thank you,

Sincerely,

Kasia

Re: ubuntu swap space

От
"Kevin Grittner"
Дата:
Kasia Tuszynska <ktuszynska@esri.com> wrote:

> We are configuring Postgres on Ubuntu

> Nothing but Postgres will be running on the machine. I have read
> that we should assign twice the available RAM to swap, that seems
> like a lot.

I remember years ago reading that if swap space was twice RAM, that
Linux could use a different algorithm for swapping, which was
generally expected to be faster.  I don't know whether that is still
true.

> Would Postgres ever use so much space?

It could, in certain conditions, but you would probably not like the
performance.  You're best off avoiding overcommitting memory to that
extent.

> Any recommendations or best practices?

I would follow the general recommendations for the OS, and worry
about tuning PostgreSQL memory usage so that you don't drive
anything significant into swap space.  On our production systems we
generally see a very small amount swapped out fairly early which
doesn't grow and is never swapped back in.  I suspect it is
OS-related code which we're not using.

-Kevin

Re: ubuntu swap space

От
Scott Marlowe
Дата:
On Tue, Apr 5, 2011 at 5:34 PM, Kasia Tuszynska <ktuszynska@esri.com> wrote:
> Hello Admin Group:
>
> We are configuring Postgres on Ubuntu (LLynx) and trying to figure out what
> is the best way of dealing with swap since, Ubuntu does not automatically
> come with swap storage assigned.
>
> Nothing but Postgres will be running on the machine.
>
> I have read that we should assign twice the available RAM to swap, that
> seems like a lot.
>
> Would Postgres ever use so much space? I understand if I were to load
> records that were gigs in size but that is very rare or at least I do not
> expect it in my case.
>
>
>
> Any recommendations or best practices?

We have two machines each with 128G, and we had to turn off swap due
to the kswapd going crazy and constantly trying to use swap it didn't
need.  Brought our production dbs to a crawl.  My recommendation is to
have enough memory to not ever need swap space if you can afford it.