-
Notifications
You must be signed in to change notification settings - Fork 19
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
bf: BB-419 increase notification default concurrency #2422
bf: BB-419 increase notification default concurrency #2422
Conversation
Hello jonathan-gramain,My role is to assist you with the merge of this Status report is not available. |
ConflictA conflict has been raised during the creation of I have not created the integration branch. Here are the steps to resolve this conflict: $ git fetch
$ git checkout -B w/7.70/bugfix/BB-419-increaseNotificationDefaultConcurrency origin/development/7.70
$ git merge origin/bugfix/BB-419-increaseNotificationDefaultConcurrency
$ # <intense conflict resolution>
$ git commit
$ git push -u origin w/7.70/bugfix/BB-419-increaseNotificationDefaultConcurrency |
f801b51
to
27b4046
Compare
}, err => { | ||
assert.ifError(err); | ||
// should not have been sent | ||
assert(!send.calledOnce); |
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.
could this be true if send.calledTwice == true
? Is .notCalled
what is wanted instead?
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.
yes, good point
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.
fixed, using send.notCalled
done(); | ||
}); | ||
}); | ||
}); |
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.
is it possible that JSON parsing might fail in qp.processKafkaEntry?
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.
It actually throws an exception if the input is not valid JSON.
It's not directly related to the scope of this PR, but it can be a good idea to return a proper error instead and add a test case for it indeed.
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 fixed JSON parsing exception and added a test
// no "eventType" | ||
value: '{}', | ||
}), | ||
}, err => { |
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.
if there's no eventType, is there an error/log message or it just silently doesn't send?
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 think this is where the check happens: https://github.com/scality/backbeat/blob/development/8.6/extensions/notification/utils/config.js#L85
I believe there is no particular log.
For the context, I closed a previous iteration of this PR (#2421) that was not waiting for the callback of send
but we decided to rework it differently, the point of this test was then mostly to trigger a case where a message is not sent for regression testing, not particularly to check all details of the particular case where eventType
is not passed. I kept it because I think it has some value to test this case but it's not anymore directly related to the change.
Notification QueueProcessor was limited by a concurrency of 10, which meant it could only wait for 10 delivery reports from the producer before consuming more entries. Increased the default concurrency to 1000 to improve throughput and add a test to show that it behaves well with this number of pending reports (the processing does not involve anything else asynchronous than waiting for delivery reports), as well as a few other extra tests. Also fix and improve logging related to processing errors and error reporting from delivery reports.
Use a code constant for `pollIntervalMs`, and add a JSDoc about it (and `messageMaxBytes`)
Make the external Kafka producer poll interval configurable: while the default is 2000ms, it could be helpful to reduce its value, e.g. to reduce latency of delivery in case the external Kafka cluster cannot receive all notifications in time. It's not clear at this point what would be a better value due to lack of testing to the limits, and 2000ms doesn't look unreasonable as a trade-off between latency and polling overhead, so leaving the default value as it is. It is however important to have a concurrency value high enough to not limit the possible throughput per notification processor, which is limited by "concurrency / poll_interval_seconds" messages per second. The concurrency has been raised to 1000 by default which therefore allows 500 messages per second to go through per processor with a 2000ms poll interval.
27b4046
to
847f219
Compare
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
ConflictA conflict has been raised during the creation of I have not created the integration branch. Here are the steps to resolve this conflict: $ git fetch
$ git checkout -B w/7.70/bugfix/BB-419-increaseNotificationDefaultConcurrency origin/development/7.70
$ git merge origin/bugfix/BB-419-increaseNotificationDefaultConcurrency
$ # <intense conflict resolution>
$ git commit
$ git push -u origin w/7.70/bugfix/BB-419-increaseNotificationDefaultConcurrency |
ConflictA conflict has been raised during the creation of I have not created the integration branch. Here are the steps to resolve this conflict: $ git fetch
$ git checkout -B w/8.5/bugfix/BB-419-increaseNotificationDefaultConcurrency origin/development/8.5
$ git merge origin/w/7.70/bugfix/BB-419-increaseNotificationDefaultConcurrency
$ # <intense conflict resolution>
$ git commit
$ git push -u origin w/8.5/bugfix/BB-419-increaseNotificationDefaultConcurrency |
Integration data createdI have created the integration data for the additional destination branches.
The following branches will NOT be impacted:
You can set option
|
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
History mismatchMerge commit #1e5dae878ab6d5cf220e8460791d515480d132c1 on the integration branch It is likely due to a rebase of the branch Please use the |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
/approve |
In the queueThe changeset has received all authorizations and has been added to the The changeset will be merged in:
The following branches will NOT be impacted:
There is no action required on your side. You will be notified here once IMPORTANT Please do not attempt to modify this pull request.
If you need this pull request to be removed from the queue, please contact a The following options are set: approve |
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue BB-419. Goodbye jonathan-gramain. |
Replaces #2421
increase default notification BackbeatConsumer concurrency
Notification QueueProcessor was limited by a concurrency of 10, which meant it could only wait for 10 delivery reports from the producer before consuming more entries.
Increased the default concurrency to 1000 to improve throughput and add a test to show that it behaves well with this number of pending reports (the processing does not involve anything else asynchronous than waiting for delivery reports), as well as a few other extra tests.
Also fix and improve logging related to processing errors and error reporting from delivery reports.
[cleanup] BackbeatProducer.pollIntervalMs default as constant
Use a code constant for
pollIntervalMs
, and add a JSDoc about it (andmessageMaxBytes
)[impr] configurable notif Kafka poll interval
Make the external Kafka producer poll interval configurable: while the default is 2000ms, it could be helpful to reduce its value, e.g. to reduce latency of delivery in case the external Kafka cluster cannot receive all notifications in time.
It's not clear at this point what would be a better value due to lack of testing to the limits, and 2000ms doesn't look unreasonable as a trade-off between latency and polling overhead, so leaving the default value as it is. It is however important to have a concurrency value high enough to not limit the possible throughput per notification processor, which is limited by "concurrency / poll_interval_seconds" messages per second. The concurrency has been raised to 1000 by default which therefore allows 500 messages per second to go through per processor with a 2000ms poll interval.