All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shaohua.li@intel.com>
To: "robm@fastmail.fm" <robm@fastmail.fm>
Cc: Christoph Lameter <cl@linux.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Bron Gondwana <brong@fastmail.fm>, linux-mm <linux-mm@kvack.org>,
	Mel Gorman <mel@csn.ul.ie>
Subject: Re: Default zone_reclaim_mode = 1 on NUMA kernel is bad for file/email/web servers
Date: Fri, 17 Sep 2010 14:01:04 +0800	[thread overview]
Message-ID: <1284703264.3408.1.camel@sli10-conroe.sh.intel.com> (raw)
In-Reply-To: <1284684653.10161.1395434085@webmail.messagingengine.com>

On Fri, 2010-09-17 at 08:50 +0800, Robert Mueller wrote:
> > > > Having very little knowledge of what this actually does, I'd just
> > > > like to point out that from a users point of view, it's really
> > > > annoying for your machine to be crippled by a default kernel
> > > > setting that's pretty obscure.
> >
> > Thats an issue of the NUMA BIOS information. Kernel defaults to zone
> > reclaim if the cost of accessing remote memory vs local memory crosses
> > a certain threshhold which usually impacts performance.
> 
> We use what I thought was a fairly standard server type motherboard and
> CPU combination, and I was surprised that things were so badly broken
> for a standard usage scenario with a vanilla kernel with a default
> configuration.
> 
> I'd point out that the cost of a remote memory access is many, many
> orders of magnitude less than having to go back to disk! The problem is
> that with zone_reclaim_mode = 1 it seems lots of memory was being wasted
> that could be used as disk cache.
> 
> > > Yes, sadly intel motherboard turn on zone_reclaim_mode by
> > > default. and current zone_reclaim_mode doesn't fit file/web
> > > server usecase ;-)
> >
> > Or one could also say that the web servers are not designed to
> > properly distribute the load on a complex NUMA based memory
> > architecture of todays Intel machines.
> 
> I don't think this is any fault of how the software works. It's a *very*
> standard "pre-fork child processes, allocate incoming connections to a
> child process, open and mmap one or more files to read data from them".
> That's not exactly a weird programming model, and it's bad that the
> kernel is handling that case very badly with everything default.
maybe you incoming connection always happen on one CPU and you do the
page allocation in that cpu, so some nodes use out of memory but others
have a lot free. Try bind the child process to different nodes might
help.


WARNING: multiple messages have this Message-ID (diff)
From: Shaohua Li <shaohua.li@intel.com>
To: "robm@fastmail.fm" <robm@fastmail.fm>
Cc: Christoph Lameter <cl@linux.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Bron Gondwana <brong@fastmail.fm>, linux-mm <linux-mm@kvack.org>,
	Mel Gorman <mel@csn.ul.ie>
Subject: Re: Default zone_reclaim_mode = 1 on NUMA kernel is bad for file/email/web servers
Date: Fri, 17 Sep 2010 14:01:04 +0800	[thread overview]
Message-ID: <1284703264.3408.1.camel@sli10-conroe.sh.intel.com> (raw)
In-Reply-To: <1284684653.10161.1395434085@webmail.messagingengine.com>

