From 1a2e50ca08269dc444bfea1ad7f887d2a222ff95 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 9 Aug 2014 22:59:31 +0900 Subject: [PATCH] nghttpx: Lower timeouts --- src/shrpx.cc | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/shrpx.cc b/src/shrpx.cc index d4b203c9..1b37db92 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -476,22 +476,17 @@ void fill_default_config() mod_config()->cert_file = nullptr; // Read timeout for HTTP2 upstream connection - mod_config()->http2_upstream_read_timeout.tv_sec = 180; - mod_config()->http2_upstream_read_timeout.tv_usec = 0; + mod_config()->http2_upstream_read_timeout = {180, 0}; // Read timeout for non-HTTP2 upstream connection - mod_config()->upstream_read_timeout.tv_sec = 180; - mod_config()->upstream_read_timeout.tv_usec = 0; + mod_config()->upstream_read_timeout = {30, 0}; // Write timeout for HTTP2/non-HTTP2 upstream connection - mod_config()->upstream_write_timeout.tv_sec = 60; - mod_config()->upstream_write_timeout.tv_usec = 0; + mod_config()->upstream_write_timeout = {30, 0}; // Read/Write timeouts for downstream connection - mod_config()->downstream_read_timeout.tv_sec = 900; - mod_config()->downstream_read_timeout.tv_usec = 0; - mod_config()->downstream_write_timeout.tv_sec = 60; - mod_config()->downstream_write_timeout.tv_usec = 0; + mod_config()->downstream_read_timeout = {30, 0}; + mod_config()->downstream_write_timeout = {30, 0}; // Read timeout for HTTP/2 stream mod_config()->stream_read_timeout = {30, 0}; @@ -500,7 +495,7 @@ void fill_default_config() mod_config()->stream_write_timeout = {30, 0}; // Timeout for pooled (idle) connections - mod_config()->downstream_idle_read_timeout.tv_sec = 60; + mod_config()->downstream_idle_read_timeout = {60, 0}; // window bits for HTTP/2 and SPDY upstream/downstream connection // per stream. 2**16-1 = 64KiB-1, which is HTTP/2 default. Please