Skip to content

Commit dd7e8bb

Browse files
committed
doc/mgr/restful: update max_request config
Signed-off-by: Nitzan Mordechai <[email protected]>
1 parent 7b251ca commit dd7e8bb

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

doc/mgr/restful.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@ If the port is not configured, *restful* will bind to port ``8003``.
7777
If the address it not configured, the *restful* will bind to ``::``,
7878
which corresponds to all available IPv4 and IPv6 addresses.
7979

80+
Configuring max_request
81+
---------------------------
82+
83+
The maximum request size can be configured via a central configuration
84+
option::
85+
86+
ceph config set mgr mgr/restful/$name/max_requests $NUM
87+
88+
where ``$name`` is the ID of the ceph-mgr daemon (usually the hostname).
89+
90+
.. mgr_module:: restful
91+
.. confval:: max_requests
92+
8093
.. _creating-an-api-user:
8194

8295
Creating an API User

src/pybind/mgr/restful/module.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from werkzeug.serving import make_server, make_ssl_devcert
2525

2626
from .hooks import ErrorHook
27-
from mgr_module import MgrModule, CommandResult, NotifyType
27+
from mgr_module import MgrModule, CommandResult, NotifyType, Option
2828
from mgr_util import build_url
2929

3030

@@ -194,11 +194,18 @@ def __json__(self):
194194

195195
class Module(MgrModule):
196196
MODULE_OPTIONS = [
197-
{'name': 'server_addr'},
198-
{'name': 'server_port'},
199-
{'name': 'key_file'},
200-
{'name': 'enable_auth', 'type': 'bool', 'default': True},
201-
{'name': 'max_requests', 'type': 'int', 'default': 500},
197+
Option(name='server_addr'),
198+
Option(name='server_port'),
199+
Option(name='key_file'),
200+
Option(name='enable_auth',
201+
type='bool',
202+
default=True),
203+
Option(name='max_requests',
204+
type='int',
205+
default=500,
206+
desc='Maximum number of requests to keep in memory. '
207+
' When new request comes in, the oldest request will be removed if the number of requests exceeds the max request number.'
208+
'if un-finished request is removed, error message will be logged in the ceph-mgr log.'),
202209
]
203210

204211
COMMANDS = [

0 commit comments

Comments
 (0)