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

Increase sqlite calibre metadata.db cache #3200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

webysther
Copy link
Contributor

@webysther webysther commented Oct 23, 2024

Increase from the default 2000 pages or 8MB of RAM to 10k pages or up to 40MB of memory, in a library with 15k books this reduce the initial load page from ~500ms to ~400ms, no further increase improved performance if the valu is bigger for a metadata.db of 28MB. Maybe in future consider convert this to ENV VAR or a feature flag to allow create one page by item in metadata.db.

ref.: https://www.sqlite.org/pragma.html

PS:

I tested changes on page size and another pragma with no better result, looks like if the total pages is bigger than the total size of metadata.db he will reside entirely on memory (40MB > 28MB). For libraries with size reduced the memory consumption don't change, only in the case the metadata.db is bigger than 8MB. Another way is change to use kibibytes when change this to use ENV VAR to allow user choose the better memory vs performance ratio.

@webysther webysther changed the title Increase sqlite calibre cache Increase sqlite calibre metadata.db cache Oct 23, 2024
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 this pull request may close these issues.

1 participant