mgr/rest: Trim requests array and limit size#54984
Conversation
|
@tchaikov @athanatos this is a split PR from #54634 like you suggested. |
|
i think there is a defect in the design of the restful mgr module. which allows client to send requests to the cluster using RESTful API, and client can track the requests' status using their ids. and the mgr module deletes the finished requests upon request of client, or delete the specified one upon request of client. but if client fails to do so, the requests are accumulated in the mgr module, no matter if they are finished or not. @NitzanMordhai i'd suggest
i think the title of "Trim results array and limit size" is a little bit misleading, it's a "request" list, not a "results" array. and the option should be documented, but you checked "No doc update is appropriate". i doubt this. |
|
@tchaikov thanks for the review, I'm going to fix some of the things, but since we haven't got any respond yet on the user-list (3 years past and yet, we have some users who use that) maybe it will be good idea to resent that message and announce on the deprecation |
|
@NitzanMordhai yeah, IMHO, 3 years is long enough to make a breaking change. and the first step is just to move the module into its own module instead of removing it. this should help users to understand the status of this module. |
|
please ping me if this change is ready for another review. |
@tchaikov thank you very much for your reviews, can we proceed with that fix and deprecate the rest module in another PR? Currently, the deprecation is not announced in changelog, I'll create another PR for the deprecation process - will you help me with that? |
@NitzanMordhai Nitzan, sure. we can do this in parallel. but this PR also needs more work, AFAICT. as it does address the "unbounded requests queue" issue. what exactly do you want from my end? |
01344a6 to
d8a58ec
Compare
@tchaikov i just updated the PR with your suggestions. can you please review it? |
tchaikov
left a comment
There was a problem hiding this comment.
sorry for the latency. left a comment.
d8a58ec to
738f485
Compare
|
jenkins test api |
tchaikov
left a comment
There was a problem hiding this comment.
could improve the document a little bit.
738f485 to
d6e99c0
Compare
tchaikov
left a comment
There was a problem hiding this comment.
the document does not look right.
|
@NitzanMordhai ping? |
d6e99c0 to
e12ba7d
Compare
|
jenkins test make check |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
208aed8 to
7ba09b0
Compare
|
@yuriw can we add it to one of the tests? |
|
Hello, would be good to see movement on this as I see people using the restful plugin (most of them using it for zabbix). Thank you. |
PendingReleaseNotes
Outdated
| default json format produces a rather massive output in large clusters and | ||
| isn't scalable. So we have removed the 'network_ping_times' section from | ||
| the output. Details in the tracker: https://tracker.ceph.com/issues/57460 | ||
| * mgr/rest: The rest manager module will trim requests based on the 'max_requests' option. |
PendingReleaseNotes
Outdated
| * mgr/rest: The rest manager module will trim requests based on the 'max_requests' option. | ||
| Without this feature, and in the absence of manual deletion of old requests, | ||
| the accumulation of requests in the array can lead to Out Of Memory (OOM) issues, | ||
| resulting in the termination of the manager. |
There was a problem hiding this comment.
resulting in the Manager crashing.
doc/mgr/restful.rst
Outdated
| If the address it not configured, the *restful* will bind to ``::``, | ||
| which corresponds to all available IPv4 and IPv6 addresses. | ||
|
|
||
| Configuring the max_request |
doc/mgr/restful.rst
Outdated
| --------------------------- | ||
|
|
||
| The maximum request size can be configured via the configuration key | ||
| facility:: |
There was a problem hiding this comment.
via a central configuration option::
|
jenkins test api |
|
@NitzanMordhai pls merge when all checks passed |
Presently, the requests array in the REST module has the potential to grow indefinitely, leading to excessive memory consumption, particularly when dealing with lengthy and intricate request results. To address this issue, a limit will be imposed on the requests array within the REST module. This limitation will be governed by the `mgr/restful/x/max_requests` configuration parameter specific to the REST module. when submit_request called we will check request array if exceed max_request option if it does we will check if the future trimmed request finished and log error message in case we are trimming un-finished requests. Fixes: https://tracker.ceph.com/issues/59580 Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
…max_request option Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
7ba09b0 to
dd7e8bb
Compare
|
jenkins test make check |
Presently, the requests array in the REST module has the potential to grow indefinitely, leading to excessive memory consumption, particularly when dealing with lengthy and intricate request results.
To address this issue, a limit will be imposed on the requests array within the REST module.
This limitation will be governed by the
mgr/restful/x/max_requestsconfiguration parameter specific to the REST module.I ran a few thousand pg dump commands with and without the trimming of the requests array, there is a big improvement with the trimming when the cluster returns a large output from the pg dump command.
with the trimming:
image
without the trimming:
image
Fixes: https://tracker.ceph.com/issues/59580
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e