Commit 695a8bd1 authored by Stefan Eissing's avatar Stefan Eissing
Browse files

On the trunk:

mod_http2: ripped out H2SessionExtraFiles directive, removed super special sender pool handling in bucket beams.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1787604 13f79535-47bb-0310-9956-ffa450edef68
parent 34524433
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
                                                         -*- coding: utf-8 -*-
Changes with Apache 2.5.0

  *) mod_http2: obsoleted option H2SessionExtraFiles, will be ignored and
     just log a warning. [Stefan Eissing]
     
  *) mod_autoindex: Add IndexOptions UseOldDateFormat to allow the date
     format from 2.2 in the Last Modified column. PR60846.
     [Hank Ibell <hwibell gmail.com>]
+0 −52
Original line number Diff line number Diff line
@@ -138,17 +138,6 @@ Protocols h2 h2c http/1.1
            the connection will buffer this amount of data and then suspend the
            H2Worker.
        </p>
        <p>
            If you serve a lot of static files, <directive module="mod_http2">H2SessionExtraFiles</directive>
            is of interest. This tells the server how many file handles per
            HTTP/2 connection it is allowed to waste for better performance. Because
            when a request produces a static file as the response, the file handle
            gets passed around and is buffered and not the file contents. That allows
            to serve many large files without wasting memory or copying data 
            unnecessarily. However file handles are a limited resource for a process,
            and if too many are used this way, requests may fail under load as
            the amount of open handles has been exceeded.
        </p>
    </section>
    
    <section id="misdirected"><title>Multiple Hosts and Misdirected Requests</title>
@@ -680,47 +669,6 @@ H2MaxWorkerIdleSeconds 20
        </usage>
    </directivesynopsis>
    
    <directivesynopsis>
        <name>H2SessionExtraFiles</name>
        <description>Number of Extra File Handles</description>
        <syntax>H2SessionExtraFiles <em>n</em></syntax>
        <contextlist>
            <context>server config</context>
            <context>virtual host</context>
        </contextlist>
        <usage>
            <p>
                This directive sets maximum number of <em>extra</em> file handles
                a HTTP/2 session is allowed to use. A file handle is counted as
                <em>extra</em> when it is transferred from a h2 worker thread to
                the main HTTP/2 connection handling. This commonly happens when
                serving static files.
            </p><p>
                Depending on the processing model configured on the server, the
                number of connections times number of active streams may exceed
                the number of file handles for the process. On the other hand,
                converting every file into memory bytes early results in too 
                many buffer writes. This option helps to mitigate that.
            </p><p>
                The number of file handles used by a server process is then in
                the order of:
            </p>
            <pre>
                (h2_connections * extra_files) + (h2_max_worker)
            </pre>
            <example><title>Example</title>
                <highlight language="config">
H2SessionExtraFiles 10
                </highlight>
            </example>
            <p>
                If nothing is configured, the module tries to make a conservative
                guess how many files are safe to use. This depends largely on the 
                MPM chosen.
            </p>
        </usage>
    </directivesynopsis>
    
    <directivesynopsis>
        <name>H2SerializeHeaders</name>
        <description>Serialize Request/Response Processing Switch</description>
+8 −12
Original line number Diff line number Diff line
@@ -484,17 +484,15 @@ static apr_status_t beam_send_cleanup(void *data)

static void beam_set_send_pool(h2_bucket_beam *beam, apr_pool_t *pool) 
{
    if (beam->send_pool == pool || 
        (beam->send_pool && pool 
         && apr_pool_is_ancestor(beam->send_pool, pool))) {
        /* when sender is same or sub-pool of existing, stick
         * to the the pool we already have. */
        return;
    }
    if (beam->send_pool != pool) {
        if (beam->send_pool && beam->send_pool != beam->pool) {
            pool_kill(beam, beam->send_pool, beam_send_cleanup);
            beam_send_cleanup(beam);
        }
        beam->send_pool = pool;
        pool_register(beam, beam->send_pool, beam_send_cleanup);
    }
}

static apr_status_t beam_cleanup(void *data)
{
@@ -893,10 +891,8 @@ apr_status_t h2_beam_send(h2_bucket_beam *beam,

    /* Called from the sender thread to add buckets to the beam */
    if (enter_yellow(beam, &bl) == APR_SUCCESS) {
        ap_assert(beam->send_pool);
        r_purge_sent(beam);
        if (sender_bb && !beam->send_pool) {
            beam_set_send_pool(beam, sender_bb->p);
        }
        
        if (beam->aborted) {
            move_to_hold(beam, sender_bb);
+5 −12
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ static h2_config defconf = {
    -1,                     /* alt-svc max age */
    0,                      /* serialize headers */
    -1,                     /* h2 direct mode */
    -1,                     /* # session extra files */
    1,                      /* modern TLS only */
    -1,                     /* HTTP/1 Upgrade support */
    1024*1024,              /* TLS warmup size */
@@ -88,7 +87,6 @@ static void *h2_config_create(apr_pool_t *pool,
    conf->alt_svc_max_age      = DEF_VAL;
    conf->serialize_headers    = DEF_VAL;
    conf->h2_direct            = DEF_VAL;
    conf->session_extra_files  = DEF_VAL;
    conf->modern_tls_only      = DEF_VAL;
    conf->h2_upgrade           = DEF_VAL;
    conf->tls_warmup_size      = DEF_VAL;
@@ -130,7 +128,6 @@ static void *h2_config_merge(apr_pool_t *pool, void *basev, void *addv)
    n->alt_svc_max_age      = H2_CONFIG_GET(add, base, alt_svc_max_age);
    n->serialize_headers    = H2_CONFIG_GET(add, base, serialize_headers);
    n->h2_direct            = H2_CONFIG_GET(add, base, h2_direct);
    n->session_extra_files  = H2_CONFIG_GET(add, base, session_extra_files);
    n->modern_tls_only      = H2_CONFIG_GET(add, base, modern_tls_only);
    n->h2_upgrade           = H2_CONFIG_GET(add, base, h2_upgrade);
    n->tls_warmup_size      = H2_CONFIG_GET(add, base, tls_warmup_size);
@@ -194,8 +191,6 @@ apr_int64_t h2_config_geti64(const h2_config *conf, h2_config_var_t var)
            return H2_CONFIG_GET(conf, &defconf, h2_upgrade);
        case H2_CONF_DIRECT:
            return H2_CONFIG_GET(conf, &defconf, h2_direct);
        case H2_CONF_SESSION_FILES:
            return H2_CONFIG_GET(conf, &defconf, session_extra_files);
        case H2_CONF_TLS_WARMUP_SIZE:
            return H2_CONFIG_GET(conf, &defconf, tls_warmup_size);
        case H2_CONF_TLS_COOLDOWN_SECS:
@@ -336,13 +331,11 @@ static const char *h2_conf_set_alt_svc_max_age(cmd_parms *parms,
static const char *h2_conf_set_session_extra_files(cmd_parms *parms,
                                                   void *arg, const char *value)
{
    h2_config *cfg = (h2_config *)h2_config_sget(parms->server);
    apr_int64_t max = (int)apr_atoi64(value);
    if (max < 0) {
        return "value must be a non-negative number";
    }
    cfg->session_extra_files = (int)max;
    /* deprecated, ignore */
    (void)arg;
    (void)value;
    ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, parms->pool, /* NO LOGNO */
                  "H2SessionExtraFiles is obsolete and will be ignored");
    return NULL;
}

@@ -638,7 +631,7 @@ const command_rec h2_cmds[] = {
    AP_INIT_TAKE1("H2Direct", h2_conf_set_direct, NULL,
                  RSRC_CONF, "on to enable direct HTTP/2 mode"),
    AP_INIT_TAKE1("H2SessionExtraFiles", h2_conf_set_session_extra_files, NULL,
                  RSRC_CONF, "number of extra file a session might keep open"),
                  RSRC_CONF, "number of extra file a session might keep open (obsolete)"),
    AP_INIT_TAKE1("H2TLSWarmUpSize", h2_conf_set_tls_warmup_size, NULL,
                  RSRC_CONF, "number of bytes on TLS connection before doing max writes"),
    AP_INIT_TAKE1("H2TLSCoolDownSecs", h2_conf_set_tls_cooldown_secs, NULL,
+0 −2
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ typedef enum {
    H2_CONF_ALT_SVC_MAX_AGE,
    H2_CONF_SER_HEADERS,
    H2_CONF_DIRECT,
    H2_CONF_SESSION_FILES,
    H2_CONF_MODERN_TLS_ONLY,
    H2_CONF_UPGRADE,
    H2_CONF_TLS_WARMUP_SIZE,
@@ -67,7 +66,6 @@ typedef struct h2_config {
    int serialize_headers;        /* Use serialized HTTP/1.1 headers for 
                                     processing, better compatibility */
    int h2_direct;                /* if mod_h2 is active directly */
    int session_extra_files;      /* # of extra files a session may keep open */  
    int modern_tls_only;          /* Accept only modern TLS in HTTP/2 connections */  
    int h2_upgrade;               /* Allow HTTP/1 upgrade to h2/h2c */
    apr_int64_t tls_warmup_size;  /* Amount of TLS data to send before going full write size */
Loading