i've got some java/tomcat servers that mmap() massive amounts of files 
into the process VMA space and also have very large java heaps.  the way 
that the RHEL4/RHEL5 2.6.x kernel (x: x < 28 i think) works, is that i 
treats VMA-mapped pages all similarly which resulted in lightly used pages 
in the java heap being swapped and free'd and resued as bufer cache for 
the mmap()'d files and then when a FullGC came along it walked through the 
heap and swapped back in all those pages and produced some ~15 minute long 
FullGC pauses.

the desired behavior here would be to treat mmap()'d files just like 
buffer cache, which is what the split-LRU VM in >= 2.6.28 should do.

to quickly fix this, however, i just started running all the servers 
swapless, which has the useful effect of pinning anonymous memory (java 
heap) and forcing the VM to page out mmap()'d files.

linux supports running completely swapless and while i don't necessarily 
recommend it, it was a useful workaround for that problem.

also, i've started capping the amount of swap on any server that we build 
to 4GB - even 32GB RAM servers get 4GB (although more and more now we're 
using smaller virtual footprints on large-memory servers, so this is 
becoming more of an edge case now).

historically it used to be the case that to make use of any swap you 
needed more swap than available RAM, and 2xRAM used to be the practice. 
then with virtual addressing of swap that became 1xRAM.  with solaris i 
believe that you still want to have some swap since it will OOM earlier if 
it doesn't have any swap (its been years since i went through the details 
of this and don't know if solaris 10 still goes OOM at the same 
threshold).  linux is extremely lazy, however, so it runs fine swapless.

( i belive the difference is that if you attempt to malloc some massive 
amount of memory on solaris it will want to allocate some anon memory or 
swap space even for the anon pages that aren't being used -- and when used 
+ allocated anon memory exceeds RAM + swap that solaris will OOM -- linux 
is lazy and will just OOM once it actually can't get any pages ).

On Fri, 11 Sep 2009, Shane Milburn wrote:
> I'm doing a project for a $CLIENT who has requested that I build out a small
> web farm capable of serving 1M hits an hour average and peak traffic to
> 3M/hour. No problem there but when building the systems we got into a debate
> about how he wants the OS built. Basically he said DO NOT build a swap
> partition or swap file. I asked why and his response was "These are cookie
> cutter web servers that do nothing other than serve apache requests. They
> have nothing else on them so we'll run apache up to XXX for MaxClients and
> MaxSpareServers (just shy of running the box out of memory) and leave it. "
>
> He's the $CLIENT and I'l build it the way he requests but my questions
> are...
>
>
>   1. Would/Have you run a web server without swap? (they have 500Gb drives
>   in them so there's room for a swap partition.)
>   2. Any benefits or drawbacks to doing this?   (in context of a pure
>   webserver that does nothing else but serve pages as part of the pool it is a
>   member of.)
>
>
> Happy Friday!
>
>
> cheers,
> -shane
> --
>
_______________________________________________
Discuss mailing list
[email protected]
http://lopsa.org/cgi-bin/mailman/listinfo/discuss
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to