httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: httpd 2.4.25, mpm_event, ssl: segfaults
Date Thu, 16 Feb 2017 10:49:30 GMT
On Thu, Feb 16, 2017 at 11:01 AM, Yann Ylavic <ylavic.dev@gmail.com> wrote:
> On Thu, Feb 16, 2017 at 10:49 AM, Yann Ylavic <ylavic.dev@gmail.com> wrote:
>>
>> - http  + !EnableMMap + !EnableSendfile  => 125KB writes
>
> This is due to MAX_IOVEC_TO_WRITE being 16 in
> send_brigade_nonblocking(), 125KB is 16 * 8000B.
> So playing with MAX_IOVEC_TO_WRITE might also be worth a try for
> !EnableMMap+!EnableSendfile case...

To minimize copying, this patch on APR(-util) could possibly help yet better:

Index: srclib/apr-util/buckets/apr_buckets_file.c
===================================================================
--- srclib/apr-util/buckets/apr_buckets_file.c    (revision 1732829)
+++ srclib/apr-util/buckets/apr_buckets_file.c    (working copy)
@@ -72,6 +72,8 @@ static int file_make_mmap(apr_bucket *e, apr_size_
 }
 #endif

+#define FILE_BUCKET_BUFF_SIZE (64 * 1024 - 64) /* > APR_BUCKET_BUFF_SIZE */
+
 static apr_status_t file_bucket_read(apr_bucket *e, const char **str,
                                      apr_size_t *len, apr_read_type_e block)
 {
@@ -108,8 +110,8 @@ static apr_status_t file_bucket_read(apr_bucket *e
     }
 #endif

-    *len = (filelength > APR_BUCKET_BUFF_SIZE)
-               ? APR_BUCKET_BUFF_SIZE
+    *len = (filelength > FILE_BUCKET_BUFF_SIZE)
+               ? FILE_BUCKET_BUFF_SIZE
                : filelength;
     *str = NULL;  /* in case we die prematurely */
     buf = apr_bucket_alloc(*len, e->list);
_

If that's the case, we could have an apr_bucket_file_bufsize_set() to
make this configurable, or even better one more apr_bucket_alloc's
freelist for such larger/fixed buffers...

Mime
View raw message