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 784CA18CDE for ; Mon, 1 Feb 2016 12:12:04 +0000 (UTC) Received: (qmail 29513 invoked by uid 500); 1 Feb 2016 12:11:57 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 29436 invoked by uid 500); 1 Feb 2016 12:11:57 -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 29426 invoked by uid 99); 1 Feb 2016 12:11:57 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Feb 2016 12:11:57 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 0919F1A010C for ; Mon, 1 Feb 2016 12:11:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.899 X-Spam-Level: ** X-Spam-Status: No, score=2.899 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id bOeg4dB62X7e for ; Mon, 1 Feb 2016 12:11:50 +0000 (UTC) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com [209.85.217.175]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 46B504359E for ; Mon, 1 Feb 2016 12:11:50 +0000 (UTC) Received: by mail-lb0-f175.google.com with SMTP id x4so74545986lbm.0 for ; Mon, 01 Feb 2016 04:11:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=+s+4BsXlgAoLQzbaIsSZyEEN4yqYjLK4StaTZEMe4bo=; b=mMBdqfNgfjM8iUIHHOeUcdzRobxw/Rf6AdIdB7ylHsgLUGMtlZ0x5IMUhw9aFwdsZ2 Wj+Hi/LQaQroFkUHT9+oKoddQve0a9m2IDLj1SdTxybBaDMjSblMppf4UbsKCcMLooNL d9e8Od9riPoGXbPJqISt6k4PvzShLW5TyAHf8fUJfYkNF6Wg4aOHgOrmLa+GSop/zDnc /zavHdYI9j14Jw2ET36NEkhQPfLrXApx/bRSaw5qNC77aAjb7jGFBBTU+7j3WYiSyfol pGHb2ghIUL6KqICp+P62eJmlfPv3h+kEEFfn1JmPSPJewdwrAuMMcTBJmy5pOhtN74lD 3UmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=+s+4BsXlgAoLQzbaIsSZyEEN4yqYjLK4StaTZEMe4bo=; b=Ynd7pQ18SvGqLKL/VWYcq5wniouXLLJDSkLdUFSygxboJ26lyM69TJAibSX2oOZRLI Z8LhXjXjlJ4HWmj/XfwrOHsQX3t85gWzI++aV81S50JfkpHdO/JnxB0AEW9gaRGW7VoC zXFZkrJg+lvkpLHDkOiXWKs5o1lWCa1G6S8kkwz7OSnu3tGCAiKyDh2RlmH2d1coDDZg ozmz2sgnR2NQhqzeLIjbHJWnYc4bzRujGobX18bpJRHq+/Ug6DFeBHxjETw0zjaX3Dts nwBXDe+jNQDnlaiUVsY91p5lFuIOxA4wSjlqpdRJsLsYWACFAZiYLktXkYBo0Zg6eBR7 80CQ== X-Gm-Message-State: AG10YOR8xpEp74/K/J6GdULNYR3xZhvag2FDQGif2ia6ZdYsHRq7xOATro/e3HaIuWl9hUZVbHGc76fZqzeo3g== MIME-Version: 1.0 X-Received: by 10.112.144.226 with SMTP id sp2mr8337452lbb.70.1454328709219; Mon, 01 Feb 2016 04:11:49 -0800 (PST) Received: by 10.25.18.219 with HTTP; Mon, 1 Feb 2016 04:11:49 -0800 (PST) In-Reply-To: <20E45478-F2D6-4DA4-AFC1-CEB04C500B15@greenbytes.de> References: <20E45478-F2D6-4DA4-AFC1-CEB04C500B15@greenbytes.de> Date: Mon, 1 Feb 2016 13:11:49 +0100 Message-ID: Subject: Re: Questions about mod_event's documentation From: Luca Toscano To: dev@httpd.apache.org Content-Type: multipart/alternative; boundary=047d7b342fd4198e46052ab44a30 --047d7b342fd4198e46052ab44a30 Content-Type: text/plain; charset=UTF-8 Hi Stefan, thanks for the answers! Commenting inline: 2016-02-01 10:54 GMT+01:00 Stefan Eissing : > > > > - mod_ssl and mod_deflate are examples of filters that needs to act on > the whole response so a worker gets stuck flushing data to slow clients > rather than giving up the socket earlier to the listener and doing a > different work. > > Hmm, not sure I understand your point. Every part in the process of > generating the bytes sent out on the socket is involved here. The crucial > difference between the worker and the event mpm is: > - worker keeps the response state on the stack > - event keeps the response state in the heap > which means that calls to response processing > - on worker, need to return when all is done > - on event, may return whenever a READ/WRITE event or TIMEOUT/KEEPALIVE is > needed. > > In that way, writing a response with event is "stutter stepping" it. Write > until EWOULDBLOCK, return, queued, event, write until EWOULDBLOCK,... > > (my understanding) > Really sorry for my poor explanation, but I am still in early phases when you bang your head against httpd's code until you get something out of it :) More context from the doc: "A similar restriction is currently present for requests involving an output filter that needs to read and/or modify the whole response body, like for example mod_ssl, mod_deflate, or mod_include. If the connection to the client blocks while the filter is processing the data, and the amount of data produced by the filter is too big to be buffered in memory, the thread used for the request is not freed while httpd waits until the pending data is sent to the client." After a chat in #httpd-dev I realised that this use case is not the standard one for processing a https connection with event, but only a corner case. For some reason this lead me to think that event was handling HTTPS connections like worker in all the use cases (some sysadmin friends thought the same too). It might be necessary only to add this note and everything would be clearer in my opinion. My goal is to reduce the time to understand mod-event (and to appreciate all its greatness) for the "standard guy" like me. I now realise that the docs are containing all the info that I needed but for some reason I wasn't getting the correct picture out of it (some processing errors in my brain might also be part of the problem but I can't easily fix it :) Thanks! Looking forward to have other feedbacks! Luca --047d7b342fd4198e46052ab44a30 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Ste= fan,

