-
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
disk-buffer: add qout-like memory queue to reliable disk-buffer #3754
Conversation
Build FAILURE |
@kira-syslogng test this please test branch=diskq-perf-reliable-qout; |
@kira-syslogng do stresstest |
Build SUCCESS |
Kira-stress-test: Build SUCCESS |
38ab274
to
387effc
Compare
Rebased to master. |
@kira-syslogng do stresstest |
@kira-syslogng test this please test branch=diskq-perf-reliable-qout; |
387effc
to
ba58cb7
Compare
Cherry picked MrAnno@d37895a |
@kira-syslogng test this please test branch=diskq-perf-reliable-qout; |
@kira-syslogng do stresstest |
Build SUCCESS |
Kira-stress-test: Build SUCCESS |
ba58cb7
to
a09ce1a
Compare
@kira-syslogng test this please test branch=diskq-perf-reliable-qout; |
@kira-syslogng do stresstest |
Build FAILURE |
a09ce1a
to
9f5524e
Compare
@kira-syslogng test this please test branch=diskq-perf-reliable-qout; |
@kira-syslogng do stresstest |
Signed-off-by: Attila Szakacs <[email protected]>
Signed-off-by: Attila Szakacs <[email protected]>
…nctions Signed-off-by: Attila Szakacs <[email protected]>
Signed-off-by: Attila Szakacs <[email protected]>
Signed-off-by: Attila Szakacs <[email protected]>
Signed-off-by: Attila Szakacs <[email protected]>
Signed-off-by: Attila Szakacs <[email protected]>
This memory queue will work similar to the one in non-reliable, with the difference, that we still store the messages on the disk, additionally to storing it in the memory queue. The main usage of qout in the reliable disk buffer is to have some msgs stored in memory, so when we get to the point in the qdisk, where we also have that msg stored in the memory, we just skip the one on the disk, and use the one in the memory, saving one message read from the disk, and one deserialization. The first difference between qout and qreliable is that we ack the msg, because we do not want to trigger the flow-control. The other difference is, that we do not move from qout to qbacklog, we let the qdisk's backlog handling handle the situation. Signed-off-by: Attila Szakacs <[email protected]>
Signed-off-by: Attila Szakacs <[email protected]>
See: logqueue-disk-reliable: add skeleton of qout memory queue Signed-off-by: Attila Szakacs <[email protected]>
Signed-off-by: Attila Szakacs <[email protected]>
27aaaf6
to
3c88832
Compare
@kira-syslogng test this please test branch=diskq-perf-reliable-qout; |
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.
My only comment is regarding news file, and those information should be present in the documentation, so it is fine if not updated here. I'd still prefer to.
@@ -0,0 +1,10 @@ | |||
`disk-buffer`: Added a new option to reliable disk-buffer: `qout-size()`. |
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.
What is the default size? Are there limitation (max, min), or should this value be in sync with different parameters ? Mentioning these in the news file could be useful.
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.
I've also reviewed this PR and I'm ready to approve it.
Since @alltilla is on vacation, I'm adding the default value (which will be 1000 after merging #3757) to the news entry.
To keep news entries short, I would not mention more.
The minimum value is 0, which is forced by our grammar.
There is no theoretical maximum value, but setting this larger than the disk buffer's size (which is given in bytes, but qout-size counts the number of messages) would not make sense, but it is allowed and it will work correctly.
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.
There is an extra check in the setter, that enforces the 64 as min value. Maybe allowing 0 wouldn't be a bad thing. What do you think ?
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.
Oh sorry, I misunderstood the comment about 64. Yeah, we should definitely allow 0.
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.
Done.
Signed-off-by: Attila Szakacs <[email protected]> Signed-off-by: László Várady <[email protected]>
3c88832
to
45d98d1
Compare
@kira-syslogng test this please test branch=diskq-perf-reliable-qout; |
Build SUCCESS |
This way, qout can be completely disabled for the reliable and the non-reliable disk buffer. Signed-off-by: László Várady <[email protected]>
Build FAILURE |
@kira-syslogng test this please test branch=diskq-perf-reliable-qout; |
Signed-off-by: Attila Szakacs <[email protected]> Signed-off-by: László Várady <[email protected]>
Build SUCCESS |
This PR adds a fast-path memory queue implementation to the reliable disk-buffer, which can save time, when messages are coming in with a smaller rate, similarly to the qout memory queue in the non-reliable disk-buffer.
This queue still guarantees, that all the received messages are written to the disk as soon as possible.
Also added
qout-size()
option to reliable disk-buffer, which limits the number of messages in the new memory queue.The idea behind this improvement, is that if there is space in qout, additionally to storing the serialized message on the disk, we store the message in memory, too. When we arrive to that message on the disk, we do not read it from the disk, and we do not deserialize it, but use the one, stored in the memory, and skip the one on the disk.
Performance gain:
On my computer, I tested different input message rates, and checked, which is the highest, that the disk-buffer can follow with the queued counter staying near 0:
qout-size(100000)
: ~80k msg/secSigned-off-by: Attila Szakacs [email protected]