Solved

swap question and free buffers

Posted on 2014-11-21
4
236 Views
Last Modified: 2014-11-21
I was wondering why would RHEL use swap , when there are Free buffers (shown in free command)
In our case when we see free memory in top command getting exhausted, The server is using SWAP even though I see the Free buffers.

top - 16:57:41 up 26 days, 15:44,  3 users,  load average: 1.28, 1.91, 2.20
Tasks: 1477 total,   1 running, 1474 sleeping,   0 stopped,   2 zombie
Cpu(s):  0.2%us,  1.5%sy,  0.0%ni, 93.3%id,  5.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  126011368k total, 120899848k used,  5111520k free,     1216k buffers
Swap: 781411152k total, 14705180k used, 766705972k free, 42577308k cached

   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
   181 root      20   0     0    0    0 D 20.4  0.0   2959:04 kswapd0
101309 oracle    20   0 16192 2168  664 S  1.3  0.0   0:29.11 top
 58546 oracle    20   0 50.2g 3.9g 3.8g S  1.0  3.2   9:39.78 oracle
108427 xxx-user  20   0 16104 2420 1000 R  1.0  0.0   0:00.16 top
    73 root      20   0     0    0    0 S  0.3  0.0   4:36.71 events/6
  2589 root      20   0  195m 2600 1140 S  0.3  0.0 128:49.36 snmpd
 34482 oracle    20   0 50.2g  89m  80m S  0.3  0.1  42:57.32 oracle
 34488 oracle    20   0 50.2g  14g  14g S  0.3 11.8  29:04.97 oracle
 34490 oracle    20   0 50.2g  14g  14g S  0.3 11.7  28:52.22 oracle
 34492 oracle    20   0 50.2g  14g  14g S  0.3 11.8  29:13.85 oracle
 34494 oracle    20   0 50.2g  13g  13g S  0.3 11.5  28:47.19 oracle
 45764 oracle    20   0 50.2g 3.1g 3.1g S  0.3  2.5   2:45.73 oracle
 89881 oracle    20   0 50.3g  12g  12g S  0.3 10.1  56:44.77 oracle
112926 oracle    20   0 50.3g 3.5g 3.5g S  0.3  2.9   5:27.46 oracle
0
Comment
Question by:Peter Kuczynski
  • 2
  • 2
4 Comments
 
LVL 34

Expert Comment

by:Seth Simmons
ID: 40457816
by default, the kernel will swap out unused memory pages
there is a setting called swappiness; the default is 60
you can verify by doing cat /proc/sys/vm/swappiness
you can change it by doing echo 0 > /proc/sys/vm/swappiness which will cause the system to keep more in physical memory.  this is actually a recommended setting by oracle which i have used in the past
to make it permanent, add a line vm.swappiness = 0 to /etc/sysctl.conf

what version of RHEL?  your swap partition seems huge; should really need much
little to no swap usage is ideal in a system like that.  you can use vmstat to monitor the realtime usage
columns si and so (swap in and swap out) you want to pay attention to.  if these are constantly non-zero then you have a bottleneck that could affect oracle performance
0
 
LVL 1

Author Comment

by:Peter Kuczynski
ID: 40457876
thanks Seth,
we are using RHEL 6.5, Can this be because we are not using hugepages?
we recently disabled THP

#SWAP
vm.swappiness = 15 <<<<<this was originally 0
vm.dirty_background_ratio = 5
vm.dirty_ratio = 10  <<<<<this was originally 80
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
[root@EGS-ORACLEPROD-01 ec2-user]#

 vmstat 5 5
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 3  1 12084124 1208464    788 45135084   33   21  1678   748    0    0 11  4 82  3  0
 3  2 12073976 1192172    888 45144792 2070  211 61896 47374 26706 17685 15  6 73  6  0
 6  0 12075904 1580260    772 45144320 3427 3968 15995 24783 30457 21892 12  8 73  7  0
 9  2 12067204 1657068   1032 45157736 1745   63 12306  9830 31609 24469 12  9 73  6  0
 3  0 12072836 1719692   1064 45143564 1380 2388  5535 15386 29756 22788  9 10 76  5  0
0
 
LVL 34

Accepted Solution

by:
Seth Simmons earned 500 total points
ID: 40457915
not sure
the oracle 10/11 systems i worked with before didn't have this much memory; usually only about 64gb
you could open a new question for that and include oracle in the list of topics since it's more related to that
the fact that the so/si values are non-zero indicates constant swapping so there definitely is an issue there
if you run iostat you should see a fair amount of activity on the swap partition which could slow down oracle
0
 
LVL 1

Author Comment

by:Peter Kuczynski
ID: 40458006
ok, we did that,

I am setting hugepages to

vm.nr_hugepages = 25604

per this helpful article, lets see what happens : )
https://docs.oracle.com/cd/E11882_01/server.112/e10839/appi_vlm.htm#UNXAR396
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question