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

wtclient: improve startup performance #8221

Closed
2 tasks done
ellemouton opened this issue Nov 23, 2023 · 1 comment · Fixed by #8222 or #8239
Closed
2 tasks done

wtclient: improve startup performance #8221

ellemouton opened this issue Nov 23, 2023 · 1 comment · Fixed by #8222 or #8239
Assignees
Labels
P1 MUST be fixed or reviewed performance watchtower
Milestone

Comments

@ellemouton
Copy link
Collaborator

ellemouton commented Nov 23, 2023

From this discussion and the various profile dumps
shared there, it is clear that if a node has many tower client sessions, then start-up of the tower client, and hence
LND, can be very slow.

The issue:

After some investigation, it is clear that the current way the tower client starts is super sub-optimal as it does
the following on each startup (and for each client):

  • the client keeps an in-mem map of map[channelID] max-commit-height. This map represents the maximum commitment height of a backup for a channel that the client has received. It uses this map in various places.
  • the issue is the population of this map (which is done at startup) : it will currently range over every session (which could be in the ten thousands) and for every session, it goes through each of its range indices to get the max height per channel backed up with the session.

The solution(s):

@ellemouton
Copy link
Collaborator Author

re-opening cause there a second step that hasnt been addressed yet :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment