Corda 5 Developer Preview 2 is now available.

Backpressure mechanism overview

What is the backpressure mechanism?

The backpressure mechanism is a method to ensure that the notary is at no point overwhelmed with information and requests. An overwhelmed notary is more likely to suffer a detriment to performance. To avoid this, Corda uses a simple backpressure mechanism that is applicable to notaries and nodes above a minimum platform version of 4. Using a configured retry threshold, we compare the measured throughput and determine if the request is going to require more than that. If so, we respond with a backpressure message.

How is the retry time calculated?

By inspecting the number of states in the request queue and comparing that to the throughput (measured in states per minute), the number of seconds until a new request can be processed is calculated.

Why is there a backpressure mechanism?

Like any other form of backpressure, this mechanism prevents the queuing of redundant requests which occurs when a request is retried before the expected handling time for the original. Queuing additional redundant requests creates unnecessary work for the notary service, and uses up processing resources. These resources could otherwise be used for new requests. Retrying requests too eagerly prevents the notary from running at peak throughput.

What happens if I just invoke FinalityFlow again after getting told to wait?

If a Corda node is told to wait, its state machine will handle the wait. Nothing will be visible to the CorDapp. Even if a client runs a modified Corda node, they will experience a cut-off by the backpressure once again and hardly see any benefit. While the retry time acts more as an estimate than an accurate timeframe, it is a close approximation of response time. The backpressure mechanism is in place to maximize the throughput of the notary service - assuming clients wait before retrying their requests, as intended.

How can I configure backpressure threshold?

In the notary config - notaryConfig.etaMessageThresholdSeconds.

Was this page helpful?

Thanks for your feedback!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.

We're sorry this page wasn't helpful. Let us know how we can make it better!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Create an issue

Create a new GitHub issue in this repository - submit technical feedback, draw attention to a potential documentation bug, or share ideas for improvement and general feedback.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.