LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-05-2016, 05:15 AM   #1
avancada
LQ Newbie
 
Registered: Sep 2016
Posts: 3

Rep: Reputation: Disabled
why swapping


Why is my (Oracle) system using swapspace? There is 9 from the 12G memory available.
Code:
[oracle@ora3 dev]$ vmstat 3 100
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 2  6 4577960  62700   5684 9264632   27   14  1916   136    0    0  6  2 87  6  0
 0  6 4582024  62020   3984 9278676  112 2763 54297  3007 2415 5555  4  5 68 23  0
 0  2 4583040  65056   3792 9277516  499  379 37416   759 2416 6264  8  6 67 19  0
 0  3 4587340  63644   3136 9292480   53 1817 73836  2316 2401 5695  5  5 71 19  0
 2  1 4587384  72788   2260 9288900  648 1247 66836  1743 2474 5732  4  5 75 17  0
 1  3 4587688  63516   1960 9295116   68  829 54667  1177 2385 5675  5  5 75 15  0

You have new mail in /var/spool/mail/oracle
[oracle@ora3 dev]$ free -m
             total       used       free     shared    buffers     cached
Mem:         12007      11943         63          0          1       9076
-/+ buffers/cache:       2865       9141
Swap:        42047       4480      37567
 
Old 09-05-2016, 08:13 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,609

Rep: Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702
What do you have vm.swappiness set to?
 
Old 09-08-2016, 03:02 AM   #3
avancada
LQ Newbie
 
Registered: Sep 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
What do you have vm.swappiness set to?
cat /proc/sys/vm/swappiness
60
 
Old 09-08-2016, 09:26 AM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,959

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
Various long-running processes will use a page on startup, then never reference it again. Even in the absence of memory pressure, those pages eventually migrate out to swap unless you have swappiness set to a very low number.
 
Old 09-14-2016, 04:53 AM   #5
avancada
LQ Newbie
 
Registered: Sep 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post
Various long-running processes will use a page on startup, then never reference it again. Even in the absence of memory pressure, those pages eventually migrate out to swap unless you have swappiness set to a very low number.
I would expect that it will trigger swap now and then, not whole the time.
 
Old 09-14-2016, 06:56 AM   #6
wpeckham
Senior Member
 
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,653

Rep: Reputation: 569Reputation: 569Reputation: 569Reputation: 569Reputation: 569Reputation: 569
Swap is traditionally used for stability on systems that may occasionally need more memory than is available.
Swap is currently used for more things, and one is performance. Process resources that are in wait or sleep status for long can be swapped out to allow remaining processes to run faster, and so that the kernel and stack can make better use of memory. This does not require memory to be short, just for there to be ways to use it to speed up they system without impacting running processes.
Just because you see swap used does not imply that something is wrong. In fact, if swap is NOT used it can mean that your system is not tuned for optimum performance. I run systems with upwards of 128G ram regularly (320G is common) hosting resource heavy data operations. Getting the right 'tune' for optimal performance is a real art, and one I cannot claim to have mastered. When you get it right, you do see swap used even though Ram usage may appear to not quite hit 60%. The rest is being heavily used behind the scenes for buffers and caching, without which even these systems become real DOGS!

A snapshot does not really tell the picture well. To get a better look, try "watch free" in one window, then run some of your common processes that load up cpu and memory in another. You will see about what one would expect. Then run some disk and network I/O intensive data processes, and watch the fun!
 
Old 09-14-2016, 07:40 AM   #7
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 805

Rep: Reputation: 186Reputation: 186
As wpackham says swap usage alone shouldn't worry you if your main app (presumably oracle server) is OK.

If the system is being used almost exclusively for oracle, your next investigation should focus on the oracle memory space assignments (SGA and all that stuff). Some of the Oracle areas - which use memory - may be above their threshold limits.

OK

Last edited by AnanthaP; 09-14-2016 at 07:41 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
>> page swapping << devil_ Programming 1 04-10-2010 06:59 AM
Hot swapping? gauge73 Linux - Hardware 3 08-10-2005 01:52 PM
HOW TO -Swapping HD-0 to HD-1 ? penguinlnx Linux - Hardware 9 05-01-2005 06:36 AM
swapping HD ZaphyR Linux - Hardware 2 01-16-2005 11:11 AM
swapping hardware blitzen Linux - Hardware 4 08-01-2004 05:26 PM


All times are GMT -5. The time now is 12:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration