From: Casey Bodley Date: Mon, 10 May 2021 15:17:50 +0000 (-0400) Subject: rgw: add config option to disable beast's async process_request() X-Git-Tag: v17.1.0~1989^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d4c83d576552968da1e27f5d47929ee0e5d07a39;p=ceph.git rgw: add config option to disable beast's async process_request() when disabled, a null_yield is given to process_request() so that it runs synchronously. mostly intended for debugging Signed-off-by: Casey Bodley --- diff --git a/src/common/options/rgw.yaml.in b/src/common/options/rgw.yaml.in index 6f7f769d5790..74ed33eca66a 100644 --- a/src/common/options/rgw.yaml.in +++ b/src/common/options/rgw.yaml.in @@ -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 diff --git a/src/rgw/rgw_asio_frontend.cc b/src/rgw/rgw_asio_frontend.cc index 75c63034a1d4..e9f46265a702 100644 --- a/src/rgw/rgw_asio_frontend.cc +++ b/src/rgw/rgw_asio_frontend.cc @@ -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();