Skip to content
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

Askar unusably slow for mediator #1621

Closed
ericvergnaud opened this issue Oct 31, 2023 · 4 comments · Fixed by #1622
Closed

Askar unusably slow for mediator #1621

ericvergnaud opened this issue Oct 31, 2023 · 4 comments · Fixed by #1622

Comments

@ericvergnaud
Copy link
Contributor

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:

  • clone the repo
  • run docker build -t aries-framework-javascript .
  • run docker compose -f docker/docker-compose-mediators up
  • run curl "http://localhost:3001/invitation?", it returns in milliseconds

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

  • in samples folder, replace mediator.ts with attached file
  • run docker build -t aries-framework-javascript .
  • run docker compose -f docker/docker-compose-mediators up
  • run curl "http://localhost:3001/invitation?", it returns in several seconds instead of milliseconds

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
Copy link
Contributor

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
Copy link
Contributor

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

@ericvergnaud
Copy link
Contributor Author

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

@genaris
Copy link
Contributor

genaris commented Oct 31, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants