-
Notifications
You must be signed in to change notification settings - Fork 508
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
[Bug]: 'Recent Series' on home taking 25s to load #3237
Comments
I'm not very familiar with SQL or database queries, but from initial research, it looks like the slowdown for "Recent Series" and "Newest Authors" are both related to needing to verify the author and series have books after removing any permissions (from access control from limiting by tag or whether the item is explicit). Your logs show you as the root user which has access to all library items, so The authors query is simpler than the series query, so putting that here for reference. Maybe we can try adding the (customized shelves related to #1241) |
Well, I just tried that change locally, and turns out the |
For others having the same issue: Since it's hard for me to understand all the code and queries, i opted to comment every line inside those methods and return an empty array, which disables the section in the 'Home' tab.
This cleanly disables both queries and makes everything load in under 2 seconds. |
Fixed in v2.16.0. |
If you update to v2.16.0 I'm curious how much the performance improves |
Sry just gave up on having 100k+ books and started a new library with just 2k, so can't monitor the performance for now. But thanks for the fix! Will try in the future. |
I can't say I see a noticeable improvement, but the time is still beyond the "stare at it while it loads" threshold, so there could I just updated to v2.16.2, but the following log is from v2.16.0.
Once those queries are cached, loading the android app takes about 3s, but the cache lasts for 30m, and I rarely load the app more often than that while listening to audiobooks. If desirable, I could go look for older logs to compare, but I don't remember when I enabled debug logging, so there may not be too much data to find. |
Would you be willing to share your database? I'm curious why the "Continue Listening/Reading" query is 30 seconds long. That seems excessive, especially for only having 170 items in the library. |
@nichwall I'd rather not dump the whole database, but I can run some queries for you, if you give me some pointers? |
If you set the environment variable Edit to add: it may be helpful to open a new issue with the log file to help keep things distinct between different endpoints |
I've enabled query logging. I'll create a new issue with the verbose logs if and when I next encounter it. |
Sounds like a plan. Are you seeing something like "Ran query in X Ms" in the logs? You will need to switch the log level to Debug in the server settings as well (not an environment variable) |
Yep, the appropriate logs are active. I wouldn't expect relatively simple queries such as this one to take quite this long, but I suppose my NAS is more over-worked than I thought, especially with backups and other IO heavy tasks running right now. That wouldn't explain 30s+ response times from a query tho, I think.
|
What happened?
Everytime i open or switch between libraries, the home page takes too long to load. I've read another topics addressing similar issues but not this one. I had a 100k book library (epub, mobi, pdf,...) which i split in 20k libraries. Changing between libraries also triggers this.
Problem occurs accessing the server through last Android app release, Chrome and Chrome for Android.
If i change libraries while inside 'Library' tab, it takes 4 seconds, which is okay.
Tested on docker versions 'edge' and 'v2.12.0'
What did you expect to happen?
To load faster, every other home item loads in less than 2 seconds. Or to optionally disable 'recent series' item.
Steps to reproduce the issue
Audiobookshelf version
v2.12.0
How are you running audiobookshelf?
Docker
What OS is your Audiobookshelf server hosted from?
Linux
If the issue is being seen in the UI, what browsers are you seeing the problem on?
Chrome
Logs
Additional Notes
Tried splitting the 100k book library in 20k smaller libraries, thinking 100k books were too many. Also tried android app and searching previous performance issues already solved.
The text was updated successfully, but these errors were encountered: