nghttpx: Deprecate backend-http1-connections-per-host in favor of backend-connections-per-host

This commit is contained in:
Tatsuhiro Tsujikawa 2016-02-28 22:15:49 +09:00
parent 06921f35f3
commit 2326337d32
4 changed files with 34 additions and 15 deletions

View File

@ -126,7 +126,8 @@ OPTIONS = [
"frontend-http2-max-concurrent-streams", "frontend-http2-max-concurrent-streams",
"backend-http2-max-concurrent-streams", "backend-http2-max-concurrent-streams",
"backend-connections-per-frontend", "backend-connections-per-frontend",
"backend-tls" "backend-tls",
"backend-connections-per-host"
] ]
LOGVARS = [ LOGVARS = [

View File

@ -1356,23 +1356,24 @@ Performance:
accepts. Setting 0 means unlimited. accepts. Setting 0 means unlimited.
Default: )" << get_config()->conn.upstream.worker_connections Default: )" << get_config()->conn.upstream.worker_connections
<< R"( << R"(
--backend-http1-connections-per-host=<N> --backend-connections-per-host=<N>
Set maximum number of backend concurrent HTTP/1 Set maximum number of backend concurrent connections
connections per origin host. This option is meaningful (and/or streams in case of HTTP/2) per origin host.
when --http2-proxy option is used. The origin host is This option is meaningful when --http2-proxy option is
determined by authority portion of request URI (or used. The origin host is determined by authority
:authority header field for HTTP/2). To limit the portion of request URI (or :authority header field for
number of connections per frontend for default mode, use HTTP/2). To limit the number of connections per
frontend for default mode, use
--backend-connections-per-frontend. --backend-connections-per-frontend.
Default: )" << get_config()->conn.downstream.connections_per_host Default: )" << get_config()->conn.downstream.connections_per_host
<< R"( << R"(
--backend-connections-per-frontend=<N> --backend-connections-per-frontend=<N>
Set maximum number of backend concurrent connections (or Set maximum number of backend concurrent connections
streams in case of HTTP/2) per frontend. This option is (and/or streams in case of HTTP/2) per frontend. This
only used for default mode. 0 means unlimited. To option is only used for default mode. 0 means
limit the number of connections per host with unlimited. To limit the number of connections per host
--http2-proxy option, use with --http2-proxy option, use
--backend-http1-connections-per-host. --backend-connections-per-host.
Default: )" Default: )"
<< get_config()->conn.downstream.connections_per_frontend << R"( << get_config()->conn.downstream.connections_per_frontend << R"(
--rlimit-nofile=<N> --rlimit-nofile=<N>
@ -2440,6 +2441,7 @@ int main(int argc, char **argv) {
{SHRPX_OPT_BACKEND_CONNECTIONS_PER_FRONTEND, required_argument, &flag, {SHRPX_OPT_BACKEND_CONNECTIONS_PER_FRONTEND, required_argument, &flag,
119}, 119},
{SHRPX_OPT_BACKEND_TLS, no_argument, &flag, 120}, {SHRPX_OPT_BACKEND_TLS, no_argument, &flag, 120},
{SHRPX_OPT_BACKEND_CONNECTIONS_PER_HOST, required_argument, &flag, 121},
{nullptr, 0, nullptr, 0}}; {nullptr, 0, nullptr, 0}};
int option_index = 0; int option_index = 0;
@ -2954,6 +2956,10 @@ int main(int argc, char **argv) {
// --backend-tls // --backend-tls
cmdcfgs.emplace_back(SHRPX_OPT_BACKEND_TLS, "yes"); cmdcfgs.emplace_back(SHRPX_OPT_BACKEND_TLS, "yes");
break; break;
case 121:
// --backend-connections-per-host
cmdcfgs.emplace_back(SHRPX_OPT_BACKEND_CONNECTIONS_PER_HOST, optarg);
break;
default: default:
break; break;
} }

View File

@ -694,6 +694,7 @@ enum {
SHRPX_OPTID_BACKEND, SHRPX_OPTID_BACKEND,
SHRPX_OPTID_BACKEND_ADDRESS_FAMILY, SHRPX_OPTID_BACKEND_ADDRESS_FAMILY,
SHRPX_OPTID_BACKEND_CONNECTIONS_PER_FRONTEND, SHRPX_OPTID_BACKEND_CONNECTIONS_PER_FRONTEND,
SHRPX_OPTID_BACKEND_CONNECTIONS_PER_HOST,
SHRPX_OPTID_BACKEND_HTTP_PROXY_URI, SHRPX_OPTID_BACKEND_HTTP_PROXY_URI,
SHRPX_OPTID_BACKEND_HTTP1_CONNECTIONS_PER_FRONTEND, SHRPX_OPTID_BACKEND_HTTP1_CONNECTIONS_PER_FRONTEND,
SHRPX_OPTID_BACKEND_HTTP1_CONNECTIONS_PER_HOST, SHRPX_OPTID_BACKEND_HTTP1_CONNECTIONS_PER_HOST,
@ -1370,6 +1371,11 @@ int option_lookup_token(const char *name, size_t namelen) {
return SHRPX_OPTID_TLS_TICKET_KEY_MEMCACHED_TLS; return SHRPX_OPTID_TLS_TICKET_KEY_MEMCACHED_TLS;
} }
break; break;
case 't':
if (util::strieq_l("backend-connections-per-hos", name, 27)) {
return SHRPX_OPTID_BACKEND_CONNECTIONS_PER_HOST;
}
break;
} }
break; break;
case 30: case 30:
@ -2082,7 +2088,11 @@ int parse_config(const char *opt, const char *optarg,
"--host-rewrite option."; "--host-rewrite option.";
return 0; return 0;
case SHRPX_OPTID_BACKEND_HTTP1_CONNECTIONS_PER_HOST: { case SHRPX_OPTID_BACKEND_HTTP1_CONNECTIONS_PER_HOST:
LOG(WARN) << opt
<< ": deprecated. Use backend-connections-per-host instead.";
// fall through
case SHRPX_OPTID_BACKEND_CONNECTIONS_PER_HOST: {
int n; int n;
if (parse_uint(&n, opt, optarg) != 0) { if (parse_uint(&n, opt, optarg) != 0) {

View File

@ -235,6 +235,8 @@ constexpr char SHRPX_OPT_BACKEND_HTTP2_MAX_CONCURRENT_STREAMS[] =
constexpr char SHRPX_OPT_BACKEND_CONNECTIONS_PER_FRONTEND[] = constexpr char SHRPX_OPT_BACKEND_CONNECTIONS_PER_FRONTEND[] =
"backend-connections-per-frontend"; "backend-connections-per-frontend";
constexpr char SHRPX_OPT_BACKEND_TLS[] = "backend-tls"; constexpr char SHRPX_OPT_BACKEND_TLS[] = "backend-tls";
constexpr char SHRPX_OPT_BACKEND_CONNECTIONS_PER_HOST[] =
"backend-connections-per-host";
constexpr size_t SHRPX_OBFUSCATED_NODE_LENGTH = 8; constexpr size_t SHRPX_OBFUSCATED_NODE_LENGTH = 8;