Re: Memory and Swap

From: "Campbell, Lance" <lance(at)illinois(dot)edu>
To: "'Fernando Hevia'" <fhevia(at)gmail(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Memory and Swap
Date: 2016-05-18 14:37:21
Message-ID: B75CD08C73BD3543B97E4EF3964B7D7020395869@CITESMBX1.ad.uillinois.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thanks for the reply.
What are the values that can appear in the column SI and SO? Are those disk blocks? Also how high would those numbers possibly get in those two columns before I should be concerned. I am noticing two digit number like 84. Every once in a while it will spike to something like 814.

Lance

From: Fernando Hevia [mailto:fhevia(at)gmail(dot)com]
Sent: Wednesday, May 11, 2016 3:14 PM
To: Campbell, Lance <lance(at)illinois(dot)edu>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] Memory and Swap

I wouldn't worry about the system using swap while there is plenty of free RAM available. As others have stated, it is a rather common situation. The kernel might decide on moving some seldom accessed memory pages to swap in order to make RAM available for future demand. But when RAM starts running low, do keep and eye on how many bytes are actually being swapped. You can use vmstat to show the amount of bytes being swapped in/out of the system.

I.e: vmstat output of a system with no swapping taking place and marginal swap usage:

~# vmstat 5
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
2 0 28052 363992 156736 1251116 0 0 6 15 1 7 2 1 97 0
0 0 28052 363964 156736 1251128 0 0 0 13 759 283 2 2 96 0
0 0 28052 371132 156736 1251132 0 0 0 5 348 287 1 1 98 0

Any value > 0 means the system is actually reading from or writing to swap, at the same time you should notice a severe downgrade of the system's performance.

On Tue, May 10, 2016 at 5:23 PM, Campbell, Lance <lance(at)illinois(dot)edu<mailto:lance(at)illinois(dot)edu>> wrote:
PostgreSQL 9.5.2
Linux Red Hat

I have 10 G of memory. Nagios is saying I have 2 G used and 8 G free.

Yet my swap is at 1 G.

1) Why is that?

2) Over that past week it has climbed from almost nothing to 1 G. It is a steady climb. No big jump.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Payal Singh 2016-05-18 14:37:45 Re: Table symbolic link
Previous Message Joe Conway 2016-05-18 14:37:11 Re: Table symbolic link