public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Jure Pecar <pegasus@telemach.net>
Cc: linux-kernel@vger.kernel.org, thttpd@bomb.acme.com
Subject: Re: linux 2.2.19pre and thttpd (VM-global problem?)
Date: Fri, 29 Dec 2000 03:47:12 +0100	[thread overview]
Message-ID: <20001229034712.B9810@athlon.random> (raw)
In-Reply-To: <3A4BE9B0.5C809AAC@telemach.net> <20001229032953.A9810@athlon.random>
In-Reply-To: <20001229032953.A9810@athlon.random>; from andrea@suse.de on Fri, Dec 29, 2000 at 03:29:53AM +0100

On Fri, Dec 29, 2000 at 03:29:53AM +0100, Andrea Arcangeli wrote:
> On Fri, Dec 29, 2000 at 02:32:32AM +0100, Jure Pecar wrote:
> > Hi all,
> > 
> > I'm expiriencing a problem with thttpd web server
> > (www.acme.com/software/thttpd) on recent linux 2.2 kernels with Andrea's

I downloaded the sources right now to see what 'out of memory' means. I assume
you were using version 2.20b.

> out of memory looks an userspace message, so it looks like malloc request was

My guess was right, it's not possible to know where it came from though:

andrea@athlon:~/devel/thttpd-2.20b > grep 'out of' *.c
fdwatch.c:** or 0 if the timeout expired, or -1 on errors.  A timeout of INFTIM
means
libhttpd.c:     syslog( LOG_CRIT, "out of memory" );
libhttpd.c:         syslog( LOG_CRIT, "out of memory" );
libhttpd.c:         syslog( LOG_CRIT, "out of memory" );
libhttpd.c:     syslog( LOG_CRIT, "out of memory" );
libhttpd.c:         syslog( LOG_CRIT, "out of memory" );
libhttpd.c:         syslog( LOG_CRIT, "out of memory" );
libhttpd.c:     syslog( LOG_ERR, "out of memory" );
libhttpd.c:     ** since it's impossible to get out of the tree.  However, we still
libhttpd.c:                     syslog( LOG_ERR, "out of memory" );
libhttpd.c:     syslog( LOG_ERR, "out of memory" );
thttpd.c:       syslog( LOG_CRIT, "out of memory" );
thttpd.c:       syslog( LOG_CRIT, "out of memory" );
thttpd.c:       (void) fprintf( stderr, "%s: out of memory\n", argv0 );
thttpd.c:               syslog( LOG_CRIT, "out of memory" );
thttpd.c:               (void) fprintf( stderr, "out of memory\n" );
thttpd.c:           syslog( LOG_CRIT, "out of memory" );
thttpd.c:           (void) fprintf( stderr, "out of memory\n" );
thttpd.c:               syslog( LOG_CRIT, "out of memory" );
andrea@athlon:~/devel/thttpd-2.20b >

But luckily it always happens after some kind of memory allocation, so it's
going to be the overcommit check of mmap that is complaining as I guessed
(assuming glibc isn't buggy in your system).

I was thinking I have a minor fix (in aa patchkit) that can help if the problem
happens while you are quite near to use all the memory (swap included) and you
have very low level of buffercache and pagecache.  But I don't think you were
near the out of memory condition, right? (can you monitor via `vmstat 1 >log`
to be sure?) It addresses more a correctness issue than a real life problem.
And if it was a real life problem then you can workaround it with `echo 1
>/proc/sys/vm/overcommit_memory' without need to apply the real fix and
recompile the kernel (but again: I don't think this is the problem, setting
overcommit_memory to 1 would probably only temporarly hide the problem, you
would probably get the task killed by the kernel some time later anyways)

BTW, after checking the sources we at least know it wasn't due memory
fragmentation (fork complains with a different message).

Andrea

PS. I'm very suprised thttpd isn't threaded, it should really be threaded at
    least on the x86 family to run fast.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2000-12-29  3:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-29  1:32 linux 2.2.19pre and thttpd (VM-global problem?) Jure Pecar
2000-12-29  2:29 ` Andrea Arcangeli
2000-12-29  2:47   ` Andrea Arcangeli [this message]
2000-12-29  7:38     ` Petru Paler
2000-12-29 15:53       ` Andrea Arcangeli
2000-12-29 18:04         ` Petru Paler
2000-12-29 18:13           ` Jakob Østergaard
2000-12-29 18:21             ` Petru Paler
2000-12-29 18:56               ` Alan Cox
2000-12-29 19:11                 ` Andrea Arcangeli
2000-12-29 18:50         ` Alan Cox
2000-12-29 19:06           ` Andrea Arcangeli
2000-12-29 19:14             ` Andi Kleen
2000-12-29 22:40             ` Jakob Østergaard
2000-12-30  4:21             ` dean gaudet
2000-12-30 17:43               ` Andrea Arcangeli
2000-12-29  8:40   ` Jure Pecar
2000-12-29 11:37     ` Alan Cox
2000-12-29 15:36     ` Andrea Arcangeli
  -- strict thread matches above, loose matches on Subject: below --
2000-12-29 16:38 Daniel R. Kegel
2000-12-29 21:23 ` Aaron Sethman
2000-12-29 19:29 Matt Liotta
2000-12-29 19:43 ` Andrea Arcangeli
2001-01-01  1:04 Jure Pecar
2001-01-01 21:56 Jure Pecar

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=20001229034712.B9810@athlon.random \
    --to=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pegasus@telemach.net \
    --cc=thttpd@bomb.acme.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