nghttpx: Add --backend-http2-connections-per-worker
This commit is contained in:
parent
3e14261ebf
commit
0e3ae63965
10
src/shrpx.cc
10
src/shrpx.cc
|
@ -1030,6 +1030,10 @@ Performance:
|
||||||
Set maximum number of simultaneous connections frontend
|
Set maximum number of simultaneous connections frontend
|
||||||
accepts. Setting 0 means unlimited.
|
accepts. Setting 0 means unlimited.
|
||||||
Default: )" << get_config()->worker_frontend_connections << R"(
|
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>
|
--backend-http1-connections-per-host=<N>
|
||||||
Set maximum number of backend concurrent HTTP/1
|
Set maximum number of backend concurrent HTTP/1
|
||||||
connections per host. This option is meaningful when -s
|
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-host-rewrite", no_argument, &flag, 73},
|
||||||
{"no-server-push", no_argument, &flag, 74},
|
{"no-server-push", no_argument, &flag, 74},
|
||||||
{"backend-http2-connection-check", no_argument, &flag, 75},
|
{"backend-http2-connection-check", no_argument, &flag, 75},
|
||||||
|
{"backend-http2-connections-per-worker", required_argument, &flag, 76},
|
||||||
{nullptr, 0, nullptr, 0}};
|
{nullptr, 0, nullptr, 0}};
|
||||||
|
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
|
@ -1834,6 +1839,11 @@ int main(int argc, char **argv) {
|
||||||
// --backend-http2-connection-check
|
// --backend-http2-connection-check
|
||||||
cmdcfgs.emplace_back(SHRPX_OPT_BACKEND_HTTP2_CONNECTION_CHECK, "yes");
|
cmdcfgs.emplace_back(SHRPX_OPT_BACKEND_HTTP2_CONNECTION_CHECK, "yes");
|
||||||
break;
|
break;
|
||||||
|
case 76:
|
||||||
|
// --backend-http2-connections-per-worker
|
||||||
|
cmdcfgs.emplace_back(SHRPX_OPT_BACKEND_HTTP2_CONNECTIONS_PER_WORKER,
|
||||||
|
optarg);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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_NO_SERVER_PUSH[] = "no-server-push";
|
||||||
const char SHRPX_OPT_BACKEND_HTTP2_CONNECTION_CHECK[] =
|
const char SHRPX_OPT_BACKEND_HTTP2_CONNECTION_CHECK[] =
|
||||||
"backend-http2-connection-check";
|
"backend-http2-connection-check";
|
||||||
|
const char SHRPX_OPT_BACKEND_HTTP2_CONNECTIONS_PER_WORKER[] =
|
||||||
|
"backend-http2-connections-per-worker";
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
Config *config = nullptr;
|
Config *config = nullptr;
|
||||||
|
@ -1201,6 +1203,11 @@ int parse_config(const char *opt, const char *optarg) {
|
||||||
return 0;
|
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")) {
|
if (util::strieq(opt, "conf")) {
|
||||||
LOG(WARN) << "conf: ignored";
|
LOG(WARN) << "conf: ignored";
|
||||||
|
|
||||||
|
|
|
@ -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_BACKEND_RESPONSE_BUFFER[];
|
||||||
extern const char SHRPX_OPT_NO_SERVER_PUSH[];
|
extern const char SHRPX_OPT_NO_SERVER_PUSH[];
|
||||||
extern const char SHRPX_OPT_BACKEND_HTTP2_CONNECTION_CHECK[];
|
extern const char SHRPX_OPT_BACKEND_HTTP2_CONNECTION_CHECK[];
|
||||||
|
extern const char SHRPX_OPT_BACKEND_HTTP2_CONNECTIONS_PER_WORKER[];
|
||||||
|
|
||||||
union sockaddr_union {
|
union sockaddr_union {
|
||||||
sockaddr_storage storage;
|
sockaddr_storage storage;
|
||||||
|
|
Loading…
Reference in New Issue