[svlug] Performance and memory

Karsten M. Self kmself at ix.netcom.com
Sat Apr 30 00:29:11 PDT 2005


on Fri, Apr 29, 2005 at 03:22:46PM -0400, Skip Evans (skip at venomouspenguin.com) wrote:

> I use Xandros 2.0 (Debian) on my desktop, and because I am always
> working on several projects at any given time, and often switch from
> one to another while waiting on info from clients, I keep 5 virtual
> desktops configured and often have 4 of them containing an instance or
> Kate for editing code, Firefox with any numb of tabs open, gFTP for
> uploading code modifications, and any number of shells open to the
> client's server, file managers, etc. Lots of apps basically.
> 
> At times my machine will really crawl switching between apps, and
> hammer the hard drive for quite a while going from one desktop to
> another, or from one app to another.
> 
> The machine has 256M of memory in it, and I'd gladly upgrade to 515M
> or even 1G no problem, if I was confident it would help.
> 
> Of course I often close down apps not being used at the moment, but I
> still experience quite a bit of lag sometimes even then swapping
> around.
> 
> I'd like to hear some opinions on how much performance increase I
> could expect with more memory, or whether the OS will really take
> advantage of it to make it worth spending $100 or so to kick it up to
> 1G.

The tools you're looking for to profile your system are ps, top, iostat,
and vmstat.  hdparm might also help.

The biggest single constraint on system performance is your hard drive.
Insufficient memory will magnify that problem.  There's not really such
a thing as "too much swap", the real problem is "not enough memory" (or
too many apps ;-)

I'm _not_ aware of tools which will profile which apps are contributing
to I/O utilization, though top and PS can help you identify these
generally.



Sample output from vmstat and iostat:
-------------------------------------

Note that both of these need to be run with a repeat interval in order
to get meaningful data, otherwise you're just getting cumulative data
from system boot.  I ran 'vmstat 4 4' and 'iostat 4 4' to run both at
4 second intervals for 4 counts.

First let's get a bit of a system profile.  I've got ~1 GiB RAM and ~1
GiB swap configured.

free
------------------------------------------------------------------------
             total       used       free     shared    buffers     cached
Mem:        972336     937288      35048          0     145804     209800
-/+ buffers/cache:     581684     390652
Swap:      1060208     188356     871852
------------------------------------------------------------------------


This shows us with a system that's swapping 

vmstat
------------------------------------------------------------------------
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa
 0  0 188356  34272 144612 208480    0    2     1     1    3     3 32 24 40  4
 0  0 188356  34144 144656 208484    0    0     0   156 1076     0 13 17 67  3
 1  0 188356  34768 144680 208564    0    0    17    97 1066     0 34 43 12 10
 3  1 188356  26312 144736 208600    0    0     0   369 1106     0 61 39  0  0
------------------------------------------------------------------------

This shows us a system with moderate swap usage (about 10%) and about
50% memory used (excluding buffer/cache).  Swapping (si == swap in, so
== swap out) is zilch.  Moderate IO.  CPU wait is a few percent (3-10%).

Not too bad.


Now for iostat.  Remember the first line is since system boot.



iostat
------------------------------------------------------------------------
Linux 2.6.7-1-686 (superego) 	04/29/05

avg-cpu:  %user   %nice    %sys %iowait   %idle
          31.58    0.34   24.08    3.56   40.43

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
hda              16.38        57.73       204.35  708814790 2508950003
sr0               0.00         0.10         0.00    1219776          0

avg-cpu:  %user   %nice    %sys %iowait   %idle
          22.19    0.00   28.93    7.98   40.90

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
hda              38.15         0.00       600.50          0       2408
sr0               0.00         0.00         0.00          0          0

avg-cpu:  %user   %nice    %sys %iowait   %idle
          24.00    0.00   29.50    0.25   46.25

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
hda              43.00         0.00       481.00          0       1924
sr0               0.00         0.00         0.00          0          0

avg-cpu:  %user   %nice    %sys %iowait   %idle
          29.40    0.00   34.17    3.77   32.66

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
hda               6.28         4.02       317.59         16       1264
sr0               0.00         0.00         0.00          0          0

------------------------------------------------------------------------

Other than a lot of writing, not too much going on.  Overall a pretty
happy system.

 18:44:47 up 142 days,  2:37, 33 users,  load average: 2.72, 3.32, 2.99

Load average tends to be a tad high, box is actually doing pretty well.


Peace.

-- 
Karsten M. Self <kmself at ix.netcom.com>        http://kmself.home.netcom.com/
 What Part of "Gestalt" don't you understand?
    We must learn to walk before we can run.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.svlug.org/archives/svlug/attachments/20050430/a8d7ed88/attachment.bin


More information about the svlug mailing list