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

How to handle large number of .ldb files #1365

Closed
ErickKramer opened this issue Oct 7, 2024 · 4 comments
Closed

How to handle large number of .ldb files #1365

ErickKramer opened this issue Oct 7, 2024 · 4 comments
Labels
please confirm resolved We believe the issue is resolved ! if so, please close the issue, thanks ;-) quesiton

Comments

@ErickKramer
Copy link

Detailed Description

Hi, I have been searching for how to handle/clean old .ldb files stored in the db/ directory but could not find any information about it.

Running aptly db cleanup does not seem to affect this.

I tried simply removing the oldest .ldb file I had and that "broke" the database until I ran aptly db recover.

Are there any best practices or recommendations on how to limit them?

Context

LevelDB files

Your Environment

Debian Bookworm

@neolynx
Copy link
Member

neolynx commented Oct 9, 2024

How many lcd files are you seeing ?

I don't think there are 'old" lbd files, as the db is incremental. A aptly db cleanup should compact the goleveldb, and all the files are internal to goleveldb.

what aptly version are you runnning ?

@ErickKramer
Copy link
Author

How many lcd files are you seeing ?

I don't think there are 'old" lbd files, as the db is incremental. A aptly db cleanup should compact the goleveldb, and all the files are internal to goleveldb.

what aptly version are you runnning ?

Thank you for the reply. I just checked and running aptly db cleanup does indeed decreased the number .ldb files, but just slightly.

I tested using a playground aptly setup I am testing using aptly version: 1.6.0~beta1+20240924144106.96e60ae5 and the files went from 579 to 509.

I would expect the same behavior on the stable aptly setup we have using aptly version 1.5.0. We run aptly db cleanup once a month in there.

So from what you mentioned in regards to the db being incremental, the more packages are tracked by aptly, the larger the number of .ldb files there will be. Is that correct?

@neolynx
Copy link
Member

neolynx commented Oct 10, 2024

thanks for the explanations.

yes, this is the way leveldb is designed, if there are no performance/inconsistency problems, there should not be any problem with many lbd files.

aptly usess a newer version of goleveldb in the ci builds, I assume it optimized the db compaction and therefore is able to reduce the number of ldb file further.

@neolynx neolynx added the please confirm resolved We believe the issue is resolved ! if so, please close the issue, thanks ;-) label Oct 10, 2024
@ErickKramer
Copy link
Author

Thank you for explaining how it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please confirm resolved We believe the issue is resolved ! if so, please close the issue, thanks ;-) quesiton
Projects
None yet
Development

No branches or pull requests

2 participants