3 Replies Latest reply: Apr 29, 2014 2:11 PM by Dude! RSS

    Linux meminfo very high slab

    tbrinkmann

      Hi,

       

      we face a problem with on of our linux SLES Database Server. The kernel is consuming 80% of the memory for the slab.

       

      SLES 11.3

      Linux 3.0.101-0.21-default

       

      MemTotal:  12195516 kB
      MemFree:     219028 kB
      Slab:       9364632 kB
      SReclaimable:6859668 kB

       

      Normally the SLAB is reclaimable by kernel itself or by command

       

      #>echo 2 > /proc/sys/vm/drop_caches

       

      But in our case the kernel do not free the space. So the databases are swapping blocks to the hard disk.

       

      Does anyone see some behavior like this in the past ?

      Does this maybe a kernel bug ?

      Is it possible to limit the slab ?

       

      Thanks a lot !!!

        • 1. Re: Linux meminfo very high slab
          Dude!

          What is the output of the following:

           

          sysctl vm.swappiness

          df /dev/shm

          ipcs -um?

          cat /proc/meminfo


          Are you using any kind of virtualization?

           

          How do you have "swappiness" defined: Swappiness - Wikipedia, the free encyclopedia

          • 2. Re: Linux meminfo very high slab
            tbrinkmann

            Re Dude,

             

            here are the output.

             

            #> sysctl vm.swappiness

            vm.swappiness = 60

             

            #> df  /dev/shm

            Filesystem     1K-blocks  Used Available Use% Mounted on

            tmpfs            6097756   244   6097512   1% /dev/shm

             

            #> ipcs -um

             

            ------ Shared Memory Status --------

            segments allocated 9

            pages allocated 415

            pages resident  63

            pages swapped   154

            Swap performance: 0 attempts     0 successes

             

            #> cat /proc/meminfo

            MemTotal:       12195516 kB

            MemFree:          614656 kB

            Buffers:            1304 kB

            Cached:            91512 kB

            SwapCached:       207964 kB

            Active:           505684 kB

            Inactive:         154976 kB

            Active(anon):     486100 kB

            Inactive(anon):    87416 kB

            Active(file):      19584 kB

            Inactive(file):    67560 kB

            Unevictable:       21948 kB

            Mlocked:           19904 kB

            SwapTotal:       2096476 kB

            SwapFree:        1048424 kB

            Dirty:              2836 kB

            Writeback:             0 kB

            AnonPages:        540516 kB

            Mapped:            14804 kB

            Shmem:              1208 kB

            Slab:            8721500 kB

            SReclaimable:    6802156 kB

            SUnreclaim:      1919344 kB

            KernelStack:       10464 kB

            PageTables:        27392 kB

            NFS_Unstable:          0 kB

            Bounce:                0 kB

            WritebackTmp:          0 kB

            CommitLimit:     8194232 kB

            Committed_AS:    7583852 kB

            VmallocTotal:   34359738367 kB

            VmallocUsed:      533156 kB

            VmallocChunk:   34359149900 kB

            HardwareCorrupted:     0 kB

            AnonHugePages:     83968 kB

            HugePages_Total:       0

            HugePages_Free:        0

            HugePages_Rsvd:        0

            HugePages_Surp:        0

            Hugepagesize:       2048 kB

            DirectMap4k:      246064 kB

            DirectMap2M:    12335104 kB

             

            Thanks for the help

            • 3. Re: Linux meminfo very high slab
              Dude!

              Where do you see that your databases are swapping blocks to the hard disk? Slab is not memory swapped to disk, but memory used by the kernel cache. This could be for all kinds of purpose to improve I/O, such as file system caching. You can see more info using the slabinfo or vmstat -m command. The kernel buffer cache will never be swapped to disk and it's size is automatically adjusted when applications require more memory.

               

              You have some swap space allocated, but that could also be from a previous swap usage. If you want to prevent that your Oracle database swaps any shared memory (Database SGA) to the disk it is the best idea to configure and use kernel hugepages. The use of hugepages should also improve your Oracle database performance and provide more efficient memory use by reducing the memory page table size and improving TLB page caching.

               

              To free pagecache: echo 1 > /proc/sys/vm/drop_caches

              To free reclaimable slab objects (includes dentries and inodes): echo 2 > /proc/sys/vm/drop_caches

              To free slab objects and pagecache: echo 3 > /proc/sys/vm/drop_caches

               

              Your meminfo shows reclaimable slab though. Why that is not released, I don't know. Maybe a kernel issue. But if you are worried about your database using swap, I suggest kernel hugepages anyway.