Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5475E17DA4 for ; Tue, 17 Mar 2015 16:00:23 +0000 (UTC) Received: (qmail 65799 invoked by uid 500); 17 Mar 2015 16:00:22 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 65733 invoked by uid 500); 17 Mar 2015 16:00:22 -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 65723 invoked by uid 99); 17 Mar 2015 16:00:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Mar 2015 16:00:22 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of stefan.eissing@greenbytes.de designates 217.91.35.233 as permitted sender) Received: from [217.91.35.233] (HELO mail.greenbytes.de) (217.91.35.233) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Mar 2015 16:00:17 +0000 Received: from delight.greenbytes.de (unknown [217.91.35.233]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mail.greenbytes.de (Postfix) with ESMTPSA id 4C83215A0249 for ; Tue, 17 Mar 2015 16:59:25 +0100 (CET) From: Stefan Eissing Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: buckets across threads - question Message-Id: <11EC3B28-0C00-442E-9B34-2DC010604068@greenbytes.de> Date: Tue, 17 Mar 2015 16:59:43 +0100 To: dev@httpd.apache.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) X-Mailer: Apple Mail (2.2070.6) X-Virus-Checked: Checked by ClamAV on apache.org Hi, I have a question regarding my http2 module implementation, where I seem = to fail to wrap my head around the limitations of pools and bucket = brigades in a multi-threaded environment. As I understand it, httpd has = - so far - the underlying assumption: 1 connection -> 1 request -> 1 thread at a single point in time. This used to be quite static, as in = mpm_worker, and was made more dynamic with mpm_event, which may switch = the thread around. However even though entities might be exchanged, it = is always 1-1-1 at a single point in time. Now, as most of you are aware, with the HTTP/2 processing model, this = holds no longer true. The relation there is 1-m-m* and, worse, the = connection is multiplexing requests, so there are many active at the = same time and their data will be interleaved. The request/thread = coupling can stay as it is, but the connection relation is different. I today have a working implementation and it has major drawbacks (among = all the bugs I need to find): 1. it mimicks httpd objects that are not really there, e.g. = pseudo-connections, so that there seems to be a 1-1 with connections and = requests again (just as mod_spdy does). Therefore it needs to fake = HTTP/1.1 requests, so that core filter can parse them, etc. 2. beautiful apr infrastructure like bucket brigades are not used when = data needs to be passed between threads. I have made an attempt today to make bucket brigades work for passing = data between threads, but things keep crashing on me when load grows. = Which is all my fault for not understanding these things fully. So, am I = on a fool's errand? Can I have brigade A in thread 1 and brigade B in = thread 2 and pass buckets between them without excessive copying? I = think I am doing it wrong and the cleanups of the allocators run in the = wrong thread in the end which is not healthy. As for the request processing, I saw that there is a = ap_process_request(r) to be had. Is it worthwhile to see if that can be = called directly without ap_read_request() creating it. That would = eliminated at least the request->HTTP/1 serialization... Any ideas or hints appreciated. //Stefan bytes GmbH Hafenweg 16, 48155 M=C3=BCnster, Germany Phone: +49 251 2807760. Amtsgericht M=C3=BCnster: HRB5782