netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: "Zhao Xiaoming" <xiaoming.nj@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	"Linux Netdev List" <netdev@vger.kernel.org>
Subject: Re: ZONE_NORMAL memory exhausted by 4000 TCP sockets
Date: Mon, 6 Nov 2006 14:33:50 +0100	[thread overview]
Message-ID: <200611061433.50912.dada1@cosmosbay.com> (raw)
In-Reply-To: <f55850a70611060146o1b2adcabq8c1313f6711f3f4e@mail.gmail.com>

On Monday 06 November 2006 10:46, Zhao Xiaoming wrote:
> 2006/11/6, Eric Dumazet <dada1@cosmosbay.com>:
> > On Monday 06 November 2006 09:59, Zhao Xiaoming wrote:
> > > Thank you again for your help. To have more detailed statistic data, I
> > > did another round of test and gathered some data.  I give the overall
> > > description here and detailed /proc/net/sockstat, /proc/meminfo,
> > > /proc/slabinfo and /proc/buddyinfo follows.
> > > =====================================================
> > >                            slab mem cost        tcp mem pages      
> > > lowmem free with traffic:             254668KB                 34693
> > >       38772KB
> > > without traffic:       104080KB                           1
> > >        702652KB
> > > =====================================================
> >
> > Thank you for detailed infos.
> >
> > It appears you have an extensive use of threads (about 10000), since :
> > > task_struct        10095  10095   1360    3    1 : tunables   24   12
> > >   8 : slabdata   3365   3365      0
> >
> > Each thread has a kernel stack, 8KB (ie 2 pages, order-1 allocation),
> > plus a user vma
> >
> > > vm_area_struct     21346  21504     92   42    1 : tunables  120   60
> > >   8 : slabdata    512    512      0
> >
> > Most likely you dont need that much threads. A program with fewer threads
> > will perform better and use less ram.
>
> Thanks for the comments. I known the threads may cost many memory.
> However, I already excluded them from the statistics. The 'after test'
> info was gotten while the 10000 threads running but no traffics
> relayed. You may look at the meminfo of 'after test', there is still
> 104080 kB slab memory which should already included the thread kernel
> memory cost (8K*10000=80MB). I know 10000 threads are not necessary
> and just use the simple logic to do some test.

In fact, your kernel has CONFIG_4KSTACKS, kernel thread stacks use 4K instead 
of 8K.

If you want to increase LOWMEM, (and keep 32bits kernel), you can chose a 
2G/2G user/kernel split, instead of the 3G/1G default split.
(see config : CONFIG_VMSPLIT_2G)

Eric

  parent reply	other threads:[~2006-11-06 13:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f55850a70611052207j384e1d3flaf40bb9dd74df7c5@mail.gmail.com>
2006-11-06  7:34 ` ZONE_NORMAL memory exhausted by 4000 TCP sockets Eric Dumazet
2006-11-06  8:59   ` Zhao Xiaoming
2006-11-06  9:22     ` Eric Dumazet
2006-11-06  9:46       ` Zhao Xiaoming
2006-11-06  9:49         ` Zhao Xiaoming
2006-11-06 13:33         ` Eric Dumazet [this message]
2006-11-07  2:48           ` Zhao Xiaoming
2006-11-07  5:53             ` Eric Dumazet
2006-11-07  6:08               ` Zhao Xiaoming
     [not found]   ` <f55850a70611060010q3ce9d6d2h4026259d688c6db1@mail.gmail.com>
     [not found]     ` <200611060948.43918.dada1@cosmosbay.com>
2006-11-06  9:03       ` Zhao Xiaoming
2006-11-06 16:36   ` Stephen Hemminger
2006-11-07  2:50     ` Zhao Xiaoming
2006-11-07  6:00       ` Zhao Xiaoming
     [not found] ` <1162807984.3160.188.camel@laptopd505.fenrus.org>
2006-11-06 10:21   ` Zhao Xiaoming
2006-11-06 10:21     ` Zhao Xiaoming
2006-11-07  8:06 Al Boldi

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=200611061433.50912.dada1@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xiaoming.nj@gmail.com \
    /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 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).