thanks f= or the answers! Commenting inline:
<= br>
2016-02-01 10:54 GMT+01:00 Stefan Eissing <stefan.eissing@greenbytes.de>:

> - mod_ssl and mod_deflate are examples of filters that needs to act on= the whole response so a worker gets stuck flushing data to slow clients ra= ther than giving up the socket earlier to the listener and doing a differen= t work.

Hmm, not sure I understand your point. Every part in the process of = generating the bytes sent out on the socket is involved here. The crucial d= ifference between the worker and the event mpm is:
- worker keeps the response state on the stack
- event keeps the response state in the heap
which means that calls to response processing
- on worker, need to return when all is done
- on event, may return whenever a READ/WRITE event or TIMEOUT/KEEPALIVE is = needed.

In that way, writing a response with event is "stutter stepping" = it. Write until EWOULDBLOCK, return, queued, event, write until EWOULDBLOCK= ,...

(my understanding)

Really sorry for my = poor explanation, but I am still in early phases when you bang your head ag= ainst httpd's code until you get something out of it :)

<= /div>
More context from the doc:

"A simil= ar restriction is currently present for requests involving an output filter= that needs to read and/or modify the whole response body, like for example= mod_ssl, mod_deflate, or mod_include. If the connection to the client bloc= ks while the filter is processing the data, and the amount of data produced= by the filter is too big to be buffered in memory, the thread used for the= request is not freed while httpd waits until the pending data is sent to t= he client."

After a chat in #httpd-dev I real= ised that this use case is not the standard one for processing a https conn= ection with event, but only a corner case. For some reason this lead me to = think that event was handling HTTPS connections like worker in all the use = cases (some sysadmin friends thought the same too). It might be necessary o= nly to add this note and everything would be clearer in my opinion.=C2=A0
=C2=A0
My goal is to reduce the time to understand mod-e= vent (and to appreciate all its greatness) for the "standard guy"= like me. I now realise that the docs are containing all the info that I ne= eded but for some reason I wasn't getting the correct picture out of it= (some processing errors in my brain might also be part of the problem but = I can't easily fix it :)

Thanks! Looking forwa= rd to have other feedbacks!

Luca

--047d7b342fd4198e46052ab44a30--