]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add rgw_curl_tcp_keepalive option for http client requests
authorCasey Bodley <cbodley@redhat.com>
Wed, 20 Oct 2021 16:52:29 +0000 (12:52 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Wed, 11 Jan 2023 05:23:40 +0000 (00:23 -0500)
this can be useful to prevent long-lived connections from being dropped
due to inactivity

Fixes: https://tracker.ceph.com/issues/48402
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/common/options/rgw.yaml.in
src/rgw/rgw_http_client.cc

index f17c62ef9a47337fd222df208544f9c498f16584..03a9c7a8407a0ed477a0b14e92dc7cd527784846 100644 (file)
@@ -1951,6 +1951,17 @@ options:
   services:
   - rgw
   with_legacy: true
+- name: rgw_curl_tcp_keepalive
+  type: int
+  level: advanced
+  long_desc: Enable TCP keepalive on the HTTP client sockets managed by libcurl. This does not apply to connections received by the HTTP frontend, but only to HTTP requests sent by radosgw. Examples include requests to Keystone for authentication, sync requests from multisite, and requests to key management servers for SSE.
+  enum_values:
+  - 0
+  - 1
+  default: 0
+  services:
+  - rgw
+  with_legacy: true
 - name: rgw_copy_obj_progress
   type: bool
   level: advanced
index 5bf977d4f3b3a5f4410a95f12a9a80ac424284ca..255db71a50d2f152e3bc89402118b9af10e4118f 100644 (file)
@@ -586,6 +586,7 @@ int RGWHTTPClient::init_request(rgw_http_req_data *_req_data)
   curl_easy_setopt(easy_handle, CURLOPT_ERRORBUFFER, (void *)req_data->error_buf);
   curl_easy_setopt(easy_handle, CURLOPT_LOW_SPEED_TIME, cct->_conf->rgw_curl_low_speed_time);
   curl_easy_setopt(easy_handle, CURLOPT_LOW_SPEED_LIMIT, cct->_conf->rgw_curl_low_speed_limit);
+  curl_easy_setopt(easy_handle, CURLOPT_TCP_KEEPALIVE, cct->_conf->rgw_curl_tcp_keepalive);
   curl_easy_setopt(easy_handle, CURLOPT_READFUNCTION, send_http_data);
   curl_easy_setopt(easy_handle, CURLOPT_READDATA, (void *)req_data);
   curl_easy_setopt(easy_handle, CURLOPT_BUFFERSIZE, cct->_conf->rgw_curl_buffersize);