openwallet-foundation / credo-ts

Typescript framework for building decentralized identity and verifiable credential solutions
https://credo.js.org
Apache License 2.0
275 stars 202 forks source link

Askar unusably slow for mediator #1621

Closed ericvergnaud closed 1 year ago

ericvergnaud commented 1 year ago

The doc says that IndySDK support will be removed soon, but Askar is currently unusably slow for mediator.

This is evidenced by doing the following:

Run the sample mediator using indy:

Now run a similar mediator, simply using using askar in lieu of indy:

The above is a simple way to highlight the issue. We rolled out a mediator using askar in AWS and although we were able to get an invitation, any attempt to go further would trigger timeouts from the infrastructure. Switching back to Indy was the only way to solve the issue.

mediator.ts.zip

swcurran commented 1 year ago

FYI — when we switched to Askar we got a significant boost in performance, and other benchmarks have shown Askar to be much faster and more stable than the IndySDK — especially under load.

Thanks for the easy reproduction instructions — we’ll have to take a look at this. It is curious...

swcurran commented 1 year ago

Note that we were using an ACA-Py-based mediator, so we’re not comparing apples to apples in my note.

ericvergnaud commented 1 year ago

We're using Askar on mobile side without issue. The above is a js mediator running in Node...

genaris commented 1 year ago

This is related to a known performance issue in ref-napi, which needs to be patched. This week we've updated shared components (among which we have aries-askar) which use the patched version and should work fine.

As a result, we now require at least node 18, and for that reason I've created #1622 to update Dockerfile accordingly (and also sample mediator to use Askar instead of Indy SDK).

It would be great if you can re-check from that branch or wait a bit until it is merged to main.