Return-Path: X-Original-To: apmail-apr-dev-archive@www.apache.org Delivered-To: apmail-apr-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 28B28E3B8 for ; Fri, 11 Jan 2013 18:55:05 +0000 (UTC) Received: (qmail 60750 invoked by uid 500); 11 Jan 2013 18:55:04 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 60667 invoked by uid 500); 11 Jan 2013 18:55:04 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 60658 invoked by uid 99); 11 Jan 2013 18:55:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jan 2013 18:55:04 +0000 X-ASF-Spam-Status: No, hits=-2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of zhezhang@us.ibm.com designates 32.97.182.138 as permitted sender) Received: from [32.97.182.138] (HELO e8.ny.us.ibm.com) (32.97.182.138) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Jan 2013 18:54:52 +0000 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 11 Jan 2013 13:54:30 -0500 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e8.ny.us.ibm.com (192.168.1.108) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 11 Jan 2013 13:54:26 -0500 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 47EEB38C8045 for ; Fri, 11 Jan 2013 13:54:26 -0500 (EST) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r0BIsPur288228 for ; Fri, 11 Jan 2013 13:54:25 -0500 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r0BIsPxV021789 for ; Fri, 11 Jan 2013 16:54:25 -0200 Received: from d01ml605.pok.ibm.com (d01ml605.pok.ibm.com [9.63.8.148]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r0BIsPNS021744; Fri, 11 Jan 2013 16:54:25 -0200 In-Reply-To: References: Subject: Re: Question about httpd memory buffer alignment X-KeepSent: 349260C6:6ECE4B00-85257AF0:006792C7; type=4; name=$KeepSent To: Ben Reser Cc: dev@apr.apache.org X-Mailer: Lotus Notes Release 8.5.3 September 15, 2011 Message-ID: From: Zhe Zhang Date: Fri, 11 Jan 2013 13:54:24 -0500 X-MIMETrack: Serialize by Router on D01ML605/01/M/IBM(Release 8.5.3FP2 ZX853FP2HF2|October 8, 2012) at 01/11/2013 13:54:24 MIME-Version: 1.0 Content-type: multipart/alternative; Boundary="0__=0ABBF063DFF414578f9e8a93df938690918c0ABBF063DFF41457" Content-Disposition: inline X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13011118-9360-0000-0000-00000F14BE8A X-Virus-Checked: Checked by ClamAV on apache.org --0__=0ABBF063DFF414578f9e8a93df938690918c0ABBF063DFF41457 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: quoted-printable Ben Reser wrote on 01/11/2013 01:45:43 PM: > From: Ben Reser > To: Zhe Zhang/Watson/IBM@IBMUS, > Cc: dev@apr.apache.org > Date: 01/11/2013 01:46 PM > Subject: Re: Question about httpd memory buffer alignment > > On Fri, Jan 11, 2013 at 7:28 AM, Zhe Zhang wrot= e: > > I would like httpd to use 4K-aligned buffers so that I can do direc= t I/O on > > the html files being served. Could anyone tell me which file I need= to > > modify? I've already changed APR_BUCKET_BUFF_SIZE to 8192 so at lea= st the > > buffer size is multiple of 4K. > > If that isn't doing what you want then there are two possible places > that the read is happening. Hi Ben, thank you for the reply. I have disabled mmap and sendfile opti= ons. I'm getting 8192 bytes buffers; so the size is fine, but I want the starting address of the buffer to be 4K-aligned too. Now it seems align= ed at 8 bytes boundary (xxxxx8 instead of xxxx000). > > 1) Memory mapping is enabled and then the file is read by the kernel > via the mmap system call. See file_make_mmap() in APR's > buckets/apr_buckets_file.c. > > You can disable this with EnableMMAP off configuration directive to httpd. > > 2) Sendfile support is enabled and then the file is read by the kerne= l > via the sendfile system call. See send_brigade_nonblocking() in > httpd's server/core_filters.c. > > You can disable this with EnableSendfile off configuration directivet= o httpd. >= --0__=0ABBF063DFF414578f9e8a93df938690918c0ABBF063DFF41457 Content-type: text/html; charset=US-ASCII Content-Disposition: inline Content-transfer-encoding: quoted-printable

Ben Reser <ben@reser.org> wrote on 01/11/= 2013 01:45:43 PM:

> From: Ben Reser <ben@reser.org>

> To: Zhe Zhang/Watson/IBM@IBMUS, <= br> > Cc: dev@apr.apache.org
> Date: 01/11/2013 01:46 PM
> Subject: Re: Question about httpd memory buff= er alignment
>
> On Fri, Jan 11, 2013 at 7:28 AM, Zhe Zhang <zhezhang@us.ibm.com= > wrote:
> > I would like httpd to use 4K-aligned buffers so that I can do= direct I/O on
> > the html files being served. Could anyone tell me which file = I need to
> > modify? I've already changed APR_BUCKET_BUFF_SIZE to 8192 so = at least the
> > buffer size is multiple of 4K.
>
> If that isn't doing what you want then there are two possible plac= es
> that the read is happening.


Hi Ben, thank you for the reply. I have disabled m= map and sendfile options. I'm getting 8192 bytes buffers; so the size i= s fine, but I want the starting address of the buffer to be 4K-aligned = too. Now it seems aligned at 8 bytes boundary (xxxxx8 instead of xxxx00= 0).

>
> 1) Memory mapping is enabled and then the file is read by the kern= el
> via the mmap system call.  See file_make_mmap() in APR's
> buckets/apr_buckets_file.c.
>
> You can disable this with EnableMMAP off configuration directive t= o httpd.
>
> 2) Sendfile support is enabled and then the file is read by the ke= rnel
> via the sendfile system call.  See send_brigade_nonblocking()= in
> httpd's server/core_filters.c.
>
> You can disable this with EnableSendfile off configuration directi= veto httpd.
>
= --0__=0ABBF063DFF414578f9e8a93df938690918c0ABBF063DFF41457--