Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DD2F34B63 for ; Thu, 23 Jun 2011 08:05:55 +0000 (UTC) Received: (qmail 51758 invoked by uid 500); 23 Jun 2011 08:05:54 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 51507 invoked by uid 500); 23 Jun 2011 08:05:48 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 51497 invoked by uid 99); 23 Jun 2011 08:05:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jun 2011 08:05:47 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.202.165.95] (HELO smtpauth04.prod.mesa1.secureserver.net) (64.202.165.95) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 23 Jun 2011 08:05:40 +0000 Received: (qmail 25085 invoked from network); 23 Jun 2011 08:05:19 -0000 Received: from unknown (184.146.159.105) by smtpauth04.prod.mesa1.secureserver.net (64.202.165.95) with ESMTP; 23 Jun 2011 08:05:19 -0000 Date: Thu, 23 Jun 2011 04:05:52 -0400 From: MK To: user@couchdb.apache.org Subject: Re: 256kB stack size ok? Message-Id: <20110623040552.f85ee34f.mk@cognitivedissonance.ca> In-Reply-To: References: <20110622085046.fb429857.mk@cognitivedissonance.ca> X-Mailer: Sylpheed 3.1.1 (GTK+ 2.22.0; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, 22 Jun 2011 14:34:25 -0700 Randall Leeds wrote: > On Wed, Jun 22, 2011 at 05:50, MK wrote: > > Does anyone have an idea of what a safe minimum stack size is for > > couch?=20 > This is an excellent question and it'd be really cool to hear some > good thoughts on this. >=20 > In particular, I'm not sure what (from a libc perspective) is stack > allocation and what is heap allocation in the Erlang runtime. > Looking around quickly it's not easy to find documentation on BEAM > itself (Bogdan/Bj=F6rn's Erlang Abstract Machine). I did not even know that's what it is, thanks ;) > Perhaps there are some more basic questions that we could cross-post > to erlang? I don't think you could simplify it beyond "Do you know how big a stack this application needs?" 256kB seems like a lot to me, I have no idea why someone would need the linux default of 8MB. =20 You can limit thread stack size internally, at least with pthreads. I noticed when doing this on the server that nodejs (or the "libeio" it includes/uses) does that -- it has a very small "allocated memory" footprint by default. Kind of a lesson there for developers perhaps. That beam thing is just colossal, at least on linux. --=20 "Enthusiasm is not the enemy of the intellect." (said of Irving Howe) "The angel of history[...]is turned toward the past." (Walter Benjamin)