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

Performance issues /v2/byron-wallets/{walletId}/addresses API #1713

Closed
ntfreem opened this issue Jun 2, 2020 · 4 comments
Closed

Performance issues /v2/byron-wallets/{walletId}/addresses API #1713

ntfreem opened this issue Jun 2, 2020 · 4 comments

Comments

@ntfreem
Copy link

ntfreem commented Jun 2, 2020

Account functionality has been removed in cardano-wallet, as a result when we return a list of addresses from the cardano-wallet, we see performance issues.

Previously we use the following API from cardano-sl to return only a list of addresses in a specific account:

https://docs.cardano.org/technical/wallet/api/v1/#tag/Accounts%2Fpaths%2F~1api~1v1~1wallets~1%7BwalletId%7D~1accounts~1%7BaccountId%7D~1addresses%2Fget

Now when we run

curl http://localhost:8090/v2/byron-wallets/9450c1d184dc0f8f9a27d8ddf3f69b3b1633e44d/addresses

the response returns all 50,000 addresses which can take up to 90 seconds

We expect that number of addresses to grow overtime so 90 seconds is not a good baseline

@yupasik
Copy link

yupasik commented Jun 10, 2020

Most requests do not pass at all
>>> r = requests.get('{url}/v2/byron-wallets/{wallet_id}/addresses'.format(url=wallet_url, wallet_id=wallet_id)) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/dist-packages/requests/api.py", line 67, in get return request('get', url, params=params, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 53, in request return session.request(method=method, url=url, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 480, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 620, in send r.content File "/usr/lib/python2.7/dist-packages/requests/models.py", line 737, in content self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes() File "/usr/lib/python2.7/dist-packages/requests/models.py", line 663, in generate raise ChunkedEncodingError(e) requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(4335 bytes read, 5905 more expected)', IncompleteRead(4335 bytes read, 5905 more expected))

@KtorZ
Copy link
Member

KtorZ commented Jun 10, 2020

As a first mitigation, what about increasing the default timeout on your http client ?

@inkbx
Copy link

inkbx commented Jun 11, 2020

same problem.

the api may be need paginate for working.

@piotr-iohk
Copy link
Contributor

This should no longer be the issue after recent improvements -> #1903 (comment).

Importing 130k addresses => ~7s.
Listing 130k addresses => ~3s.

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

No branches or pull requests

5 participants