Skip to content

Implement bulk write of activations in the Invoker.#2812

Merged
rabbah merged 2 commits intoapache:masterfrom
markusthoemmes:bulk
Oct 17, 2017
Merged

Implement bulk write of activations in the Invoker.#2812
rabbah merged 2 commits intoapache:masterfrom
markusthoemmes:bulk

Conversation

@markusthoemmes
Copy link
Contributor

Writing activations in the Invoker is not time critical and can be greatly optimized by batching the activations to reduce the number of connections used towards the database. That enables a lot of optimizations on the database side and is in general a good practice.

Signed-off-by: Christian Bickel cbickel@de.ibm.com

@markusthoemmes markusthoemmes added performance review Review for this PR has been requested and yet needs to be done. labels Sep 28, 2017
@ningyougang
Copy link
Contributor

If use original deal method, with mutliple action request, the invoker's controller<n>_logs.log exist below error

[PUT] 'lambda-exp_activations' internal error, failure: 'DB request queue is full.' [marker:database_saveDocument_error:12941:22]

So i am very expected that this pr can be merged to improve the invoker/couchdb performance.

@rabbah
Copy link
Member

rabbah commented Sep 30, 2017

Should consider applying to sequence activations written in the controller as well. Did you consider batching inside put instead?

@markusthoemmes
Copy link
Contributor Author

We did indeed. The first version of this PR included a latency penalty in the batching, which is why we started implementation in the invoker, where the penalty doesn't matter as much.

We're currently investigating an even deeper integration in the CouchDB client itself. If that doesn't work out, we'd "just" bring the put based implementation.

Want to wait for that and put it in this PR or are you fine with a second one improving on this?

Writing activations in the Invoker is not time critical and can be greatly optimized by batching the activations to reduce the number of connections used towards the database. That enables a lot of optimizations on the database side and is in general a good practice.

Signed-off-by: Christian Bickel <cbickel@de.ibm.com>
@markusthoemmes markusthoemmes force-pushed the bulk branch 2 times, most recently from d654ba5 to e474d16 Compare October 3, 2017 14:45
@markusthoemmes
Copy link
Contributor Author

PG3 1156 🔵

@markusthoemmes markusthoemmes added the pgapproved Pipeline has approved this change. label Oct 4, 2017
@@ -147,4 +148,6 @@ protected[core] object DocInfo {
*/
@throws[IllegalArgumentException]
protected[core] def !(id: String, rev: String): DocInfo = DocInfo(DocId(id), DocRevision(rev))
Copy link
Member

Choose a reason for hiding this comment

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

Still need !?

ec: ExecutionContext) {

private val stream = Source
.actorRef[(T, Promise[R])](Int.MaxValue, OverflowStrategy.dropNew)
Copy link
Member

Choose a reason for hiding this comment

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

we should perhaps open an issue to refactor the relevant code so that we can backpressure the invoker feed when the activations can't be drained fast enough.

@rabbah rabbah merged commit 1110c34 into apache:master Oct 17, 2017
houshengbo pushed a commit to houshengbo/openwhisk that referenced this pull request Oct 18, 2017
Writing activations in the Invoker is not time critical and can be greatly optimized by batching the activations to reduce the number of connections used towards the database. That enables a lot of optimizations on the database side and is in general a good practice.

Signed-off-by: Christian Bickel <cbickel@de.ibm.com>
houshengbo pushed a commit to houshengbo/openwhisk that referenced this pull request Nov 13, 2017
Writing activations in the Invoker is not time critical and can be greatly optimized by batching the activations to reduce the number of connections used towards the database. That enables a lot of optimizations on the database side and is in general a good practice.

Signed-off-by: Christian Bickel <cbickel@de.ibm.com>
houshengbo pushed a commit to houshengbo/openwhisk that referenced this pull request Nov 13, 2017
Writing activations in the Invoker is not time critical and can be greatly optimized by batching the activations to reduce the number of connections used towards the database. That enables a lot of optimizations on the database side and is in general a good practice.

Signed-off-by: Christian Bickel <cbickel@de.ibm.com>
houshengbo pushed a commit to houshengbo/openwhisk that referenced this pull request Nov 14, 2017
Writing activations in the Invoker is not time critical and can be greatly optimized by batching the activations to reduce the number of connections used towards the database. That enables a lot of optimizations on the database side and is in general a good practice.

Signed-off-by: Christian Bickel <cbickel@de.ibm.com>
@markusthoemmes markusthoemmes deleted the bulk branch February 11, 2018 10:41
BillZong pushed a commit to BillZong/openwhisk that referenced this pull request Nov 18, 2019
Writing activations in the Invoker is not time critical and can be greatly optimized by batching the activations to reduce the number of connections used towards the database. That enables a lot of optimizations on the database side and is in general a good practice.

Signed-off-by: Christian Bickel <cbickel@de.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance pgapproved Pipeline has approved this change. review Review for this PR has been requested and yet needs to be done.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants