nghttpx: Add --backend-http2-connections-per-worker

This commit is contained in:
Tatsuhiro Tsujikawa 2015-03-10 23:43:25 +09:00
parent 3e14261ebf
commit 0e3ae63965
3 changed files with 18 additions and 0 deletions

View File

@ -1030,6 +1030,10 @@ Performance:
Set maximum number of simultaneous connections frontend
accepts. Setting 0 means unlimited.
Default: )" << get_config()->worker_frontend_connections << R"(
--backend-http2-connections-per-worker=<N>
Set maximum number of HTTP/2 connections per worker.
The default value is 0, which means the number of
backend addresses specified by -b option.
--backend-http1-connections-per-host=<N>
Set maximum number of backend concurrent HTTP/1
connections per host. This option is meaningful when -s
@ -1493,6 +1497,7 @@ int main(int argc, char **argv) {
{"no-host-rewrite", no_argument, &flag, 73},
{"no-server-push", no_argument, &flag, 74},
{"backend-http2-connection-check", no_argument, &flag, 75},
{"backend-http2-connections-per-worker", required_argument, &flag, 76},
{nullptr, 0, nullptr, 0}};
int option_index = 0;
@ -1834,6 +1839,11 @@ int main(int argc, char **argv) {
// --backend-http2-connection-check
cmdcfgs.emplace_back(SHRPX_OPT_BACKEND_HTTP2_CONNECTION_CHECK, "yes");
break;
case 76:
// --backend-http2-connections-per-worker
cmdcfgs.emplace_back(SHRPX_OPT_BACKEND_HTTP2_CONNECTIONS_PER_WORKER,
optarg);
break;
default:
break;
}

View File

@ -148,6 +148,8 @@ const char SHRPX_OPT_BACKEND_RESPONSE_BUFFER[] = "backend-response-buffer";
const char SHRPX_OPT_NO_SERVER_PUSH[] = "no-server-push";
const char SHRPX_OPT_BACKEND_HTTP2_CONNECTION_CHECK[] =
"backend-http2-connection-check";
const char SHRPX_OPT_BACKEND_HTTP2_CONNECTIONS_PER_WORKER[] =
"backend-http2-connections-per-worker";
namespace {
Config *config = nullptr;
@ -1201,6 +1203,11 @@ int parse_config(const char *opt, const char *optarg) {
return 0;
}
if (util::strieq(opt, SHRPX_OPT_BACKEND_HTTP2_CONNECTIONS_PER_WORKER)) {
return parse_uint(&mod_config()->http2_downstream_connections_per_worker,
opt, optarg);
}
if (util::strieq(opt, "conf")) {
LOG(WARN) << "conf: ignored";

View File

@ -137,6 +137,7 @@ extern const char SHRPX_OPT_BACKEND_REQUEST_BUFFER[];
extern const char SHRPX_OPT_BACKEND_RESPONSE_BUFFER[];
extern const char SHRPX_OPT_NO_SERVER_PUSH[];
extern const char SHRPX_OPT_BACKEND_HTTP2_CONNECTION_CHECK[];
extern const char SHRPX_OPT_BACKEND_HTTP2_CONNECTIONS_PER_WORKER[];
union sockaddr_union {
sockaddr_storage storage;