On Fri, 2010-09-17 at 08:50 +0800, Robert Mueller wrote:
> > > > Having very little knowledge of what this actually does, I'd just
> > > > like to point out that from a users point of view, it's really
> > > > annoying for your machine to be crippled by a default kernel
> > > > setting that's pretty obscure.
> >
> > Thats an issue of the NUMA BIOS information. Kernel defaults to zone
> > reclaim if the cost of accessing remote memory vs local memory crosses
> > a certain threshhold which usually impacts performance.
> 
> We use what I thought was a fairly standard server type motherboard and
> CPU combination, and I was surprised that things were so badly broken
> for a standard usage scenario with a vanilla kernel with a default
> configuration.
> 
> I'd point out that the cost of a remote memory access is many, many
> orders of magnitude less than having to go back to disk! The problem is
> that with zone_reclaim_mode = 1 it seems lots of memory was being wasted
> that could be used as disk cache.
> 
> > > Yes, sadly intel motherboard turn on zone_reclaim_mode by
> > > default. and current zone_reclaim_mode doesn't fit file/web
> > > server usecase ;-)
> >
> > Or one could also say that the web servers are not designed to
> > properly distribute the load on a complex NUMA based memory
> > architecture of todays Intel machines.
> 
> I don't think this is any fault of how the software works. It's a *very*
> standard "pre-fork child processes, allocate incoming connections to a
> child process, open and mmap one or more files to read data from them".
> That's not exactly a weird programming model, and it's bad that the
> kernel is handling that case very badly with everything default.
maybe you incoming connection always happen on one CPU and you do the
page allocation in that cpu, so some nodes use out of memory but others
have a lot free. Try bind the child process to different nodes might
help.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2010-09-17  6:01 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-13  3:39 Default zone_reclaim_mode = 1 on NUMA kernel is bad for file/email/web servers Robert Mueller
2010-09-16 10:01 ` KOSAKI Motohiro
2010-09-16 10:01   ` KOSAKI Motohiro
2010-09-16 17:06   ` Christoph Lameter
2010-09-16 17:06     ` Christoph Lameter
2010-09-17  0:50     ` Robert Mueller
2010-09-17  0:50       ` Robert Mueller
2010-09-17  6:01       ` Shaohua Li [this message]
2010-09-17  6:01         ` Shaohua Li
2010-09-17  7:32         ` Robert Mueller
2010-09-17  7:32           ` Robert Mueller
2010-09-17 13:56           ` Christoph Lameter
2010-09-17 13:56             ` Christoph Lameter
2010-09-17 14:09             ` Bron Gondwana
2010-09-17 14:09               ` Bron Gondwana
2010-09-17 14:22               ` Christoph Lameter
2010-09-17 14:22                 ` Christoph Lameter
2010-09-17 23:01                 ` Bron Gondwana
2010-09-17 23:01                   ` Bron Gondwana
2010-09-20  9:34   ` Mel Gorman
2010-09-20  9:34     ` Mel Gorman
2010-09-20 23:41     ` Default zone_reclaim_mode = 1 on NUMA kernel is bad forfile/email/web servers Rob Mueller
2010-09-20 23:41       ` Rob Mueller
2010-09-21  9:04       ` Mel Gorman
2010-09-21  9:04         ` Mel Gorman
2010-09-21 14:14         ` Christoph Lameter
2010-09-21 14:14           ` Christoph Lameter
2010-09-22  3:44           ` Rob Mueller
2010-09-22  3:44             ` Rob Mueller
2010-09-27  2:01         ` KOSAKI Motohiro
2010-09-27  2:01           ` KOSAKI Motohiro
2010-09-27 13:53           ` Christoph Lameter
2010-09-27 13:53             ` Christoph Lameter
2010-09-27 23:17             ` Robert Mueller
2010-09-27 23:17               ` Robert Mueller
2010-09-28 12:35               ` Christoph Lameter
2010-09-28 12:35                 ` Christoph Lameter
2010-09-28 12:42                 ` Bron Gondwana
2010-09-28 12:42                   ` Bron Gondwana
2010-09-28 12:49                   ` Christoph Lameter
2010-09-28 12:49                     ` Christoph Lameter
2010-09-30  7:05             ` Andi Kleen
2010-09-30  7:05               ` Andi Kleen
2010-10-04 12:45             ` KOSAKI Motohiro
2010-10-04 12:45               ` KOSAKI Motohiro
2010-10-04 13:07               ` Christoph Lameter
2010-10-04 13:07                 ` Christoph Lameter
2010-10-05  5:32                 ` KOSAKI Motohiro
2010-10-05  5:32                   ` KOSAKI Motohiro
2010-10-04 19:43               ` David Rientjes
2010-10-04 19:43                 ` David Rientjes
2010-09-21  1:05   ` Default zone_reclaim_mode = 1 on NUMA kernel is bad for file/email/web servers KAMEZAWA Hiroyuki
2010-09-21  1:05     ` KAMEZAWA Hiroyuki
2010-09-27  2:04     ` KOSAKI Motohiro
2010-09-27  2:04       ` KOSAKI Motohiro
2010-09-27  2:06       ` KAMEZAWA Hiroyuki
2010-09-27  2:06         ` KAMEZAWA Hiroyuki
2010-09-23 11:44   ` Balbir Singh
2010-09-23 11:44     ` Balbir Singh
2010-09-30  8:38   ` Bron Gondwana
2010-09-30  8:38     ` Bron Gondwana

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=1284703264.3408.1.camel@sli10-conroe.sh.intel.com \
    --to=shaohua.li@intel.com \
    --cc=brong@fastmail.fm \
    --cc=cl@linux.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=robm@fastmail.fm \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.