You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, responses to HTTP requests are fully assembled in memory before they are sent to the client. Given that these responses can get quite big, for example when fetching an unfiltered /v1/objects/services list in a large installation, this can result in (to put it mildly) suboptimal memory usage.
Status quo
After an object is determined to be included in the response, it is serialized (this creates a copy of all its attributes):
Stream the JSON to the client's HTTP connection on the fly while going through the objects. This should allow answering these requests using far less memory (probably something like what it takes to represent a single object).
I'll create some sub-issues to break this into smaller tasks to start with.
The text was updated successfully, but these errors were encountered:
Currently, responses to HTTP requests are fully assembled in memory before they are sent to the client. Given that these responses can get quite big, for example when fetching an unfiltered
/v1/objects/services
list in a large installation, this can result in (to put it mildly) suboptimal memory usage.Status quo
icinga2/lib/remote/objectqueryhandler.cpp
Line 229 in 8d607d2
icinga2/lib/remote/objectqueryhandler.cpp
Line 313 in 8d607d2
HttpUtility::SendJsonBody()
:icinga2/lib/remote/objectqueryhandler.cpp
Lines 316 to 321 in 8d607d2
icinga2/lib/remote/httputility.cpp
Lines 60 to 61 in 8d607d2
Desired behavior
Stream the JSON to the client's HTTP connection on the fly while going through the objects. This should allow answering these requests using far less memory (probably something like what it takes to represent a single object).
I'll create some sub-issues to break this into smaller tasks to start with.
The text was updated successfully, but these errors were encountered: