Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Swap! How much?
PostPosted: Thu Feb 26, 2009 11:48 am 
Offline
Senior Member

Joined: Wed Jan 21, 2009 7:13 pm
Posts: 126
Location: Portugal
Hi,

I'm running vBulletin + vBSeo in a 360 linode with Apache (I know nginx :) ) + MySQL + Php5 + Exim for outgoing only.

My average swap is 30 MB. Is this to much? Is this bad? When should I upgrade?

Thanks


Top
   
 Post subject:
PostPosted: Thu Feb 26, 2009 12:54 pm 
Offline
Senior Member

Joined: Fri Feb 18, 2005 4:09 pm
Posts: 594
10-15% of available RAM does not see too bad to me...

James


Top
   
 Post subject:
PostPosted: Thu Feb 26, 2009 1:07 pm 
Offline
Senior Member

Joined: Fri Dec 07, 2007 1:37 am
Posts: 385
Location: NC, USA
I'd say how much swap you are using is less important than how actively you are using it. Try running
Code:
$ vmstat 60
and look at the si and so columns - they should tell you when you are actively swapping memory in and out.
If you have 30M going out to swap and staying there then you have no problems - if you are swapping 30M in and out every 5 seconds then you and your neighbors are probably not very happy ;)


Top
   
 Post subject:
PostPosted: Thu Feb 26, 2009 1:27 pm 
Offline
Senior Member

Joined: Wed Jan 21, 2009 7:13 pm
Posts: 126
Location: Portugal
Hi,

Thanks for both responses.
Here is vmstat 60:

Code:
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 0  0  21504  11628  22748 205496    0    0     1     4   13   14  0  0 99  0
 0  0  21504  10524  22800 205652    0    0     2    13   87  107  0  0 100  0
 0  0  21504   9468  22896 205880    0    0     4    23  151  190  0  0 99  0
 0  0  21520   8376  21432 202232    0    0     2   105  322  329  1  0 98  1
 0  0  21520  38080  21496 202304    0    0     1    21  121  135  0  0 99  0


At this time I have 80 simultaneous users in my forum. At night it can reach 100.

It looks good :)


Top
   
 Post subject:
PostPosted: Thu Feb 26, 2009 3:03 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
There's a couple numbers I like to look at on a vmstat:

1) buff + cache: This is about 223MB for you, which is excellent. This is how much memory the kernel is using to store disk-based objects in memory. You can consider this "free" memory -- if an application need a lot of RAM suddenly, the kernel can shrink buffers and cache very quickly.

You're probably now wondering "so why am I using any swap at all?!"... the kernel keeps track of how often chunks of memory are used and will choose to swap out rarely-used stuff to have more memory to cache frequently-used stuff.

2) si + so: This is how active it is with swapping. Seeing lots of big numbers here == swap thrashing == bad performance. Anything above about 200 catches my attention, 'tho if you run into true swap thrashing, you'll know it ;-)

3) bi + bo: This is how actively you're reading and writing to disk. Disk I/O is expensive (that is, it takes more time and has a greater impact on performance than, say, memory or CPU operations), so minimizing this is a quick way to eek some more performance out. Your I/O looks great... not too much reading, and writing looks pretty reasonable (you're probably logging web traffic and writing new stuff to your database).

4) The CPU stuff. us, sy, id, and wa add up to roughly 100%. "us" is how much time user tasks (daemons, scripts, sshd, etc) spent doing things; "sy" is how much time the kernel spent doing its things (pushing packets, scheduling tasks, pondering memory allocation, etc). "wa" is how long tasks were waiting for disk I/O -- in other words, if this number gets high, things are slow. "id" is simply 100% minus all those; the idle percentage.

So, yeah, I think you're in great shape. :-) -rt


Top
   
 Post subject:
PostPosted: Thu Feb 26, 2009 3:49 pm 
Offline
Senior Member

Joined: Wed Jan 21, 2009 7:13 pm
Posts: 126
Location: Portugal
Well, this is better than Wikipedia :)
Thanks for you excellent explanation :D


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


Who is online

Users browsing this forum: No registered users and 4 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