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

Measure size of current ledger with respect to claimable balances #3972

Closed
ire-and-curses opened this issue Sep 29, 2021 · 7 comments · Fixed by #4015
Closed

Measure size of current ledger with respect to claimable balances #3972

ire-and-curses opened this issue Sep 29, 2021 · 7 comments · Fixed by #4015
Assignees
Labels

Comments

@ire-and-curses
Copy link
Member

We need an estimate of the current ledger state:

  • Size (in GB)
  • Number of ledger entries
  • Breakdown of ledger entries by type

We want to know the current memory requirements for captive core, and how much headroom we have if ledger size continues to increase.

@bartekn
Copy link
Contributor

bartekn commented Oct 4, 2021

Would be great to have metrics on this in /metrics (ex. we can get latest number of ledger entries via state verifier so that no new code is needed).

@bartekn
Copy link
Contributor

bartekn commented Oct 21, 2021

OK, number of ledger entries is now tracked by metric in #4015. Moving this back to Current Sprint to continue working on size of DB.

@bartekn
Copy link
Contributor

bartekn commented Nov 4, 2021

I was confused: this is not related to Postbgres DB size but RAM size. This can be hard to do. If we want to get memory usage of Stellar-Core we'd need to execute system command and I don't think a breakdown per ledger entry is possible without Stellar-Core help (like exposing metrics).

@jcx120
Copy link

jcx120 commented Nov 9, 2021

Let's start with DB disk size per ledger so we can reliably extrapolate growth of storage needs.

@ire-and-curses
Copy link
Member Author

ire-and-curses commented Nov 10, 2021

I'm confused by this @bartekn.

It seems to me that
i) we know the current total RAM usage of captive core
ii) we know almost all of that RAM is holding current state
iii) we are ingesting this data so we must know what the breakdown of ledger entries is on the Horizon side

So why can't we answer this question? If (for example) RAM is 10GB and 3/4 of the ledger entries are claimable balances, then claimable balances are responsible for 7.5GB. What am I missing?

@bartekn
Copy link
Contributor

bartekn commented Nov 11, 2021

i) we know the current total RAM usage of captive core

We can't access this data from Go code directly (maybe using exec on a system command is a solution but I'm not sure - this is system dependent).

ii) we know almost all of that RAM is holding current state

Probably but there's also Overlay and some other components. I can agree that it's probably 90%+ but I don't know if it's 90% or 99%.

iii) we are ingesting this data so we must know what the breakdown of ledger entries is on the Horizon side
If (for example) RAM is 10GB and 3/4 of the ledger entries are claimable balances, then claimable balances are responsible for 7.5GB. What am I missing?

The problem here is the ledger entries are not equal in size. A data entry can be much smaller that claimable balance with a bunch of claimants. If the estimated values are OK then we can probably calculate it this way but we still don't have access to RAM usage of CC from Horizon code (see: i)).

@bartekn
Copy link
Contributor

bartekn commented Feb 2, 2022

Closing because better memory analysis requires exposing more metrics in Stellar-Core. However, given we probably need to move CC to disk such metric is probably no longer needed.

@bartekn bartekn closed this as completed Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants