On Fri, 2012-08-31 at 07:31 -0400, Michael C Tiernan wrote: 
> ----- Original Message -----
> > From: "Edward Ned Harvey (lopser)" <lop...@nedharvey.com>
> > If you have an application that requires more ram than you physically
> > have in the system...
> However, now I'm going to switch back to our primary discussion and
> ask, how do I, the system administrator, who is charged with the
> operation and performance of the system(s) utilize this new knowledge
> when I have *no control* or design/advisory input over the
> applications being executed on my systems 

Ditto, this is the life of the System Administrator: here is the box,
here is the application, go...  After doing this for 20+ years the
sermons about proper development and design techniques get tired;  it
may all be true, but it doesn't address the facts on the ground.  And
developers do not listen to System Administrators, what would we know?

> (nor the ability to educate every person who writes a bit of code that
> gets run on my systems) to control the need for swap?
> I realize it sounds like I'm being dense or difficult and I apologize
> for it. 

No need to apologize.

> While your explanation is very concise about how we *should*
> (http://tinyurl.com/4xr3574) write code to properly utilize/maximize
> the system's resources, the idea of using "memory mapping" does
> nothing about how, given an existing piece of code, the sysadmins can
> make adjustments that minimize the dependence/use of swap and swapping
> especially when this piece of code is only used occasionally and there
> is no assurance that this is the only piece of code that will ever be
> run on a system. 
> Your argument for extremely small swap space does.

It is very difficult to provision a system for an occasional extreme
event, especially if the system is multi-purpose.

About the only things you can do are:

* adjust the tendancy of the system to swap [ vm.swappiness = 1...100 ]
    /sbin/sysctl -w vm.swappiness=1..100

* Do a drop-cache.  This will drop all the clean blocks from the
system's RAM and potentially free up memory right away.  And it is safe.
    /sbin/sysctl -w vm.drop_caches=3
  - Run "sync;sleep 1" first to get the maximum bang for the buck.

* You can potentially adjust various buffers to keep them small, the
network stack especially, but you may pay a performance price in other
areas.  And these dynamically resize on modern kernels so there may or
may not be a win.
   <http://fasterdata.es.net/host-tuning/linux/>
   <http://www.cyberciti.biz/faq/linux-tcp-tuning/>

* Kill off any service you don't really need [Duh!]

* Swap to SSD; yeah, it sounds crazy, but sometimes...

If you can create a test system or VM and play with the values vs. your
application that is probably the only way you can really determine if
you can help out the situation.

BTW, on LINUX, you can see the swap usage of a process
in /proc/{PID#}/smaps

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Tech mailing list
Tech@lists.lopsa.org
https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to