Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 40002 invoked from network); 12 Jun 2009 12:03:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Jun 2009 12:03:24 -0000 Received: (qmail 24637 invoked by uid 500); 12 Jun 2009 12:03:35 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 24573 invoked by uid 500); 12 Jun 2009 12:03:34 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 24563 invoked by uid 99); 12 Jun 2009 12:03:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2009 12:03:34 +0000 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=FS_REPLICA,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.68.5.17] (HELO relay03.pair.com) (209.68.5.17) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 12 Jun 2009 12:03:25 +0000 Received: (qmail 69293 invoked from network); 12 Jun 2009 12:03:03 -0000 Received: from 75.130.189.246 (HELO ?192.168.0.8?) (75.130.189.246) by relay03.pair.com with SMTP; 12 Jun 2009 12:03:03 -0000 X-pair-Authenticated: 75.130.189.246 Message-Id: From: Damien Katz To: dev@couchdb.apache.org In-Reply-To: <56A7CF26-8B1D-4D98-A122-B5A77A55F337@apache.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Re: replication using _changes API Date: Fri, 12 Jun 2009 08:03:04 -0400 References: <56A7CF26-8B1D-4D98-A122-B5A77A55F337@apache.org> X-Mailer: Apple Mail (2.935.3) X-Virus-Checked: Checked by ClamAV on apache.org I don't think this is TCPs fault, it's the HTTP client. We need a HTTP client that streams data while not buffering the data (low level TCP already buffers some), instead of sending all the data that comes in to the waiting process, essentially buffering everything. -Damien On Jun 11, 2009, at 4:14 PM, Adam Kocoloski wrote: > I had some time to work on a replicator that queries _changes > instead of _all_docs_by_seq today. The first question that came to > my mind was how to put a spigot on the firehose. If I call _changes > without a "since" qs parameter on a 10M document DB I'm going to get > 10M chunks of output back. > > I thought I might be able to control the flow at the TCP socket > level using the inets HTTP client's {stream,{self,once}} option. I > still think this would be an elegant option if I can get it to work, > but my early tests show that all the chunks still show up > immediately in the calling process regardless of whether I stream to > self or {self,once}. > > All for now, Adam