Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 90406 invoked from network); 5 Jan 2006 22:12:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Jan 2006 22:12:07 -0000 Received: (qmail 87261 invoked by uid 500); 5 Jan 2006 22:12:00 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 87205 invoked by uid 500); 5 Jan 2006 22:11:59 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 87194 invoked by uid 99); 5 Jan 2006 22:11:59 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2006 14:11:59 -0800 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 05 Jan 2006 14:11:58 -0800 Received: (qmail 89918 invoked by uid 2161); 5 Jan 2006 22:11:38 -0000 Received: from [192.168.2.4] (euler.heimnetz.de [192.168.2.4]) by cerberus.heimnetz.de (Postfix on SuSE Linux 7.0 (i386)) with ESMTP id BFFC41721C for ; Thu, 5 Jan 2006 23:11:29 +0100 (CET) Message-ID: <43BD99A5.6080507@apache.org> Date: Thu, 05 Jan 2006 23:11:49 +0100 From: Ruediger Pluem User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 X-Accept-Language: de, en, de-de, en-gb, cy, zu, xh MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: mod_proxy vs. serverpush References: <43BD7BBE.10103@sharp.fm> <43BD8130.7060903@apache.org> <43BD8EE1.3010804@sharp.fm> In-Reply-To: <43BD8EE1.3010804@sharp.fm> X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 01/05/2006 10:25 PM, Graham Leggett wrote: > Ruediger Pluem wrote: > [..cut..] >> Anyway, it does not work as expected, as it seems that the condition >> (APR_STATUS_IS_EAGAIN(rv) >> || (rv == APR_SUCCESS && >> APR_BRIGADE_EMPTY(bb))) { >> never gets true. > > > I think this if statement covers the case where a non blocking read is > attempted, and zero bytes are returned, in which case another non > blocking read might also return zero bytes, causing the loop to spin at > 100% processor usage. > > The problem lies in the code further down: > > /* try send what we read */ > if (ap_pass_brigade(r->output_filters, bb) != > APR_SUCCESS > || c->aborted) { > /* Ack! Phbtt! Die! User aborted! */ > backend->close = 1; /* this causes socket close > below * > / > finish = TRUE; > } No, I do not think so from the original idea. From my point of view the typical situation on the backend that wants to flush some data is: 1. It sends some data. 2. It does no send any more data for a while. If the condition would work as I expect, then all data from the backend is read (maybe in several loop iterations and thus passed down the filter chain already by the code you mention above). Then the backend would stop sending data for some time causing the condition to become true. This would cause the code to add a flush bucket and pass the brigade down the filter chain. > > Without explicitly adding flush buckets to the output filter stack, the > output filter stack seems to buffer before sending (rational behaviour). > > To change this, we would need to add an output flush bucket after each > read. I do not think that this a good idea. It leads to too much traffic overhead. Basicly I like the idea: Read from the backend as long as data is present (non-blocking). If no more data is present flush filter chain and switch to blocking mode to wait for further data. Regards R�diger