Dan Kenigsberg has submitted this change and it was merged. Change subject: Improvement of the GuestAgent class memory usage ......................................................................
Improvement of the GuestAgent class memory usage Change in the implementation of reading and handling messages from the guest agent. Every 64KiB the newly arrived content is checked for a newline character and all messages are handled immediately before it continues to read. If the received data do not contain a new line character the data is appended to the buffer list and the _buffer_size variable increased by the size of all stored buffers in the list. If _buffer_size exceeds the defined threshold, currently set to 1MiB, the buffer list will be discarded and _buffer_size will be reset to 0. Additionally the _message_state variable will be set to 'MessageState.TOO_BIG' which indicates that the message must not be parsed once the next new-line character will arrive. Messages which are too big will never be parsed. Once a new-line character after a too big message arrives, the _message_state variable will be reset to MessageState.NORMAL. This change has been done to improve and control the amount of memory consumed by instances of the GuestAgent class. Scenarios covered by the test: * Multiple messages sent at once with various sizes (handled in TestGuestIFHandleData.testBigChunk) * Messages sent in chunks one by one with oversized messages and normal sized messages. (handled in TuestGuestIFHandleData.testMixed) Signed-off-by: Vinzenz Feenstra <[email protected]> Change-Id: Ibf6274bb10c9e3b80962b69c5df316f03ee21214 --- M tests/guestIFTests.py M vdsm/guestIF.py 2 files changed, 188 insertions(+), 72 deletions(-) Approvals: Dan Kenigsberg: Verified; Looks good to me, approved -- To view, visit http://gerrit.ovirt.org/9239 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf6274bb10c9e3b80962b69c5df316f03ee21214 Gerrit-PatchSet: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Vinzenz Feenstra <[email protected]> Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Gal Hammer <[email protected]> Gerrit-Reviewer: Igor Lvovsky <[email protected]> Gerrit-Reviewer: Peter V. Saveliev <[email protected]> Gerrit-Reviewer: Saggi Mizrahi <[email protected]> Gerrit-Reviewer: ShaoHe Feng <[email protected]> Gerrit-Reviewer: Vinzenz Feenstra <[email protected]> Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]> Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
