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

AtLeastOnceDelivery: only tick when there are unconfirmed deliveries? #26216

Closed
raboof opened this Issue Jan 8, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@raboof
Copy link
Member

raboof commented Jan 8, 2019

AtLeastOnceDelivery currently uses a scheduled 'tick' message to periodically check if there are any messages to be redelivered.

If you have a lot of actors that mix in AtLeastOnceDelivery, this could cause some CPU load even if there are currently no messages to be redelivered. It might be interesting to be a bit more subtle about when to trigger a RedeliveryTick: either scheduling it for the moment the next unconfirmed message is supposed to be redelivered, or at least only ticking when the set of unconfirmed messages is nonEmpty.

@patriknw

This comment has been minimized.

Copy link
Member

patriknw commented Jan 8, 2019

Should be easier to implement nowadays with the Timers support.

@patriknw patriknw self-assigned this Jan 15, 2019

patriknw added a commit that referenced this issue Jan 15, 2019

optimize AtLeastOnceDelivery by not scheduling ticks when not needed, #…
…26216

* when there are no pending unconfirmed messages the redelivery tick
  is not needed
* before the change 100k idle actors used around 25% CPU on my machine
* dropped to almost 0% after the change (ofc)
* not using Timers API because that would not be binary compatible

patriknw added a commit that referenced this issue Jan 17, 2019

Merge pull request #26248 from akka/wip-26216-AtLeastOnceDelivery-tic…
…k-patriknw

optimize AtLeastOnceDelivery by not scheduling ticks when not needed, #26216

@patriknw patriknw added this to the 2.5.20 milestone Jan 17, 2019

@patriknw patriknw closed this Jan 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment