LKML Archive on
help / color / mirror / Atom feed
From: Willy Tarreau <>
To: Toon van der Pas <>
Cc: Kumar Gala <>,
	Linux Kernel list <>
Subject: Re: tuning/tweaking VM settings for low memory (preventing OOM)
Date: Sat, 13 Jan 2007 15:30:27 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Toon,

On Sat, Jan 13, 2007 at 02:16:01PM +0100, Toon van der Pas wrote:
> On Sat, Jan 13, 2007 at 08:22:18AM +0100, Willy Tarreau wrote:
> > > 
> > > Which makes me think that we aren't writing back fast enough.  If I  
> > > mount the drive "sync" the issue clearly goes away.
> > > 
> > > It appears from an strace we are doing ftruncate64(5, 178257920) when  
> > > we OOM.
> > > 
> > > Any ideas on VM parameters to tweak so we throttle this from occurring?
> > 
> > Take a look at /proc/sys/vm/bdflush. There are several useful parameters
> > there (doc is in linux-xxx/Documentation). For instance, the first column
> > is the percentage of memory used by writes before starting to write on
> > disk. When using tcpdump intensively, I lower this one to about 1%.
> > 
> > Willy
> Hi Willy,
> I know you're doing a great job on keeping the 2.4 kernel in shape,
> but do you also have a good advice for people with more recent
> kernels?  (hint: the file /proc/sys/vm/bdflush is missing)

OK OK OK... Next time I will have coffee *before* replying :-)

Check /proc/sys/vm/dirty_ratio and dirty_background_ratio. Both are
percentage of total memory. The first one is for "foreground" writes
(ie the writing process may block) while the second one is for
"background" writes :

$ uname -a
Linux hp 2.6.16-rc2-pa1 #1 Fri Feb 3 23:34:56 MST 2006 parisc unknown
$ cat /proc/sys/vm/dirty_ratio 
$ cat /proc/sys/vm/dirty_background_ratio 

Again, lowering those values should help writing data to disk sooner.
Also you should take a look at min_free_kbytes (although I've not played
with it yet) :

[from Documentation/sysctl/vm.txt] :

  This is used to force the Linux VM to keep a minimum number 
  of kilobytes free.  The VM uses this number to compute a pages_min
  value for each lowmem zone in the system.  Each lowmem zone gets 
  a number of reserved free pages based proportionally on its size.

Docuemntation/filesystems/proc.txt is your friend here too.


  reply	other threads:[~2007-01-13 14:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-12 21:58 Kumar Gala
2007-01-13  4:54 ` Nick Piggin
2007-01-15 17:13   ` Kumar Gala
2007-01-13  7:22 ` Willy Tarreau
2007-01-13 13:16   ` Toon van der Pas
2007-01-13 14:30     ` Willy Tarreau [this message]
2007-01-13 23:58       ` Toon van der Pas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: tuning/tweaking VM settings for low memory (preventing OOM)' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).