New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle idle connections #137
Comments
This is supposed to be fixed in httpng. |
@kyukhin I did not agree with "wishlist". Lack of idle connections timeout has been exploding every cluster our customer have for a week and that's a lot of clusters. And the only solution we have is to configure Telegraf and have no way to protect from within tarantool. If it will be fixed in httpng then it must be ported to http - we have no resources to migrate every application we have to new http module. |
It is in our backlog now. Further prioritization may be done via the product team. |
It is possible to set a timeout in a keep-alive header. |
By default http module set keep-alive option in connections to make it persistent: $ tarantool examples/middleware.lua started entering the event loop HEAD / ... $ curl -I http://127.0.0.1:8080 HTTP/1.1 404 Not found Content-length: 0 Server: Tarantool http (tarantool v1.10.6-0-g5372cd2fa) Connection: keep-alive $ However sometimes we need persistent connection and close it instead. It is possible with option keepalive_disable. Option accepts a map where key is a user agent name with assigned non-nil value. Example: local httpd = http_server.new('127.0.0.1', 8080, { log_requests = true, log_errors = true, keepalive_disable = { ['curl/7.68.0'] = true }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable Fixes #137
By default http module set keep-alive option in connections to make it persistent: $ tarantool examples/middleware.lua started entering the event loop HEAD / ... $ curl -I http://127.0.0.1:8080 HTTP/1.1 404 Not found Content-length: 0 Server: Tarantool http (tarantool v1.10.6-0-g5372cd2fa) Connection: keep-alive $ However sometimes we need persistent connection and close it instead. It is possible with option keepalive_disable. Option accepts a map where key is a user agent name with assigned non-nil value. Example: local httpd = http_server.new('127.0.0.1', 8080, { log_requests = true, log_errors = true, keepalive_disable = { ['curl/7.68.0'] = true }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable Fixes #137
By default http module set keep-alive option in connections to make it persistent: $ tarantool examples/middleware.lua started entering the event loop HEAD / ... $ curl -I http://127.0.0.1:8080 HTTP/1.1 404 Not found Content-length: 0 Server: Tarantool http (tarantool v1.10.6-0-g5372cd2fa) Connection: keep-alive $ However sometimes we need persistent connection and close it instead. It is possible with option keepalive_disable. Option accepts a map where key is a user agent name with assigned non-nil value. Note: nginx web-server has a similar option, see [1]. Unfortunately http client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is untested. Example: local httpd = http_server.new('127.0.0.1', 8080, { log_requests = true, log_errors = true, keepalive_disable = { ['curl/7.68.0'] = true }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Fixes #137
By default http module set keep-alive option in connections to make it persistent. However sometimes we need persistent connection and close it instead. It is possible with option keepalive_disable. Option accepts a map where key is a user agent name with assigned non-nil value. Note: nginx web-server has a similar option, see [1]. Unfortunately http client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is untested. Example: local httpd = http_server.new('127.0.0.1', 8080, { log_requests = true, log_errors = true, keepalive_disable = { ['curl/7.68.0'] = true }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Fixes #137
By default http module set keep-alive option in connections to make it persistent. However sometimes we need persistent connection and close it instead. It is possible with option keepalive_disable. Option accepts a map where key is a user agent name with assigned non-nil value. Note: nginx web-server has a similar option, see [1]. Unfortunately http client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is untested. Example: local httpd = http_server.new('127.0.0.1', 8080, { log_requests = true, log_errors = true, keepalive_disable = { ['curl/7.68.0'] = true }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Fixes #137
By default http module set keep-alive option in connections to make it persistent. However sometimes we need persistent connection and close it instead. It is possible with option keepalive_disable. Option accepts a map where key is a user agent name with assigned non-nil value. Note: nginx web-server has a similar option, see [1]. Unfortunately http client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is untested. Example: local httpd = http_server.new('127.0.0.1', 8080, { log_requests = true, log_errors = true, keepalive_disable = { ['curl/7.68.0'] = true }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Fixes #137
By default http module set keep-alive option in connections to make it persistent. However sometimes we need persistent connection and close it instead. It is possible with option keepalive_disable. Option accepts a map where key is a user agent name with assigned non-nil value. Note: nginx web-server has a similar option, see [1]. Unfortunately http client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is untested. Example: local httpd = http_server.new('127.0.0.1', 8080, { log_requests = true, log_errors = true, keepalive_disable = { ['curl/7.68.0'] = true }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Fixes #137
By default http module set keep-alive option in connections to make it persistent. However sometimes we need persistent connection and close it instead. It is possible with option keepalive_disable. Option accepts a map where key is a user agent name with assigned non-nil value. Note: nginx web-server has a similar option, see [1]. Unfortunately http client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is untested. Example: local httpd = http_server.new('127.0.0.1', 8080, { log_requests = true, log_errors = true, keepalive_disable = { ['curl/7.68.0'] = true }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Fixes #137
By default http module set keep-alive option in connections to make it persistent. However sometimes we need persistent connection and close it instead. It is possible with option keepalive_disable. Option accepts a map where key is a user agent name with assigned non-nil value. Note: nginx web-server has a similar option, see [1]. Unfortunately http client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is untested. Example: local httpd = http_server.new('127.0.0.1', 8080, { log_requests = true, log_errors = true, keepalive_disable = { ['curl/7.68.0'] = true }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Fixes #137
By default http module set keep-alive option in connections to make it persistent. However sometimes we need persistent connection and close it instead. It is possible with option keepalive_disable. Option accepts a map where key is a user agent name with assigned non-nil value. Note: nginx web-server has a similar option, see [1]. Unfortunately http client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is untested. Example: local httpd = http_server.new('127.0.0.1', 8080, { log_requests = true, log_errors = true, keepalive_disable = { ['curl/7.68.0'] = true }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Fixes #137
By default http module set keep-alive option in connections to make it persistent. However sometimes we need persistent connection and close it instead. It is possible with option keepalive_disable. Option accepts a map where key is a user agent name with assigned non-nil value. Note: nginx web-server has a similar option, see [1]. Unfortunately http client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is untested. Example: local httpd = http_server.new('127.0.0.1', 8080, { log_requests = true, log_errors = true, keepalive_disable = { ['curl/7.68.0'] = true }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Fixes #137
By default http module set keep-alive option in connections to make it persistent. However sometimes we need persistent connection and close it instead. It is possible with option keepalive_disable. Option accepts a map where key is a user agent name with assigned non-nil value. Note: nginx web-server has a similar option, see [1]. Unfortunately http client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is untested. Example: local httpd = http_server.new('127.0.0.1', 8080, { log_requests = true, log_errors = true, keepalive_disable = { ['curl/7.68.0'] = true }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Fixes #137
By default http module set keep-alive option in connections to make it persistent. However sometimes we need persistent connection and close it instead. It is possible with option keepalive_disable. Option accepts a map where key is a user agent name with assigned non-nil value. Note: nginx web-server has a similar option, see [1]. Unfortunately http client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is untested. Example: local httpd = http_server.new('127.0.0.1', 8080, { log_requests = true, log_errors = true, keepalive_disable = { ['curl/7.68.0'] = true }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Part of #137
The main problem with current implementation of HTTP server is it's cooperative scheduling. To control connections we need invent something that will periodically checks open connections and close idles with exceeded timeout. Before start processing a new connection we close idle connections with exceeded idle_timeout. In comparison to other solutions (like running checking function in a separate fiber) closing connections synchronously is much easier to implement and don't make module complex. Fixes #137
The main problem with current implementation of HTTP server is it's cooperative scheduling. To control connections we need invent something that will periodically checks open connections and close idles with exceeded timeout. In proposed implementation we close idle connections with exceeded idle_timeout in synchronous manner - before start processing a new connection. In comparison to other solutions (like running checking function in a separate fiber) closing connections synchronously is much easier to implement and don't make module complex. Fixes #137
The main problem with current implementation of HTTP server is it's cooperative scheduling. To control connections we need invent something that will periodically checks open connections and close idles with exceeded timeout. In proposed implementation we close idle connections with exceeded idle_timeout in synchronous manner - before start processing a new connection. In comparison to other solutions (like running checking function in a separate fiber) closing connections synchronously is much easier to implement and don't make module complex. Fixes #137
Option idle_timeout allows to set a maximum amount of time an idle (keep-alive) connection will remain idle before closing. When the idle timeout is exceeded, HTTP server closes the keepalive connection. Fixes #137
By default HTTP server sets a keep-alive option in connections to make it persistent. However sometimes keeping connections alive is not required and user may want to disable it for a certain connections. Patch adds a new option 'disable_keepalive' that accepts a table with user agent names. HTTP server will disable keep-alive for connections established by user agents listed in a table. Note: nginx web-server has a similar option, see [1]. Unfortunately HTTP client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is not covered in regression tests. Example: local httpd = http_server.new('127.0.0.1', 8080, { log_requests = true, log_errors = true, keepalive_disable = { 'curl/7.68.0' }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Part of #137
Option idle_timeout allows to set a maximum amount of time an idle (keep-alive) connection will remain idle before closing. When the idle timeout is exceeded, HTTP server closes the keepalive connection. Fixes #137
By default HTTP server sets a keep-alive option in connections to make it persistent. However sometimes keeping connections alive is not required and user may want to disable it for a certain connections. Patch adds a new option 'disable_keepalive' that accepts a table with user agent names. HTTP server will disable keep-alive for connections established by user agents listed in a table. Note: nginx web-server has a similar option, see [1]. Unfortunately HTTP client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is not covered in regression tests. Example: local httpd = http_server.new('127.0.0.1', 8080, { keepalive_disable = { 'curl/7.68.0' }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Part of #137
Option idle_timeout allows to set a maximum amount of time an idle (keep-alive) connection will remain idle before closing. When the idle timeout is exceeded, HTTP server closes the keepalive connection. Fixes #137
By default HTTP server sets a keep-alive option in connections to make it persistent. However sometimes keeping connections alive is not required and user may want to disable it for a certain connections. Patch adds a new option 'disable_keepalive' that accepts a table with user agent names. HTTP server will disable keep-alive for connections established by user agents listed in a table. Note: nginx web-server has a similar option, see [1]. Unfortunately HTTP client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is not covered in regression tests. Example: local httpd = http_server.new('127.0.0.1', 8080, { keepalive_disable = { 'curl/7.68.0' }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Part of #137
Option idle_timeout allows to set a maximum amount of time an idle (keep-alive) connection will remain idle before closing. When the idle timeout is exceeded, HTTP server closes the keepalive connection. Fixes #137
Option idle_timeout allows to set a maximum amount of time an idle (keep-alive) connection will remain idle before closing. When the idle timeout is exceeded, HTTP server closes the keepalive connection. Fixes #137
By default HTTP server sets a keep-alive option in connections to make it persistent. However sometimes keeping connections alive is not required and user may want to disable it for a certain connections. Patch adds a new option 'disable_keepalive' that accepts a table with user agent names. HTTP server will disable keep-alive for connections established by user agents listed in a table. Note: nginx web-server has a similar option, see [1]. Unfortunately HTTP client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is not covered in regression tests. Example: local httpd = http_server.new('127.0.0.1', 8080, { keepalive_disable = { 'curl/7.68.0' }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Part of #137
Option idle_timeout allows to set a maximum amount of time an idle (keep-alive) connection will remain idle before closing. When the idle timeout is exceeded, HTTP server closes the keepalive connection. Fixes #137
By default HTTP server sets a keep-alive option in connections to make it persistent. However sometimes keeping connections alive is not required and user may want to disable it for a certain connections. Patch adds a new option 'disable_keepalive' that accepts a table with user agent names. HTTP server will disable keep-alive for connections established by user agents listed in a table. Note: nginx web-server has a similar option, see [1]. Unfortunately HTTP client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is not covered in regression tests. Example: local httpd = http_server.new('127.0.0.1', 8080, { keepalive_disable = { 'curl/7.68.0' }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Part of #137
Option idle_timeout allows to set a maximum amount of time an idle (keep-alive) connection will remain idle before closing. When the idle timeout is exceeded, HTTP server closes the keepalive connection. Fixes #137
By default HTTP server sets a keep-alive option in connections to make it persistent. However sometimes keeping connections alive is not required and user may want to disable it for a certain connections. Patch adds a new option 'disable_keepalive' that accepts a table with user agent names. HTTP server will disable keep-alive for connections established by user agents listed in a table. Note: nginx web-server has a similar option, see [1]. Unfortunately HTTP client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is not covered in regression tests. Example: local httpd = http_server.new('127.0.0.1', 8080, { keepalive_disable = { 'curl/7.68.0' }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Part of #137
Option idle_timeout allows to set a maximum amount of time an idle (keep-alive) connection will remain idle before closing. When the idle timeout is exceeded, HTTP server closes the keepalive connection. Fixes #137
By default HTTP server sets a keep-alive option in connections to make it persistent. However sometimes keeping connections alive is not required and user may want to disable it for a certain connections. Patch adds a new option 'disable_keepalive' that accepts a table with user agent names. HTTP server will disable keep-alive for connections established by user agents listed in a table. Note: nginx web-server has a similar option, see [1]. Unfortunately HTTP client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is not covered in regression tests. Example: local httpd = http_server.new('127.0.0.1', 8080, { keepalive_disable = { 'curl/7.68.0' }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Part of #137
Option idle_timeout allows to set a maximum amount of time an idle (keep-alive) connection will remain idle before closing. When the idle timeout is exceeded, HTTP server closes the keepalive connection. Fixes #137
By default HTTP server sets a keep-alive option in connections to make it persistent. However sometimes keeping connections alive is not required and user may want to disable it for a certain connections. Patch adds a new option 'disable_keepalive' that accepts a table with user agent names. HTTP server will disable keep-alive for connections established by user agents listed in a table. Note: nginx web-server has a similar option, see [1]. Unfortunately HTTP client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is not covered in regression tests. Example: local httpd = http_server.new('127.0.0.1', 8080, { disable_keepalive = { 'curl/7.68.0' }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Part of #137
Option idle_timeout allows to set a maximum amount of time an idle (keep-alive) connection will remain idle before closing. When the idle timeout is exceeded, HTTP server closes the keepalive connection. Fixes #137
Needed for #137 Reviewed-by: Alexander Turenko <alexander.turenko@tarantool.org>
By default HTTP server sets a keep-alive option in connections to make it persistent. However sometimes keeping connections alive is not required and user may want to disable it for a certain connections. Patch adds a new option 'disable_keepalive' that accepts a table with user agent names. HTTP server will disable keep-alive for connections established by user agents listed in a table. Note: nginx web-server has a similar option, see [1]. Unfortunately HTTP client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is not covered in regression tests. Example: local httpd = http_server.new('127.0.0.1', 8080, { disable_keepalive = { 'curl/7.68.0' }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Part of #137 Reviewed-by: Alexander Turenko <alexander.turenko@tarantool.org>
Option idle_timeout allows to set a maximum amount of time an idle (keep-alive) connection will remain idle before closing. When the idle timeout is exceeded, HTTP server closes the keepalive connection. Fixes #137 Reviewed-by: Alexander Turenko <alexander.turenko@tarantool.org>
Needed for #137 Reviewed-by: Alexander Turenko <alexander.turenko@tarantool.org>
By default HTTP server sets a keep-alive option in connections to make it persistent. However sometimes keeping connections alive is not required and user may want to disable it for a certain connections. Patch adds a new option 'disable_keepalive' that accepts a table with user agent names. HTTP server will disable keep-alive for connections established by user agents listed in a table. Note: nginx web-server has a similar option, see [1]. Unfortunately HTTP client [1] builtin into Tarantool supports only HTTP protocol version 1.1, so version 1.0 is not covered in regression tests. Example: local httpd = http_server.new('127.0.0.1', 8080, { disable_keepalive = { 'curl/7.68.0' }, }) 1. https://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_disable 2. https://www.tarantool.io/en/doc/latest/reference/reference_lua/http/ Part of #137 Reviewed-by: Alexander Turenko <alexander.turenko@tarantool.org>
Option idle_timeout allows to set a maximum amount of time an idle (keep-alive) connection will remain idle before closing. When the idle timeout is exceeded, HTTP server closes the keepalive connection. Fixes #137 Reviewed-by: Alexander Turenko <alexander.turenko@tarantool.org>
Problem statement
We have http server exposing metrics to telegraf. Telegraf scrapes metrics in 60 second intervals via http: it opens keep-alive connections but under certain conditions (have no repro, only in prod) it does not reuses established connections and opens new connection each time it scrapes metrics. This results in increasing number of open connections, every connection if a fiber which lives forever.
Possible solution
Introduce new http.server config options:
The text was updated successfully, but these errors were encountered: