-
Notifications
You must be signed in to change notification settings - Fork 477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perf improvement and refactor for the non-reliable disk buffer #3756
Perf improvement and refactor for the non-reliable disk buffer #3756
Conversation
Build SUCCESS |
@kira-syslogng do stresstest |
@kira-syslogng test this please test branch=benedek-add-disk-buffer-tests; |
Kira-stress-test: Build SUCCESS |
Build SUCCESS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for your work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one, thanks!
Signed-off-by: László Várady <[email protected]>
This method can be removed from the LogQueue interface in the future in favor of the backlog and its rewind mechanism. Signed-off-by: László Várady <[email protected]>
push_head() is dead code, it is not used by syslog-ng. This method can be removed from the LogQueue interface in the future in favor of the backlog and its rewind mechanism. Subsequent commits are going to change the internals of the non-reliable disk-buffer's push() and pop() operations, this was the trigger for this cleanup. Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
This is a refactor, the commit contains equivalent transformations based on the following considerations: This commit splits push_tail() into 3 push parts: qout, disk, and qoverflow - if qout has space in it and the disk is empty, we push into qout - we try to push into the disk buffer otherwise - when the disk push fails (full or write error), we push into qoverflow - once we reached the qoverflow area, we continue pushing message there instead of disk The above steps retain FIFO order if messages are moved from qoverflow to disk, and from disk to qout after each pop(). This is done by _move_disk(). Notes: Settings local_options.ack_needed to FALSE converts the subsequent log_msg_ack() call to a NOOP. It is cleaner not to call the ack method. The same is true for log_msg_ref() and log_msg_unref(). Signed-off-by: László Várady <[email protected]>
This is a refactor commit. Signed-off-by: László Várady <[email protected]>
unref() might free the message object, so ack() should be called first. Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
This is a preparation step for simplifying the move logic of non-reliable queue segments. This commit does not change functionality, as _move_messages_from_overflow is already there to move messages from the overflow queue. Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
The name of _get_next_message() can be misleading in this context, as it only reads from disk. Also, log_msg_ack() has no effect when adding a message from the disk to the qout queue. Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
qbacklog is accessed only from an output thread, so locking is not necessary. Signed-off-by: László Várady <[email protected]>
Signed-off-by: László Várady <[email protected]>
8a1936f
to
557f2db
Compare
@kira-syslogng test this please test branch=benedek-add-disk-buffer-tests; |
@kira-syslogng do stresstest |
FYI benedek-add-disk-buffer-tests has been merged. |
Whoops, my bad :( |
Build SUCCESS |
Kira-stress-test: Build FAILURE |
@kira-syslogng do stresstest |
Kira-stress-test: Build SUCCESS |
This PR refactors the non-reliable disk buffer and simplifies how messages are moved among queue segments.
(The trigger behind this refactor was to avoid unnecessarily (de)serialization and disk I/O operations in the move logic, but I had to drop those changes because they would have had unpleasant side effects.)
The last 2 commits improve the performance of the non-reliable disk buffer by using the entire qout when moving messages, and by eliminating a lock during qbacklog operations.
According to my measurements, this could increase the performance up to 20%.
No news file is needed, we'll add a news entry separately about the overall performance improvement we achieved.