Skip to content
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

feat: message ack sync changes improvements #43

Merged

Conversation

AkbaraliShaikh
Copy link
Member

@AkbaraliShaikh AkbaraliShaikh commented Sep 2, 2022

Removed the connection block on reading the messages for open active connection
Implemented the single go-routine for the sync ack response reporting
Moved the ack changes to the new file ack.go
Added couple of new metrics to check the tt for kafka batch publish and for the ack response.
#42

Perf Results: Ack Channel
go-routine per connection (blue) vs single go-routine for all connections (yellow)
image

Removed the connection block on reading the messages for open
connection
Implemented the single go-routine for the sync ack reporting
Moved the ack changes to the new file ack.go
Added few metrics to check the tt for kafka batch publish and for the
ack.
services/rest/service.go Show resolved Hide resolved
services/rest/websocket/ack.go Show resolved Hide resolved
services/rest/websocket/connection/conn.go Show resolved Hide resolved
services/rest/websocket/handler.go Show resolved Hide resolved
Copy link
Contributor

@chakravarthyvp chakravarthyvp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chakravarthyvp chakravarthyvp merged commit ef219b6 into raystack:main Sep 6, 2022

var AckChan = make(chan AckInfo)

type AckInfo struct {
Copy link
Member

@ravisuhag ravisuhag Sep 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AkbaraliShaikh If package itself is ack. This can be named just Info to remove brevity in usage. ack.AckInfo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package name is not ack so the name is used as AckInfo. It's not a sub package.

AckTimeConsumed time.Time
}

func AckHandler(ch <-chan AckInfo) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. Can it be just Handler?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot, It's not under the ack package.


tim := time.Since(c.TimeConsumed)
if c.Err != nil {
metrics.Timing("event_rtt_ms", tim.Milliseconds(), "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AkbaraliShaikh What is the diff between ack_event_rtt_ms and event_rtt_ms ? It will be confusing if both are different ones. Also let's have a consistent naming of metrics.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

event_rtt_ms -> is used to track the total time taken for the event (from consume -> response)
ack_event_rtt_ms -> is used to track the total time taken for only acknowledging (time spent in the ack channel).

@ravisuhag ravisuhag linked an issue Sep 7, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the ack changes for synchronous
3 participants