Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 85081 invoked from network); 3 Jul 2009 19:57:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Jul 2009 19:57:04 -0000 Received: (qmail 3344 invoked by uid 500); 3 Jul 2009 19:57:14 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 3275 invoked by uid 500); 3 Jul 2009 19:57:13 -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 3265 invoked by uid 99); 3 Jul 2009 19:57:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jul 2009 19:57:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of vkuznet@gmail.com designates 209.85.216.199 as permitted sender) Received: from [209.85.216.199] (HELO mail-px0-f199.google.com) (209.85.216.199) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jul 2009 19:57:02 +0000 Received: by pxi37 with SMTP id 37so1658834pxi.13 for ; Fri, 03 Jul 2009 12:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:mime-version:subject:date:references :x-mailer; bh=oc4mPqBWeiEWj0+Vx+n94yHjqoXIswSvDSLnu7D1o/U=; b=tbTLYQd4wqpkvnxLdTLBz7Qnrx0a7uHBA4SBQBGnI8gUjDhtiEbrAqaYHr0Pj+xqR8 jftjekenwonGfR02XnxHvXKU8njJL0BiDuymscL+ZF3NQQAePv8WLzeRHXQpovpyowIR mHobglHECAtiLdL8bZwwiFp748eB3WOi7iTqE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; b=pTv8OmOVsibUkHEOfVjVyY2t16SwMN+wa4P5nKLtP1GGg9AlrnZTzKbYPEqNeqidKR 6sprJZ6bwNNSmXtlgbODyhhQmSswN2SMbW7MRSWrZf6wyAP+7+JmJ4aGYPvb6Y44RTwo yIYIVhC1mGxH4xI+nuaYHaiAs1HKgDLAs6jcI= Received: by 10.114.53.18 with SMTP id b18mr2456251waa.204.1246651000558; Fri, 03 Jul 2009 12:56:40 -0700 (PDT) Received: from ?172.27.35.34? (cpe-67-244-49-14.twcny.res.rr.com [67.244.49.14]) by mx.google.com with ESMTPS id j28sm6810744waf.32.2009.07.03.12.56.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 03 Jul 2009 12:56:39 -0700 (PDT) Message-Id: From: Valentin Kuznetsov To: user@couchdb.apache.org In-Reply-To: Content-Type: multipart/signed; boundary=Apple-Mail-38--91659200; micalg=sha1; protocol="application/pkcs7-signature" Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: transient errors with couch DB. Date: Fri, 3 Jul 2009 15:56:36 -0400 References: <0E4628F2-951C-4BCB-9E4C-E7F2164E0DFC@gmail.com> X-Mailer: Apple Mail (2.935.3) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-38--91659200 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Chris, thank you for suggestions. The problem is that we tried out all of those and encounter other problems. If I inject 64K rows at once, then memory consumption as well as CPU got high. Moreover the view after that takes literally more then 10 minutes to compute. We're working in environment where 1000 simultaneous requests are possible. Our preliminary tests shown that view computation grows significantly with number of inserted docs. So what I present we found optimal in our situation. Regarding sockets. It well may be and I'll be willing to explore this. But the code example I posted did sequential insertion of docs. Basically open HTTP connection, insert docs, close it. Valentin On Jul 3, 2009, at ,Jul 3, 2:46 PM, Chris Anderson wrote: > On Thu, Jul 2, 2009 at 7:35 AM, Valentin > Kuznetsov wrote: >> Hi, >> I'm developing application based on couch db and time to time >> experience >> different error messages and crashes with couch, version 0.9.0. We >> have a >> large documents, e.g. 64K, which split into 1K chunks (rows) for bulk >> injection. Each time I inject new chunk I also invoke 1 GET request >> w/ 1 row >> to force view to index data. > > You should not be querying the view on every insert, once every few > thousand docs should be fine... > > I'd maybe go ahead and not break up the 64Kb docs into smaller piece, > Couch should be able to handle docs of that size just fine. > > A quick google reveals that einval has got something to do with > opening sockets. My guess is that you are opening too many at once for > your OS. You may be able to do some linux config to raise the limit, > but I'd start by simplifying your insert loop. > > >> >> So here are error messages: >> >> [error] [<0.12304.2>] Uncaught error in HTTP request: {exit,normal} >> >> [error] [<0.30955.5>] {error_report,<0.23.0>, >> {<0.30955.5>,crash_report, >> [[{initial_call,{mochiweb_socket_server,acceptor_loop, >> ['Argument__1']}}, >> {pid,<0.30955.5>}, >> {registered_name,[]}, >> {error_info, >> {error, >> {case_clause,{error,einval}}, >> [{mochiweb_request,get,2}, >> {couch_httpd,handle_request,4}, >> {mochiweb_http,headers,5}, >> {proc_lib,init_p_do_apply,3}]}}, >> {ancestors, >> >> [couch_httpd,couch_secondary_services,couch_server_sup,<0.1.0>]}, >> {messages,[]}, >> {links,[<0.53.0>,#Port<0.1735>]}, >> {dictionary,[{mochiweb_request_qs,[{"limit","1"}]}]}, >> {trap_exit,false}, >> {status,running}, >> {heap_size,6765}, >> {stack_size,24}, >> {reductions,3888}], >> []]}} >> [error] [<0.53.0>] {error_report,<0.23.0>, >> {<0.53.0>,std_error, >> >> {mochiweb_socket_server,235,{child_error,{case_clause, >> {error,einval}}}}}} >> >> =ERROR REPORT==== 2-Jul-2009::10:21:33 === >> {mochiweb_socket_server,235,{child_error,{case_clause, >> {error,einval}}}} >> >> So, I made a stand-alone program and to my surprise the errors are >> transient. I re-run my stand-alone program with the same doc >> several times >> and I can either inject all data just fine or get errors shown >> above in no >> particular order (I mean I can see 1 or more errors and none or >> either of >> those). >> >> I would appreciate any help with this. The program is attached in a >> form of >> tar archive. I added data file we usually deal with and two python >> files >> which we use. To run a test untar archive and do the following >> >> export PYTHONPATH=$PWD >> python couch_test.py >> >> >> >> >> >> Thank you, >> Valentin >> >> >> > > > > -- > Chris Anderson > http://jchrisa.net > http://couch.io --Apple-Mail-38--91659200 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDhTCCA4Ew ggJpoAMCAQICAmT/MA0GCSqGSIb3DQEBBQUAMGkxEzARBgoJkiaJk/IsZAEZFgNvcmcxGDAWBgoJ kiaJk/IsZAEZFghET0VHcmlkczEgMB4GA1UECxMXQ2VydGlmaWNhdGUgQXV0aG9yaXRpZXMxFjAU BgNVBAMTDURPRUdyaWRzIENBIDEwHhcNMDgwODE5MTYyNzI2WhcNMDkwODE5MTYyNzI2WjBkMRMw EQYKCZImiZPyLGQBGRYDb3JnMRgwFgYKCZImiZPyLGQBGRYIZG9lZ3JpZHMxDzANBgNVBAsTBlBl b3BsZTEiMCAGA1UEAxMZVmFsZW50aW4gS3V6bmV0c292IDM1NzY4MzCBnzANBgkqhkiG9w0BAQEF AAOBjQAwgYkCgYEA4iFFg1Vubs0frG4NaLheE4xA4zLEvZt6N6eCnqLK6IbiR4XoE0W7gRNs12G5 jNlTp/gyHrt5ckXQ7JLcz0L9GmKDUGXezSVqGqri62Ek5G3NIR8XhpHS1pQyUbP2mZCvkh5hU09x 2sXsBNhPLhqg8EHCzjL33RQe1uXzVNFJ1SMCAwEAAaOBuzCBuDARBglghkgBhvhCAQEEBAMCBeAw DgYDVR0PAQH/BAQDAgTwMBgGA1UdIAQRMA8wDQYLKoZIhvdMAwcBAgowOgYDVR0fBDMwMTAvoC2g K4YpaHR0cDovL3BraTEuZG9lZ3JpZHMub3JnL0NS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