Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Mar 12, 2009 12:58 pm 
Offline
Junior Member
User avatar

Joined: Mon Mar 02, 2009 10:45 pm
Posts: 38
Is it normal for my Linode to be swapping out to the swap file occasionally even when it has 200+MB of RAM free? Slowly over time, it seems to be using more and more of the swap and according to free, that swap is never reclaimed.

Here is a sample output from free -m:
Code:
             total       used       free     shared    buffers     cached                           
Mem:           360        311         48          0         10        181                           
-/+ buffers/cache:        119        241                                                           
Swap:          255         72        183                                                           


That 72 used swap never seems to get reclaimed. And I have not been able to find any evidence that I was ever in any danger of running out of memory.

I'm running Ubuntu 8.10 64bit. Is this normal?

.


Top
   
 Post subject:
PostPosted: Thu Mar 12, 2009 1:13 pm 
Offline
Senior Member

Joined: Fri Dec 07, 2007 1:37 am
Posts: 385
Location: NC, USA
Not an expert on this, but I think that once something does get swapped out it is normal for it to stay swapped out until it is actually needed again.

I think the swappiness parameter tells the kernel how aggressively to swap - you can check what yours is set to by
Code:
$ cat /proc/sys/vm/swappiness

The value 60 is the default, and I think higher means more agressive swapping.


Top
   
 Post subject:
PostPosted: Thu Mar 12, 2009 2:09 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Unless your RAM is (nearly) full, there's little need to be worried about swap use. Linux is clever. It usually knows best what should be placed in RAM, what should be placed in swap, and what should be loaded from disk on request. In fact, that 70M of swap could improve performance by freeing up more RAM for buffers and cache.


Top
   
PostPosted: Thu Mar 12, 2009 2:21 pm 
Offline
Senior Member

Joined: Thu Apr 03, 2008 12:02 am
Posts: 103
AOL: derole
Lykaon wrote:
That 72 used swap never seems to get reclaimed. And I have not been able to find any evidence that I was ever in any danger of running out of memory.


my linode (360) shows exactly the same behaviour, nothing seems to be wrong with it.
i looked at my munin logs and i always have a few megs of swap allocated (even though i have >150MB of free memory) but the swap in/out graph barely shows any activity so i don't think there is a performance problem.


Top
   
 Post subject:
PostPosted: Thu Mar 12, 2009 2:55 pm 
Offline
Junior Member
User avatar

Joined: Mon Mar 02, 2009 10:45 pm
Posts: 38
Thanks everyone. Sounds like I can stop worrying about it then. :P


Top
   
 Post subject:
PostPosted: Thu Mar 12, 2009 5:53 pm 
Offline
Senior Member

Joined: Wed Jan 21, 2009 7:13 pm
Posts: 126
Location: Portugal
I made the same question ...
http://www.linode.com/forums/viewtopic. ... highlight=


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group