Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 56986 invoked from network); 1 Dec 2010 18:48:05 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Dec 2010 18:48:05 -0000 Received: (qmail 95891 invoked by uid 500); 1 Dec 2010 18:48:03 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 95742 invoked by uid 500); 1 Dec 2010 18:48:03 -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 95734 invoked by uid 99); 1 Dec 2010 18:48:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Dec 2010 18:48:03 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of randall.leeds@gmail.com designates 209.85.161.52 as permitted sender) Received: from [209.85.161.52] (HELO mail-fx0-f52.google.com) (209.85.161.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Dec 2010 18:47:56 +0000 Received: by fxm5 with SMTP id 5so5784577fxm.11 for ; Wed, 01 Dec 2010 10:47:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=9KPLhPEW1Xmx8B7Bz56HZpmb1GWOgMI1dLa9LiJJGL8=; b=OqaXs6cgqKnSNLnOuFRGHU+GjCGfZ2pG0OGTY2gkQ3LFcS82BNf4OOr37ldN37cxDi DPMqKqbw0fv3rwNOdlpy5B0K3uOlB9RT1sp9UL+30zsZ0a0pK0fRNqRKjiz1m3eTtswC BES9ZsVZJ7zpikaxdy0+rhYaUkBoBrsa5u9e4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=ZrVLnFRW7SHJAz+7VRMtA+XJDB6FBrA4BOY3tLEczxUR+aV/ISxIzf97+A0XWf9mZl JbuX/j5R13KLvf9vYuhA28frYXLDUXjetPIO9WLBuxLEY9thUr2ZuUnX2oD1EGfS1gcu IFS1L0Jz/LP1LOATJqfCLykee5V5TSfqagr/E= MIME-Version: 1.0 Received: by 10.223.96.137 with SMTP id h9mr382630fan.54.1291229256644; Wed, 01 Dec 2010 10:47:36 -0800 (PST) Received: by 10.223.96.79 with HTTP; Wed, 1 Dec 2010 10:47:36 -0800 (PST) In-Reply-To: References: Date: Wed, 1 Dec 2010 13:47:36 -0500 Message-ID: Subject: Re: Too many open files From: Randall Leeds To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Also check the value of the ERL_MAX_PORTS environment variable, which is the erlang runtime's limit on how many files/sockets can be opened. See also: http://wiki.apache.org/couchdb/Performance#Resource_Limits On Wed, Dec 1, 2010 at 13:29, Robert Newson wrote= : > ignore the '-f' bit. > > On Wed, Dec 1, 2010 at 6:29 PM, Robert Newson w= rote: >> look in /proc/> doubt it does. >> >> The way I increase fd limits from the miserly Linux default of 1024 is >> with this run script, where couchdb is launched by runit; >> >> #!/bin/bash >> exec 2>&1 >> export HOME=3D >> ulimit -n 10000 >> exec chpst -u couchdb -f >> >> B. >> >> >> >> >> On Wed, Dec 1, 2010 at 6:21 PM, Jonathan Johnson wro= te: >>> Our couch setup has around 100 databases with a significant number of >>> views in each database. Every once in a while, couch takes a dive. I >>> happened to be around this time, and saw this in the logs: >>> >>> >>> [Wed, 01 Dec 2010 18:09:19 GMT] [error] [<0.102.0>] {error_report,<0.31= .0>, >>> =C2=A0 =C2=A0{<0.102.0>,std_error, >>> =C2=A0 =C2=A0 {mochiweb_socket_server,225,{acceptor_error,{error,accept= _failed}}}}} >>> >>> [Wed, 01 Dec 2010 18:09:19 GMT] [error] [<0.10711.1125>] {error_report,= <0.31.0>, >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{<0.10711.1125>,std_err= or, >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [{application,mochiweb= }, >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"Accept failed e= rror","{error,emfile}"]}} >>> >>> [Wed, 01 Dec 2010 18:09:19 GMT] [error] [<0.10711.1125>] {error_report,= <0.31.0>, >>> =C2=A0 =C2=A0{<0.10711.1125>,crash_report, >>> =C2=A0 =C2=A0 [[{initial_call,{mochiweb_socket_server,acceptor_loop,['A= rgument__1']}}, >>> =C2=A0 =C2=A0 =C2=A0 {pid,<0.10711.1125>}, >>> =C2=A0 =C2=A0 =C2=A0 {registered_name,[]}, >>> =C2=A0 =C2=A0 =C2=A0 {error_info, >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {exit, >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {error,accept_failed}, >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [{mochiweb_socket_serv= er,acceptor_loop,1}, >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{proc_lib,init_p= _do_apply,3}]}}, >>> =C2=A0 =C2=A0 =C2=A0 {ancestors, >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [couch_httpd,couch_secondary_service= s,couch_server_sup,<0.32.0>]}, >>> =C2=A0 =C2=A0 =C2=A0 {messages,[]}, >>> =C2=A0 =C2=A0 =C2=A0 {links,[<0.102.0>]}, >>> =C2=A0 =C2=A0 =C2=A0 {dictionary,[]}, >>> =C2=A0 =C2=A0 =C2=A0 {trap_exit,false}, >>> =C2=A0 =C2=A0 =C2=A0 {status,running}, >>> =C2=A0 =C2=A0 =C2=A0 {heap_size,233}, >>> =C2=A0 =C2=A0 =C2=A0 {stack_size,24}, >>> =C2=A0 =C2=A0 =C2=A0 {reductions,202}], >>> =C2=A0 =C2=A0 =C2=A0[]]}} >>> >>> [Wed, 01 Dec 2010 18:09:19 GMT] [error] [<0.102.0>] {error_report,<0.31= .0>, >>> =C2=A0 =C2=A0{<0.102.0>,std_error, >>> =C2=A0 =C2=A0 {mochiweb_socket_server,225,{acceptor_error,{error,accept= _failed}}}}} >>> >>> I had run into an open files limit before, and had adjusted a few >>> settings. Here are some of the config values I think are relevant: >>> >>> max_dbs_open =3D 100 >>> max_connections =3D 2048 >>> >>> From /etc/security/limits.conf >>> couchdb =C2=A0 =C2=A0 =C2=A0 =C2=A0 hard =C2=A0 =C2=A0nofile =C2=A04096 >>> couchdb =C2=A0 =C2=A0 =C2=A0 =C2=A0 soft =C2=A0 =C2=A0nofile =C2=A04096 >>> >>> The installed version is 1.0.1. >>> >>> I'm not sure how to debug this issue further. It only happens after >>> several days of usage, and once it happens, I can't even ask for the >>> stats page to see what the current numbers are :) >>> >>> Thanks in advance for any help! >>> -Jon >>> >> >