1

I have allowed Postgres 30GB of RAM on our server. When running intensive tasks, I think it is swapping.

As I understand it:

  • VIRT - virtual memory (ie: swapped to disk)
  • RES - complete memory usage
  • SHR - shared memory - I'm not clear on what this is

See attached

updated top output

I think this is saying:

  • complete memory usage by Postgres ~60GB, of which 30GB is swapped
  • complete memory usage by Ruby ~40GB

If this is the case, does giving Postgres another 30 or 40GB RAM seem like a good idea?

Reference

http://mugurel.sumanariu.ro/linux/the-difference-among-virt-res-and-shr-in-top-output/

port5432
  • 173
  • 2
  • 5
  • 17
  • And what does top say about overall memory and swap state ? I mean Total/Active/Inactive/etc ? – drookie Feb 22 '16 at 16:07
  • I've updated the screenshot. It seems to say there is a lot of free memory ... so I don't really understand the VIRT column – port5432 Feb 22 '16 at 16:15

1 Answers1

3

VIRT colums does not really show the total allocated memory. Rather, it only show how much memory was mapped in the process user space. In other words, its has nothing to do with swapping.

As a double check, give at look at the swap row as shown by top: it clearly state that used swap is at 0 KB

shodanshok
  • 47,711
  • 7
  • 111
  • 180