]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add config option to disable beast's async process_request() 41261/head
authorCasey Bodley <cbodley@redhat.com>
Mon, 10 May 2021 15:17:50 +0000 (11:17 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 10 May 2021 15:17:52 +0000 (11:17 -0400)
when disabled, a null_yield is given to process_request() so that it
runs synchronously. mostly intended for debugging

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/common/options/rgw.yaml.in
src/rgw/rgw_asio_frontend.cc

index 6f7f769d5790b567ea7247c85453beb972b2f984..74ed33eca66a13ac29e6af5dacb415eef69940a8 100644 (file)
@@ -1840,6 +1840,19 @@ options:
   default: beast ssl_certificate=config://rgw/cert/$realm/$zone.crt ssl_private_key=config://rgw/cert/$realm/$zone.key
   services:
   - rgw
+- name: rgw_beast_enable_async
+  type: bool
+  level: dev
+  desc: Enable async request processing under beast using coroutines
+  long_desc: When enabled, the beast frontend will process requests using
+    coroutines, allowing the concurrent processing of several requests on the
+    same thread. When disabled, the number of concurrent requests will be
+    limited by the thread count, but debugging and tracing the synchronous
+    calls can be easier.
+  default: true
+  services:
+  - rgw
+  with_legacy: true
 - name: rgw_user_quota_bucket_sync_interval
   type: int
   level: advanced
index 75c63034a1d47347558a58ac9fbf93871a6c4b75..e9f46265a70267417dd71ea0b54277f3750353c3 100644 (file)
@@ -250,7 +250,10 @@ void handle_connection(boost::asio::io_context& context,
                                   rgw::io::add_conlen_controlling(
                                     &real_client))));
       RGWRestfulIO client(cct, &real_client_io);
-      auto y = optional_yield{context, yield};
+      optional_yield y = null_yield;
+      if (cct->_conf->rgw_beast_enable_async) {
+        y = optional_yield{context, yield};
+      }
       int http_ret = 0;
       string user = "-";
       const auto started = ceph::coarse_real_clock::now();