Unix Technical Forum

Swapping

This is a discussion on Swapping within the Pgsql Performance forums, part of the PostgreSQL category; --> Hi, I´m trying to tune a linux box with a 12 GB database and 4 GB RAM. First of ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 12:20 PM
Carlos Henrique Reimer
 
Posts: n/a
Default Swapping

Hi,

I´m trying to tune a linux box with a 12 GB database and 4 GB RAM. First of all I would like to stop the swapping, so the shared_buffers and sort_mem were decreased but even so it started swapping two hours after DBMS started up.

I would like to know some suggestions how to discover why is it swapping?

I´ve collected the following data from the environment and saved at http://paginas.terra.com.br/educacao/rei/dados.htm

1. select version()
2. uname -a
3. cat /proc/cpuinfo
4. cat /proc/meminfo
5. vmstat 5
6. pg_stat_activity
7. postgresql.conf

Thanks in advance!

Reimer


__________________________________________________
Converse com seus amigos em tempo real com o Yahoo! Messenger
http://br.download.yahoo.com/messenger/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 12:20 PM
Tom Lane
 
Posts: n/a
Default Re: Swapping

Carlos Henrique Reimer <carlosreimer@yahoo.com.br> writes:
> I would like to know some suggestions how to discover why is it swapping?


Zero swap-in rate and swap-out rates in the single digits do not
constitute a swapping problem. It's reasonably likely that that
traffic isn't even coming from Postgres, but something else.
I'd say ignore it.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 12:20 PM
Tobias Brox
 
Posts: n/a
Default Re: Swapping

[Carlos Henrique Reimer - Wed at 03:25:15PM -0300]
> I´m trying to tune a linux box with a 12 GB database and 4 GB RAM. First
> of all I would like to stop the swapping, so the shared_buffers and sort_mem
> were decreased but even so it started swapping two hours after DBMS started
> up.
>
> I would like to know some suggestions how to discover why is it swapping?


I agree with Tom Lane, nothing to worry about. Swapping is not a problem
per se, aggressive swapping is a problem. If you are absolutely sure you
want to ban all swapping, use "swapoff"?

I'd trust linux to handle swap/cache sensibly. Eventually, become involved
with kernel hacking ;-)

--
Notice of Confidentiality: This email is sent unencrypted over the network,
and may be stored on several email servers; it can be read by third parties
as easy as a postcard. Do not rely on email for confidential information.

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 12:20 PM
Tobias Brox
 
Posts: n/a
Default Re: Swapping

[Tobias Brox - Wed at 09:22:17PM +0200]
> I'd trust linux to handle swap/cache sensibly. Eventually, become involved
> with kernel hacking ;-)


Of course, there are also some files in /proc/sys/vm that you may want to
peek into, for tuning the swapping. Particularly, at later 2.6-kernels (I'm
running 2.6.12) you have the file /proc/sys/vm/swappiness, where the number
should be some percentage. I'm not completely sure how it works, but I
suppose that the higher you set it, the more likely it is to swap out
memory not beeing used. I think the default setting is probably sane, but
you may want to google a bit about it.

--
Notice of Confidentiality: This email is sent unencrypted over the network,
and may be stored on several email servers; it can be read by third parties
as easy as a postcard. Do not rely on email for confidential information.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

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 06:53 PM.


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