[Bug]: Loading items a lot slower than pre-2.4.0 versions #1364

Closed
opened 2026-04-24 23:41:10 +02:00 by adam · 115 comments
Owner

Originally created by @ScuttleSE on GitHub (Sep 10, 2023).

Describe the issue

When loading for example my Library page, the cover art takes several seconds to loads. The nodejs-process on the server seems to spike on CPU-usage.

I did a profile in Chrome, and as is evident, the browser waits for several seconds to get the cover-images from the server.
(pixelated for privacy)

image

Steps to reproduce the issue

  1. Load a library with a bunch of books that has coverart

Audiobookshelf version

2.4.1

How are you running audiobookshelf?

Docker

Originally created by @ScuttleSE on GitHub (Sep 10, 2023). ### Describe the issue When loading for example my Library page, the cover art takes several seconds to loads. The nodejs-process on the server seems to spike on CPU-usage. I did a profile in Chrome, and as is evident, the browser waits for several seconds to get the cover-images from the server. (pixelated for privacy) ![image](https://github.com/advplyr/audiobookshelf/assets/4344284/01ad621a-76cf-41e4-8be3-a53ba2f1e9e0) ### Steps to reproduce the issue 1. Load a library with a bunch of books that has coverart ### Audiobookshelf version 2.4.1 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:41:10 +02:00
adam closed this issue 2026-04-24 23:41:12 +02:00
Author
Owner

@ScuttleSE commented on GitHub (Sep 10, 2023):

Okay, after some more clicking around, this is not just the covers...

After loading my library and then scrolling down about 60% of the list, it took ~140 seconds for the server to load up the book titles and covers.

@ScuttleSE commented on GitHub (Sep 10, 2023): Okay, after some more clicking around, this is not just the covers... After loading my library and then scrolling down about 60% of the list, it took ~140 seconds for the server to load up the book titles and covers.
Author
Owner

@DocDrydenn commented on GitHub (Sep 10, 2023):

Same here.

@DocDrydenn commented on GitHub (Sep 10, 2023): Same here.
Author
Owner

@skyzuma commented on GitHub (Sep 10, 2023):

same here

@skyzuma commented on GitHub (Sep 10, 2023): same here
Author
Owner

@Spinonduality commented on GitHub (Sep 11, 2023):

Same here - also it seems to stop matching after ~95 titles on 2.4.1 - didn't have any issues with matching on 2.4.0

@Spinonduality commented on GitHub (Sep 11, 2023): Same here - also it seems to stop matching after ~95 titles on 2.4.1 - didn't have any issues with matching on 2.4.0
Author
Owner

@stefanop1 commented on GitHub (Sep 11, 2023):

Same here - Also It doesn't follow the rule of not showing a series if it has only one book

@stefanop1 commented on GitHub (Sep 11, 2023): Same here - Also It doesn't follow the rule of not showing a series if it has only one book
Author
Owner

@barelylit commented on GitHub (Sep 12, 2023):

Massive slow down on this latest version for me too

@barelylit commented on GitHub (Sep 12, 2023): Massive slow down on this latest version for me too
Author
Owner

@nichwall commented on GitHub (Sep 12, 2023):

The reason the server is so much slower now is due to the entire database no longer being loaded into memory and is being queried to get information. The purpose is to improve performance on large libraries (especially if the database is larger than the available memory), but the queries need to be optimized. Advplyr has already improved the performance of some queries, but is taking some time to work on the apps so it'll be a bit before the next release.

It is safe to roll back to 2.3.3 without any additional steps to wait for 2.4.2 2.4.3 2.4.4 a future release if this makes things unusable.
It is always a good idea to make a backup just in case.

@nichwall commented on GitHub (Sep 12, 2023): The reason the server is so much slower now is due to the entire database no longer being loaded into memory and is being queried to get information. The purpose is to improve performance on large libraries (especially if the database is larger than the available memory), but the queries need to be optimized. Advplyr has already improved the performance of some queries, but is taking some time to work on the apps so it'll be a bit before the next release. It is safe to roll back to 2.3.3 without any additional steps to wait for ~~2.4.2~~ ~~2.4.3~~ ~~2.4.4~~ a future release if this makes things unusable. It is always a good idea to make a backup just in case.
Author
Owner

@Hallo951 commented on GitHub (Sep 14, 2023):

Is the problem solved with version 2.4.2?

@Hallo951 commented on GitHub (Sep 14, 2023): Is the problem solved with version 2.4.2?
Author
Owner

@nichwall commented on GitHub (Sep 14, 2023):

Is the problem solved with version 2.4.2?

No, 2.4.2 ended up being some quick bug fixes that were causing crashes. The performance issues still need to be addressed.

@nichwall commented on GitHub (Sep 14, 2023): > Is the problem solved with version 2.4.2? No, 2.4.2 ended up being some quick bug fixes that were causing crashes. The performance issues still need to be addressed.
Author
Owner

@BlackHoleFox commented on GitHub (Sep 18, 2023):

For whatever its worth as a +1, I am also running into severe slowdowns related to loading cover images. A hard refresh of the library page takes ~40 seconds to finish loading on my local network due to slowdowns. As shown in these Firefox network request logs, each cover image is taking over 30 seconds to finish. Everything else is done long before:

slow

If I take one of these image URLs and load it on my own, it takes 800ms-1s to load, which is still pretty bad considering that these are just being streamed off disk (in all of my testing, the cover metadata cache is already fully populated). Given that it only gets slower when multiple are requested at once (1s -> 30s), maybe there's a contention bug somewhere?

The reason the server is so much slower now is due to the entire database no longer being loaded into memory and is being queried to get information.

This is definitely not the case for cover images at least. The files aren't stored in the database and the load times are too slow to just be a "read DB from disk" issue.

@BlackHoleFox commented on GitHub (Sep 18, 2023): For whatever its worth as a +1, I am also running into severe slowdowns related to loading cover images. A hard refresh of the library page takes ~40 seconds to finish loading on my local network due to slowdowns. As shown in these Firefox network request logs, each cover image is taking over 30 seconds to finish. Everything else is done long before: <img width="209" alt="slow" src="https://github.com/advplyr/audiobookshelf/assets/20936452/9c1ebdef-3f52-43d3-94c8-cde01777c3d6"> If I take one of these image URLs and load it on my own, it takes 800ms-1s to load, which is still pretty bad considering that these are just being streamed off disk (in all of my testing, the cover metadata cache is already fully populated). Given that it only gets slower when multiple are requested at once (1s -> 30s), maybe there's a contention bug somewhere? > The reason the server is so much slower now is due to the entire database no longer being loaded into memory and is being queried to get information. This is definitely not the case for cover images at least. The files aren't stored in the database and the load times are too slow to just be a "read DB from disk" issue.
Author
Owner

@nichwall commented on GitHub (Sep 18, 2023):

If I take one of these image URLs and load it on my own, it takes 800ms-1s to load, which is still pretty bad considering that these are just being streamed off disk (in all of my testing, the cover metadata cache is already fully populated). Given that it only gets slower when multiple are requested at once (1s -> 30s), maybe there's a contention bug somewhere?

What URL are you using to load it directly? Mine includes a call to the API (and the corresponding library item with a token), so to me it makes sense that the queries being slow within the API are also slow to load the cover images. Granted I deal more with hardware than internet stuff, so I could be misunderstanding the route the data is taking.

@nichwall commented on GitHub (Sep 18, 2023): > If I take one of these image URLs and load it on my own, it takes 800ms-1s to load, which is still pretty bad considering that these are just being streamed off disk (in all of my testing, the cover metadata cache is already fully populated). Given that it only gets slower when multiple are requested at once (1s -> 30s), maybe there's a contention bug somewhere? > What URL are you using to load it directly? Mine includes a call to the API (and the corresponding library item with a token), so to me it makes sense that the queries being slow within the API are also slow to load the cover images. Granted I deal more with hardware than internet stuff, so I could be misunderstanding the route the data is taking.
Author
Owner

@haptiqblack commented on GitHub (Sep 18, 2023):

Just notifying I am still seeing the cover art load slowly after update 2.4.3. Doesn't appear to have changed things for my instance.

@haptiqblack commented on GitHub (Sep 18, 2023): Just notifying I am still seeing the cover art load slowly after update 2.4.3. Doesn't appear to have changed things for my instance.
Author
Owner

@nichwall commented on GitHub (Sep 18, 2023):

Just notifying I am still seeing the cover art load slowly after update 2.4.3. Doesn't appear to have changed things for my instance.

The last few patches have mostly been crash fixes, so the performance has not been fully addressed yet. The performance fixes will be major enough that they will be called out in the release notes, and I (or somebody else) will comment here as well.

Thanks for your patience. You can always revert to 2.3.3 if you want to wait for the performance fixes in a future release.

@nichwall commented on GitHub (Sep 18, 2023): > Just notifying I am still seeing the cover art load slowly after update 2.4.3. Doesn't appear to have changed things for my instance. The last few patches have mostly been crash fixes, so the performance has not been fully addressed yet. The performance fixes will be major enough that they will be called out in the release notes, and I (or somebody else) will comment here as well. Thanks for your patience. You can always revert to 2.3.3 if you want to wait for the performance fixes in a future release.
Author
Owner

@haptiqblack commented on GitHub (Sep 18, 2023):

Just notifying I am still seeing the cover art load slowly after update 2.4.3. Doesn't appear to have changed things for my instance.

The last few patches have mostly been crash fixes, so the performance has not been fully addressed yet. The performance fixes will be major enough that they will be called out in the release notes, and I (or somebody else) will comment here as well.

Thanks for your patience. You can always revert to 2.3.3 if you want to wait for the performance fixes in a future release.

No worries appreciate the info!

@haptiqblack commented on GitHub (Sep 18, 2023): > > Just notifying I am still seeing the cover art load slowly after update 2.4.3. Doesn't appear to have changed things for my instance. > > The last few patches have mostly been crash fixes, so the performance has not been fully addressed yet. The performance fixes will be major enough that they will be called out in the release notes, and I (or somebody else) will comment here as well. > > Thanks for your patience. You can always revert to 2.3.3 if you want to wait for the performance fixes in a future release. No worries appreciate the info!
Author
Owner

@selfhost-alt commented on GitHub (Sep 19, 2023):

I did some simple investigation into this, and I found that all of the library item routes (including the one for fetching the cover) use this middleware, which calls LibraryItem.getOldById which runs this slow query: https://github.com/advplyr/audiobookshelf/blob/604f52762b14e5f64eedb56c136a8211be36cb2c/server/models/LibraryItem.js#L422-L454

That query ends up doing some nested queries to look up authors and book series, which at least for me seems to be a major contributor to the slowness of the query.

SELECT `libraryItem`.`id`, `libraryItem`.`ino`, `libraryItem`.`path`, `libraryItem`.`relPath`, ...
FROM `libraryItems` AS `libraryItem`

LEFT OUTER JOIN `books` AS `book` ON `libraryItem`.`mediaId` = `book`.`id`

LEFT OUTER JOIN (
  `bookAuthors` AS `book->authors->bookAuthor`
  INNER JOIN `authors` AS `book->authors`
  ON `book->authors`.`id` = `book->authors->bookAuthor`.`authorId`
) ON `book`.`id` = `book->authors->bookAuthor`.`bookId`

LEFT OUTER JOIN (
  `bookSeries` AS `book->series->bookSeries`
  INNER JOIN `series` AS `book->series`
  ON `book->series`.`id` = `book->series->bookSeries`.`seriesId`
) ON `book`.`id` = `book->series->bookSeries`.`bookId`

LEFT OUTER JOIN `podcasts` AS `podcast` ON `libraryItem`.`mediaId` = `podcast`.`id`

LEFT OUTER JOIN `podcastEpisodes` AS `podcast->podcastEpisodes` ON `podcast`.`id` = `podcast->podcastEpisodes`.`podcastId`

WHERE `libraryItem`.`id` = '8b9c8cb6-7900-46a2-9c75-7f74f0d298ba'
ORDER BY `book->authors->bookAuthor`.`createdAt` ASC, `book->series->bookSeries`.`createdAt` ASC;

When I run explain query plan I get the following:

id parent notused detail
3 0 0 MATERIALIZE 1
8 3 0 SCAN TABLE bookAuthors AS book->authors->bookAuthor
10 3 0 SEARCH TABLE authors AS book->authors USING INDEX sqlite_autoindex_authors_1 (id=?)
38 0 0 MATERIALIZE 2
43 38 0 SCAN TABLE bookSeries AS book->series->bookSeries
45 38 0 SEARCH TABLE series AS book->series USING INDEX sqlite_autoindex_series_1 (id=?)
78 0 0 SEARCH TABLE libraryItems AS libraryItem USING INDEX sqlite_autoindex_libraryItems_1 (id=?)
84 0 0 SEARCH TABLE books AS book USING INDEX sqlite_autoindex_books_1 (id=?)
93 0 0 SCAN SUBQUERY 1
118 0 0 SEARCH SUBQUERY 2 USING AUTOMATIC COVERING INDEX (bookId=?)
126 0 0 SEARCH TABLE podcasts AS podcast USING INDEX sqlite_autoindex_podcasts_1 (id=?)
161 0 0 SEARCH TABLE podcastEpisodes AS podcast->podcastEpisodes USING AUTOMATIC COVERING INDEX (podcastId=?)
299 0 0 USE TEMP B-TREE FOR ORDER BY

I'm not a SQL optimization expert, but I think the unfiltered scans of bookAuthors<->authors and bookSeries<->series are contributing to the query slowness.

@selfhost-alt commented on GitHub (Sep 19, 2023): I did some simple investigation into this, and I found that all of the library item routes (including the one for fetching the cover) use [this middleware](https://github.com/advplyr/audiobookshelf/blob/604f52762b14e5f64eedb56c136a8211be36cb2c/server/controllers/LibraryItemController.js#L719), which calls `LibraryItem.getOldById` which runs this slow query: https://github.com/advplyr/audiobookshelf/blob/604f52762b14e5f64eedb56c136a8211be36cb2c/server/models/LibraryItem.js#L422-L454 That query ends up doing some nested queries to look up authors and book series, which at least for me seems to be a major contributor to the slowness of the query. ```sql SELECT `libraryItem`.`id`, `libraryItem`.`ino`, `libraryItem`.`path`, `libraryItem`.`relPath`, ... FROM `libraryItems` AS `libraryItem` LEFT OUTER JOIN `books` AS `book` ON `libraryItem`.`mediaId` = `book`.`id` LEFT OUTER JOIN ( `bookAuthors` AS `book->authors->bookAuthor` INNER JOIN `authors` AS `book->authors` ON `book->authors`.`id` = `book->authors->bookAuthor`.`authorId` ) ON `book`.`id` = `book->authors->bookAuthor`.`bookId` LEFT OUTER JOIN ( `bookSeries` AS `book->series->bookSeries` INNER JOIN `series` AS `book->series` ON `book->series`.`id` = `book->series->bookSeries`.`seriesId` ) ON `book`.`id` = `book->series->bookSeries`.`bookId` LEFT OUTER JOIN `podcasts` AS `podcast` ON `libraryItem`.`mediaId` = `podcast`.`id` LEFT OUTER JOIN `podcastEpisodes` AS `podcast->podcastEpisodes` ON `podcast`.`id` = `podcast->podcastEpisodes`.`podcastId` WHERE `libraryItem`.`id` = '8b9c8cb6-7900-46a2-9c75-7f74f0d298ba' ORDER BY `book->authors->bookAuthor`.`createdAt` ASC, `book->series->bookSeries`.`createdAt` ASC; ``` When I run `explain query plan` I get the following: |id |parent|notused|detail | |---|------|-------|-----------------------------------------------------------------------------------------------------| |3 |0 |0 |MATERIALIZE 1 | |8 |3 |0 |SCAN TABLE bookAuthors AS book->authors->bookAuthor | |10 |3 |0 |SEARCH TABLE authors AS book->authors USING INDEX sqlite_autoindex_authors_1 (id=?) | |38 |0 |0 |MATERIALIZE 2 | |43 |38 |0 |SCAN TABLE bookSeries AS book->series->bookSeries | |45 |38 |0 |SEARCH TABLE series AS book->series USING INDEX sqlite_autoindex_series_1 (id=?) | |78 |0 |0 |SEARCH TABLE libraryItems AS libraryItem USING INDEX sqlite_autoindex_libraryItems_1 (id=?) | |84 |0 |0 |SEARCH TABLE books AS book USING INDEX sqlite_autoindex_books_1 (id=?) | |93 |0 |0 |SCAN SUBQUERY 1 | |118|0 |0 |SEARCH SUBQUERY 2 USING AUTOMATIC COVERING INDEX (bookId=?) | |126|0 |0 |SEARCH TABLE podcasts AS podcast USING INDEX sqlite_autoindex_podcasts_1 (id=?) | |161|0 |0 |SEARCH TABLE podcastEpisodes AS podcast->podcastEpisodes USING AUTOMATIC COVERING INDEX (podcastId=?)| |299|0 |0 |USE TEMP B-TREE FOR ORDER BY | I'm not a SQL optimization expert, but I think the unfiltered scans of `bookAuthors<->authors` and `bookSeries<->series` are contributing to the query slowness.
Author
Owner

@advplyr commented on GitHub (Sep 22, 2023):

I replaced that API endpoint to get the cover so that it doesn't go through the regular middleware that as @selfhost-alt pointed out is loading unnecessary amounts of data.

When this is built if anyone wants to test on edge docker version we can determine if the covers were the main problem with the performance. I can see it being part of the problem but I think the main issue is the performance of the /libraries/:id/items and the /libraries/:id/personalized endpoints.

@advplyr commented on GitHub (Sep 22, 2023): I replaced that API endpoint to get the cover so that it doesn't go through the regular middleware that as @selfhost-alt pointed out is loading unnecessary amounts of data. When this is built if anyone wants to test on `edge` docker version we can determine if the covers were the main problem with the performance. I can see it being part of the problem but I think the main issue is the performance of the `/libraries/:id/items` and the `/libraries/:id/personalized` endpoints.
Author
Owner

@ScuttleSE commented on GitHub (Sep 22, 2023):

I did a quick test, and loading covers is faster, but there are still issues.
I opened up my library, and the first 10 or so books visible on the page popped up fine, I then scrolled about 2/3 down the list (~1400 books), and it took around 20-30 seconds for the titles of the books to load and then another few seconds of the cover art to load.

This URL for example took 25 seconds to load:
https://site.example.org/api/libraries/dac312d8-6b0e-4b3c-ad6e-8e50a9d8d8b1/items?sort=media.metadata.title&desc=0&limit=100&page=1&minified=1&include=rssfeed,numEpisodesIncomplete

There were 10 of these requests being done almost at the same time, with just the page-value increasing by 1, all of them taking 25-28 seconds to complete. After that there were two batches of coverart loaded. The first one took about 20 seconds, second one took about 5 seconds.

image

@ScuttleSE commented on GitHub (Sep 22, 2023): I did a quick test, and loading covers is faster, but there are still issues. I opened up my library, and the first 10 or so books visible on the page popped up fine, I then scrolled about 2/3 down the list (~1400 books), and it took around 20-30 seconds for the titles of the books to load and then another few seconds of the cover art to load. This URL for example took 25 seconds to load: `https://site.example.org/api/libraries/dac312d8-6b0e-4b3c-ad6e-8e50a9d8d8b1/items?sort=media.metadata.title&desc=0&limit=100&page=1&minified=1&include=rssfeed,numEpisodesIncomplete` There were 10 of these requests being done almost at the same time, with just the page-value increasing by 1, all of them taking 25-28 seconds to complete. After that there were two batches of coverart loaded. The first one took about 20 seconds, second one took about 5 seconds. ![image](https://github.com/advplyr/audiobookshelf/assets/4344284/f109531b-363c-4005-a7a9-028b2e23c06d)
Author
Owner

@advplyr commented on GitHub (Sep 22, 2023):

@ScuttleSE Do you have the server setting ignore prefixes when sorting enabled? Currently that column in the db is not indexed. I was testing with a library of ~2700 books those queries take anywhere from 1 to 5 seconds to complete. When I disabled that server setting the queries were less than a second.

image

For testing I scrolled down the library page sorted by title at a fast speed and watched the server logs with debug logs turned on.

With ignore prefixes when sorting enabled:
I'm only sharing the first half of the requests

[2023-09-22 10:34:26] DEBUG: Loaded 100 of 2680 items for libary page in 2.46s (LibraryItem.js:469)
[2023-09-22 10:34:31] DEBUG: Loaded 100 of 2680 items for libary page in 5.52s (LibraryItem.js:469)
[2023-09-22 10:34:31] DEBUG: Loaded 100 of 2680 items for libary page in 5.57s (LibraryItem.js:469)
[2023-09-22 10:34:32] DEBUG: Loaded 100 of 2680 items for libary page in 3.73s (LibraryItem.js:469)
[2023-09-22 10:34:33] DEBUG: Loaded 100 of 2680 items for libary page in 1.91s (LibraryItem.js:469)
[2023-09-22 10:34:36] DEBUG: Loaded 100 of 2680 items for libary page in 2.56s (LibraryItem.js:469)
[2023-09-22 10:34:36] DEBUG: Loaded 100 of 2680 items for libary page in 2.67s (LibraryItem.js:469)
[2023-09-22 10:34:40] DEBUG: Loaded 100 of 2680 items for libary page in 0.99s (LibraryItem.js:469)
[2023-09-22 10:34:46] DEBUG: Loaded 100 of 2680 items for libary page in 0.78s (LibraryItem.js:469)
[2023-09-22 10:34:52] DEBUG: Loaded 100 of 2680 items for libary page in 1.81s (LibraryItem.js:469)
[2023-09-22 10:34:55] DEBUG: Loaded 100 of 2680 items for libary page in 3.01s (LibraryItem.js:469)
[2023-09-22 10:34:56] DEBUG: Loaded 100 of 2680 items for libary page in 3.01s (LibraryItem.js:469)
[2023-09-22 10:34:58] DEBUG: Loaded 100 of 2680 items for libary page in 3.34s (LibraryItem.js:469)
[2023-09-22 10:34:58] DEBUG: Loaded 100 of 2680 items for libary page in 3.35s (LibraryItem.js:469)
[2023-09-22 10:35:02] DEBUG: Loaded 100 of 2680 items for libary page in 3.23s (LibraryItem.js:469)
[2023-09-22 10:35:02] DEBUG: Loaded 100 of 2680 items for libary page in 3.35s (LibraryItem.js:469)
[2023-09-22 10:35:07] DEBUG: Loaded 100 of 2680 items for libary page in 5.15s (LibraryItem.js:469)
[2023-09-22 10:35:09] DEBUG: Loaded 100 of 2680 items for libary page in 4.64s (LibraryItem.js:469)
[2023-09-22 10:35:09] DEBUG: Loaded 100 of 2680 items for libary page in 6.77s (LibraryItem.js:469)
[2023-09-22 10:35:10] DEBUG: Loaded 100 of 2680 items for libary page in 2.43s (LibraryItem.js:469)

With ignore prefixes when sorting disabled:

[2023-09-22 10:32:05] DEBUG: Loaded 100 of 2680 items for libary page in 0.72s (LibraryItem.js:469)
[2023-09-22 10:32:13] DEBUG: Loaded 100 of 2680 items for libary page in 0.56s (LibraryItem.js:469)
[2023-09-22 10:32:14] DEBUG: Loaded 100 of 2680 items for libary page in 0.72s (LibraryItem.js:469)
[2023-09-22 10:32:15] DEBUG: Loaded 100 of 2680 items for libary page in 0.67s (LibraryItem.js:469)
[2023-09-22 10:32:15] DEBUG: Loaded 100 of 2680 items for libary page in 0.35s (LibraryItem.js:469)
[2023-09-22 10:32:16] DEBUG: Loaded 100 of 2680 items for libary page in 0.72s (LibraryItem.js:469)
[2023-09-22 10:32:16] DEBUG: Loaded 100 of 2680 items for libary page in 0.71s (LibraryItem.js:469)
[2023-09-22 10:32:17] DEBUG: Loaded 100 of 2680 items for libary page in 0.86s (LibraryItem.js:469)
[2023-09-22 10:32:17] DEBUG: Loaded 100 of 2680 items for libary page in 0.40s (LibraryItem.js:469)
[2023-09-22 10:32:18] DEBUG: Loaded 100 of 2680 items for libary page in 0.56s (LibraryItem.js:469)
[2023-09-22 10:32:18] DEBUG: Loaded 100 of 2680 items for libary page in 0.82s (LibraryItem.js:469)
[2023-09-22 10:32:19] DEBUG: Loaded 100 of 2680 items for libary page in 0.64s (LibraryItem.js:469)
[2023-09-22 10:32:20] DEBUG: Loaded 100 of 2680 items for libary page in 0.76s (LibraryItem.js:469)
[2023-09-22 10:32:20] DEBUG: Loaded 100 of 2680 items for libary page in 0.92s (LibraryItem.js:469)
[2023-09-22 10:32:20] DEBUG: Loaded 100 of 2680 items for libary page in 0.87s (LibraryItem.js:469)
[2023-09-22 10:32:21] DEBUG: Loaded 100 of 2680 items for libary page in 0.60s (LibraryItem.js:469)
[2023-09-22 10:32:21] DEBUG: Loaded 100 of 2680 items for libary page in 0.72s (LibraryItem.js:469)
@advplyr commented on GitHub (Sep 22, 2023): @ScuttleSE Do you have the server setting ignore prefixes when sorting enabled? Currently that column in the db is not indexed. I was testing with a library of ~2700 books those queries take anywhere from 1 to 5 seconds to complete. When I disabled that server setting the queries were less than a second. ![image](https://github.com/advplyr/audiobookshelf/assets/67830747/c8d60388-b9e0-407b-9f20-793f0ad80a2e) For testing I scrolled down the library page sorted by title at a fast speed and watched the server logs with debug logs turned on. With ignore prefixes when sorting enabled: I'm only sharing the first half of the requests ``` [2023-09-22 10:34:26] DEBUG: Loaded 100 of 2680 items for libary page in 2.46s (LibraryItem.js:469) [2023-09-22 10:34:31] DEBUG: Loaded 100 of 2680 items for libary page in 5.52s (LibraryItem.js:469) [2023-09-22 10:34:31] DEBUG: Loaded 100 of 2680 items for libary page in 5.57s (LibraryItem.js:469) [2023-09-22 10:34:32] DEBUG: Loaded 100 of 2680 items for libary page in 3.73s (LibraryItem.js:469) [2023-09-22 10:34:33] DEBUG: Loaded 100 of 2680 items for libary page in 1.91s (LibraryItem.js:469) [2023-09-22 10:34:36] DEBUG: Loaded 100 of 2680 items for libary page in 2.56s (LibraryItem.js:469) [2023-09-22 10:34:36] DEBUG: Loaded 100 of 2680 items for libary page in 2.67s (LibraryItem.js:469) [2023-09-22 10:34:40] DEBUG: Loaded 100 of 2680 items for libary page in 0.99s (LibraryItem.js:469) [2023-09-22 10:34:46] DEBUG: Loaded 100 of 2680 items for libary page in 0.78s (LibraryItem.js:469) [2023-09-22 10:34:52] DEBUG: Loaded 100 of 2680 items for libary page in 1.81s (LibraryItem.js:469) [2023-09-22 10:34:55] DEBUG: Loaded 100 of 2680 items for libary page in 3.01s (LibraryItem.js:469) [2023-09-22 10:34:56] DEBUG: Loaded 100 of 2680 items for libary page in 3.01s (LibraryItem.js:469) [2023-09-22 10:34:58] DEBUG: Loaded 100 of 2680 items for libary page in 3.34s (LibraryItem.js:469) [2023-09-22 10:34:58] DEBUG: Loaded 100 of 2680 items for libary page in 3.35s (LibraryItem.js:469) [2023-09-22 10:35:02] DEBUG: Loaded 100 of 2680 items for libary page in 3.23s (LibraryItem.js:469) [2023-09-22 10:35:02] DEBUG: Loaded 100 of 2680 items for libary page in 3.35s (LibraryItem.js:469) [2023-09-22 10:35:07] DEBUG: Loaded 100 of 2680 items for libary page in 5.15s (LibraryItem.js:469) [2023-09-22 10:35:09] DEBUG: Loaded 100 of 2680 items for libary page in 4.64s (LibraryItem.js:469) [2023-09-22 10:35:09] DEBUG: Loaded 100 of 2680 items for libary page in 6.77s (LibraryItem.js:469) [2023-09-22 10:35:10] DEBUG: Loaded 100 of 2680 items for libary page in 2.43s (LibraryItem.js:469) ``` With ignore prefixes when sorting disabled: ``` [2023-09-22 10:32:05] DEBUG: Loaded 100 of 2680 items for libary page in 0.72s (LibraryItem.js:469) [2023-09-22 10:32:13] DEBUG: Loaded 100 of 2680 items for libary page in 0.56s (LibraryItem.js:469) [2023-09-22 10:32:14] DEBUG: Loaded 100 of 2680 items for libary page in 0.72s (LibraryItem.js:469) [2023-09-22 10:32:15] DEBUG: Loaded 100 of 2680 items for libary page in 0.67s (LibraryItem.js:469) [2023-09-22 10:32:15] DEBUG: Loaded 100 of 2680 items for libary page in 0.35s (LibraryItem.js:469) [2023-09-22 10:32:16] DEBUG: Loaded 100 of 2680 items for libary page in 0.72s (LibraryItem.js:469) [2023-09-22 10:32:16] DEBUG: Loaded 100 of 2680 items for libary page in 0.71s (LibraryItem.js:469) [2023-09-22 10:32:17] DEBUG: Loaded 100 of 2680 items for libary page in 0.86s (LibraryItem.js:469) [2023-09-22 10:32:17] DEBUG: Loaded 100 of 2680 items for libary page in 0.40s (LibraryItem.js:469) [2023-09-22 10:32:18] DEBUG: Loaded 100 of 2680 items for libary page in 0.56s (LibraryItem.js:469) [2023-09-22 10:32:18] DEBUG: Loaded 100 of 2680 items for libary page in 0.82s (LibraryItem.js:469) [2023-09-22 10:32:19] DEBUG: Loaded 100 of 2680 items for libary page in 0.64s (LibraryItem.js:469) [2023-09-22 10:32:20] DEBUG: Loaded 100 of 2680 items for libary page in 0.76s (LibraryItem.js:469) [2023-09-22 10:32:20] DEBUG: Loaded 100 of 2680 items for libary page in 0.92s (LibraryItem.js:469) [2023-09-22 10:32:20] DEBUG: Loaded 100 of 2680 items for libary page in 0.87s (LibraryItem.js:469) [2023-09-22 10:32:21] DEBUG: Loaded 100 of 2680 items for libary page in 0.60s (LibraryItem.js:469) [2023-09-22 10:32:21] DEBUG: Loaded 100 of 2680 items for libary page in 0.72s (LibraryItem.js:469) ```
Author
Owner

@ScuttleSE commented on GitHub (Sep 22, 2023):

That does seem to be one of the contributing factors. After I disabled the prefixes-setting, the queries that earlier took 25-30 seconds now took 2-4 seconds.

@ScuttleSE commented on GitHub (Sep 22, 2023): That does seem to be one of the contributing factors. After I disabled the prefixes-setting, the queries that earlier took 25-30 seconds now took 2-4 seconds.
Author
Owner

@ScuttleSE commented on GitHub (Sep 22, 2023):

I do wonder why my system is that much slower though...

[2023-09-22 16:07:57] DEBUG: Loaded 100 of 1450 items for libary page in 0.48s (LibraryItem.js:469)
[2023-09-22 16:08:09] DEBUG: Loaded 100 of 1450 items for libary page in 1.48s (LibraryItem.js:469)
[2023-09-22 16:08:09] DEBUG: Loaded 100 of 1450 items for libary page in 1.61s (LibraryItem.js:469)
[2023-09-22 16:08:09] DEBUG: Loaded 100 of 1450 items for libary page in 1.81s (LibraryItem.js:469)
[2023-09-22 16:08:09] DEBUG: Loaded 100 of 1450 items for libary page in 2.17s (LibraryItem.js:469)
[2023-09-22 16:08:09] DEBUG: Loaded 100 of 1450 items for libary page in 1.61s (LibraryItem.js:469)
[2023-09-22 16:08:10] DEBUG: Loaded 100 of 1450 items for libary page in 2.04s (LibraryItem.js:469)
[2023-09-22 16:08:10] DEBUG: Loaded 100 of 1450 items for libary page in 2.35s (LibraryItem.js:469)
[2023-09-22 16:08:10] DEBUG: Loaded 100 of 1450 items for libary page in 2.58s (LibraryItem.js:469)
[2023-09-22 16:08:10] DEBUG: Loaded 100 of 1450 items for libary page in 2.74s (LibraryItem.js:469)

That is with prefixes disabled
Btw, no idea why my logs says "libary" and yours say "library"...

@ScuttleSE commented on GitHub (Sep 22, 2023): I do wonder why my system is that much slower though... ``` [2023-09-22 16:07:57] DEBUG: Loaded 100 of 1450 items for libary page in 0.48s (LibraryItem.js:469) [2023-09-22 16:08:09] DEBUG: Loaded 100 of 1450 items for libary page in 1.48s (LibraryItem.js:469) [2023-09-22 16:08:09] DEBUG: Loaded 100 of 1450 items for libary page in 1.61s (LibraryItem.js:469) [2023-09-22 16:08:09] DEBUG: Loaded 100 of 1450 items for libary page in 1.81s (LibraryItem.js:469) [2023-09-22 16:08:09] DEBUG: Loaded 100 of 1450 items for libary page in 2.17s (LibraryItem.js:469) [2023-09-22 16:08:09] DEBUG: Loaded 100 of 1450 items for libary page in 1.61s (LibraryItem.js:469) [2023-09-22 16:08:10] DEBUG: Loaded 100 of 1450 items for libary page in 2.04s (LibraryItem.js:469) [2023-09-22 16:08:10] DEBUG: Loaded 100 of 1450 items for libary page in 2.35s (LibraryItem.js:469) [2023-09-22 16:08:10] DEBUG: Loaded 100 of 1450 items for libary page in 2.58s (LibraryItem.js:469) [2023-09-22 16:08:10] DEBUG: Loaded 100 of 1450 items for libary page in 2.74s (LibraryItem.js:469) ``` That is with prefixes disabled Btw, no idea why my logs says "libary" and yours say "library"...
Author
Owner

@advplyr commented on GitHub (Sep 22, 2023):

Thanks for checking. Even the faster queries I showed are slower then they should be.
Here are some things that need to be done to speed things up:

  1. The queries need to be optimized to use indexes properly and reduce the number of subqueries
  2. More data is being loaded then necessary. One example is the audioFiles column in the books table
  3. After the data is loaded from the db it is converted to the old data model (this may take some more time to phase out)
@advplyr commented on GitHub (Sep 22, 2023): Thanks for checking. Even the faster queries I showed are slower then they should be. Here are some things that need to be done to speed things up: 1) The queries need to be optimized to use indexes properly and reduce the number of subqueries 2) More data is being loaded then necessary. One example is the `audioFiles` column in the books table 3) After the data is loaded from the db it is converted to the old data model (this may take some more time to phase out)
Author
Owner

@advplyr commented on GitHub (Sep 30, 2023):

From my testing big improvements should be in v2.4.4

Collapse series on the library page will still be slow to the point where you might want to avoid that on large libraries.
Let me know if you see improvement

@advplyr commented on GitHub (Sep 30, 2023): From my testing big improvements should be in [v2.4.4](https://github.com/advplyr/audiobookshelf/releases/tag/v2.4.4) Collapse series on the library page will still be slow to the point where you might want to avoid that on large libraries. Let me know if you see improvement
Author
Owner

@BlackHoleFox commented on GitHub (Oct 1, 2023):

Updated with my library and saw a night to day improvement. The library screen loads in just a few seconds now instead of 30-70s. Great work so far :)

@BlackHoleFox commented on GitHub (Oct 1, 2023): Updated with my library and saw a night to day improvement. The library screen loads in just a few seconds now instead of 30-70s. Great work so far :)
Author
Owner

@ScuttleSE commented on GitHub (Oct 1, 2023):

Hrm...I must say, I haven't noticed that much of an improvement.

If I open my library and then scroll down about 70%, it takes 30-40 seconds for both the book titles and covers to appear

This link for example took about 39 seconds to load:

https://abs.example.org/api/libraries/dac312d8-6b0e-4b3c-ad6e-8e50a9d8d8b1/items?sort=media.metadata.title&desc=0&limit=100&page=8&minified=1&include=rssfeed,numEpisodesIncomplete

@ScuttleSE commented on GitHub (Oct 1, 2023): Hrm...I must say, I haven't noticed that much of an improvement. If I open my library and then scroll down about 70%, it takes 30-40 seconds for both the book titles and covers to appear This link for example took about 39 seconds to load: `https://abs.example.org/api/libraries/dac312d8-6b0e-4b3c-ad6e-8e50a9d8d8b1/items?sort=media.metadata.title&desc=0&limit=100&page=8&minified=1&include=rssfeed,numEpisodesIncomplete`
Author
Owner

@ScuttleSE commented on GitHub (Oct 1, 2023):

If I disable Prefix-handling, it cuts down from around 30 seconds down to 10 doing the same.

Covers are still pretty slow, 10-12 seconds each

@ScuttleSE commented on GitHub (Oct 1, 2023): If I disable Prefix-handling, it cuts down from around 30 seconds down to 10 doing the same. Covers are still pretty slow, 10-12 seconds each
Author
Owner

@Dragonatorul commented on GitHub (Oct 2, 2023):

I'm seeing a similar issue in podcasts. Disabling or enabling the prefix option does not seem to make any noticeable difference.

The following logs are from switching between home, latest and library tabs.

audiobookshelf    | [2023-10-02 18:16:59] DEBUG: Loaded 4 personalized shelves in 16.56s (LibraryItem.js:667)
audiobookshelf    | [2023-10-02 18:18:42] DEBUG: Loaded 4 personalized shelves in 16.33s (LibraryItem.js:667)
audiobookshelf    | [2023-10-02 18:19:22] DEBUG: Loaded 100 of 131 items for libary page in 13.01s (LibraryItem.js:469)
audiobookshelf    | [2023-10-02 18:20:42] DEBUG: Loaded 4 personalized shelves in 16.93s (LibraryItem.js:667)
audiobookshelf    | [2023-10-02 18:21:06] DEBUG: Loaded 100 of 131 items for libary page in 12.99s (LibraryItem.js:469)
@Dragonatorul commented on GitHub (Oct 2, 2023): I'm seeing a similar issue in podcasts. Disabling or enabling the prefix option does not seem to make any noticeable difference. The following logs are from switching between home, latest and library tabs. ``` audiobookshelf | [2023-10-02 18:16:59] DEBUG: Loaded 4 personalized shelves in 16.56s (LibraryItem.js:667) audiobookshelf | [2023-10-02 18:18:42] DEBUG: Loaded 4 personalized shelves in 16.33s (LibraryItem.js:667) audiobookshelf | [2023-10-02 18:19:22] DEBUG: Loaded 100 of 131 items for libary page in 13.01s (LibraryItem.js:469) audiobookshelf | [2023-10-02 18:20:42] DEBUG: Loaded 4 personalized shelves in 16.93s (LibraryItem.js:667) audiobookshelf | [2023-10-02 18:21:06] DEBUG: Loaded 100 of 131 items for libary page in 12.99s (LibraryItem.js:469) ```
Author
Owner

@kaldigo commented on GitHub (Nov 13, 2023):

I am still having these issues including the slow loading covers. I did test a new install with the same library and it was much faster. Is there any way to migrate the data across without copying the database? Or maybe something that can be done to clean up the old database

@kaldigo commented on GitHub (Nov 13, 2023): I am still having these issues including the slow loading covers. I did test a new install with the same library and it was much faster. Is there any way to migrate the data across without copying the database? Or maybe something that can be done to clean up the old database
Author
Owner

@djolker commented on GitHub (Nov 15, 2023):

I'm experiencing this issue in my Podcasts library but primarily only in relation to individual shows that have a very large number of episodes. When attempting to view all episodes of a show in my library with 1-100 episodes, the load time is near instant to maybe half a second. A show with 800+ episodes will take over 10 seconds to load.

@djolker commented on GitHub (Nov 15, 2023): I'm experiencing this issue in my Podcasts library but primarily only in relation to individual shows that have a very large number of episodes. When attempting to view all episodes of a show in my library with 1-100 episodes, the load time is near instant to maybe half a second. A show with 800+ episodes will take over 10 seconds to load.
Author
Owner

@Eftimin70 commented on GitHub (Nov 18, 2023):

I had the hope that a clean installation of version 2.5.0 and building up a fresh database could speed things up again. Unfortunitly that did't help and it still is very slow compared to 2.3.3. Especially the library view with 'Collapse Series' and series view are barely usable. So I have to stick with 2.3.3. and its quirks.

@Eftimin70 commented on GitHub (Nov 18, 2023): I had the hope that a clean installation of version 2.5.0 and building up a fresh database could speed things up again. Unfortunitly that did't help and it still is very slow compared to 2.3.3. Especially the library view with 'Collapse Series' and series view are barely usable. So I have to stick with 2.3.3. and its quirks.
Author
Owner

@lkiesow commented on GitHub (Nov 19, 2023):

I've started looking into this as well. There seem to be several code paths which are still quite slow. Not unusable, but… annoying.

Loading covers is one of the things which are still quite slow. The following query seems to be the problem (taken when loading “Home”):

-- Ran the following query in 1117ms:
SELECT `libraryItem`.`id`,
       `libraryItem`.`mediatype`,
       `libraryItem`.`mediaid`,
       `libraryItem`.`libraryid`,
       `book`.`id`           AS `book.id`,
       `book`.`coverpath`    AS `book.coverPath`,
       `book`.`tags`         AS `book.tags`,
       `book`.`explicit`     AS `book.explicit`,
       `podcast`.`id`        AS `podcast.id`,
       `podcast`.`coverpath` AS `podcast.coverPath`,
       `podcast`.`tags`      AS `podcast.tags`,
       `podcast`.`explicit`  AS `podcast.explicit`
FROM   `libraryitems` AS `libraryItem`
       LEFT OUTER JOIN `books` AS `book`
                    ON `libraryItem`.`mediaid` = `book`.`id`
       LEFT OUTER JOIN `podcasts` AS `podcast`
                    ON `libraryItem`.`mediaid` = `podcast`.`id`
WHERE  `libraryItem`.`id` = '9217841f-400a-490b-a10f-e4529066c07d';

One problem here could be the mismatching data types of the joined columns (see #2324). I'm not sure about SQLite UUID and UUIDv4, but in general, a data type mismatch can make a join really expensive. After all, the database might need to perform a type conversion on the fly.

That being said, I'm wondering if we need the joins at all. Looking at the data being used, we have libraryId from the table libraryItems and explicit, tags and coverPath from either books or podcasts. This means that all the latter three fields exist in both media type tables. If we move the common columns to the libraryItems table instead, we would need no join at all. That would probably speed up the whole process quite a bit.

If that's not possible for any reason, we could also try splitting up the query and running then as separate queries. This might still cause less data to be searched ovverall and be faster.

@lkiesow commented on GitHub (Nov 19, 2023): I've started looking into this as well. There seem to be several code paths which are still quite slow. Not unusable, but… annoying. Loading covers is one of the things which are still quite slow. The following query seems to be the problem (taken when loading “Home”): ```sql -- Ran the following query in 1117ms: SELECT `libraryItem`.`id`, `libraryItem`.`mediatype`, `libraryItem`.`mediaid`, `libraryItem`.`libraryid`, `book`.`id` AS `book.id`, `book`.`coverpath` AS `book.coverPath`, `book`.`tags` AS `book.tags`, `book`.`explicit` AS `book.explicit`, `podcast`.`id` AS `podcast.id`, `podcast`.`coverpath` AS `podcast.coverPath`, `podcast`.`tags` AS `podcast.tags`, `podcast`.`explicit` AS `podcast.explicit` FROM `libraryitems` AS `libraryItem` LEFT OUTER JOIN `books` AS `book` ON `libraryItem`.`mediaid` = `book`.`id` LEFT OUTER JOIN `podcasts` AS `podcast` ON `libraryItem`.`mediaid` = `podcast`.`id` WHERE `libraryItem`.`id` = '9217841f-400a-490b-a10f-e4529066c07d'; ``` One problem here could be the mismatching data types of the joined columns (see #2324). I'm not sure about SQLite UUID and UUIDv4, but in general, a data type mismatch can make a join really expensive. After all, the database might need to perform a type conversion on the fly. That being said, I'm wondering if we need the joins at all. Looking at the data being used, we have `libraryId` from the table `libraryItems` and `explicit`, `tags` and `coverPath` from either `books` or `podcasts`. This means that all the latter three fields exist in both media type tables. If we move the common columns to the `libraryItems` table instead, we would need no join at all. That would probably speed up the whole process quite a bit. If that's not possible for any reason, we could also try splitting up the query and running then as separate queries. This might still cause less data to be searched ovverall and be faster.
Author
Owner

@advplyr commented on GitHub (Nov 19, 2023):

That being said, I'm wondering if we need the joins at all. Looking at the data being used, we have libraryId from the table libraryItems and explicit, tags and coverPath from either books or podcasts. This means that all the latter three fields exist in both media type tables. If we move the common columns to the libraryItems table instead, we would need no join at all. That would probably speed up the whole process quite a bit.

Yeah I plan on doing this but right now the clients are sending a library item id, not a media id. I wanted to update the clients and the API route to use media id.

@advplyr commented on GitHub (Nov 19, 2023): > That being said, I'm wondering if we need the joins at all. Looking at the data being used, we have `libraryId` from the table `libraryItems` and `explicit`, `tags` and `coverPath` from either `books` or `podcasts`. This means that all the latter three fields exist in both media type tables. If we move the common columns to the `libraryItems` table instead, we would need no join at all. That would probably speed up the whole process quite a bit. Yeah I plan on doing this but right now the clients are sending a library item id, not a media id. I wanted to update the clients and the API route to use media id.
Author
Owner

@lkiesow commented on GitHub (Nov 19, 2023):

So you want the clients to request something like /api/books/{mediaId}/cover and /api/podcasts/{mediaId}/cover and then just access one of the tables? That would also definitely work and be faster.

That would also mean you don't need a database migration. That's something my idea would have required.

@lkiesow commented on GitHub (Nov 19, 2023): So you want the clients to request something like `/api/books/{mediaId}/cover` and `/api/podcasts/{mediaId}/cover` and then just access one of the tables? That would also definitely work and be faster. That would also mean you don't need a database migration. That's something my idea would have required.
Author
Owner

@advplyr commented on GitHub (Nov 19, 2023):

Yeah exactly. Or we could do /api/media/:mediaType/:mediaId/cover.
The mediaType stored on library items is singular so it would be easier on the clients and allow for adding new types without creating new cover routes.

@advplyr commented on GitHub (Nov 19, 2023): Yeah exactly. Or we could do `/api/media/:mediaType/:mediaId/cover`. The `mediaType` stored on library items is singular so it would be easier on the clients and allow for adding new types without creating new cover routes.
Author
Owner

@advplyr commented on GitHub (Dec 2, 2023):

Another performance improvement was made in v2.6.0 with some api caching thanks to @mikiher here https://github.com/advplyr/audiobookshelf/pull/2343

@advplyr commented on GitHub (Dec 2, 2023): Another performance improvement was made in v2.6.0 with some api caching thanks to @mikiher here https://github.com/advplyr/audiobookshelf/pull/2343
Author
Owner

@DDriggs00 commented on GitHub (Dec 6, 2023):

It does seem to be slightly faster in v2.6 compared to v2.4/5, but still very noticeably slower than v2.3.

@DDriggs00 commented on GitHub (Dec 6, 2023): It does seem to be slightly faster in v2.6 compared to v2.4/5, but still very noticeably slower than v2.3.
Author
Owner

@AppUserOne commented on GitHub (Dec 13, 2023):

I am running the version: 2.6.0 in Yunohost environment. The peformance (loading the initial library, browsing etc.) is extremely slow as compared to original version a while ago (probably 2.3.3). Additionally, the app crashes consistently on downloading any larger podcasts (500+ espisodes). Is there a way to do a fresh install of version 2.3.3 in Yunohost package while these performance issues/bugs are addressed? The official younohost repository only allows the latest version of be installed. I tested both fixes suggested in this thread (disabling watcher, ignoring pre-fix) with minimal improvements.

@AppUserOne commented on GitHub (Dec 13, 2023): I am running the version: 2.6.0 in Yunohost environment. The peformance (loading the initial library, browsing etc.) is extremely slow as compared to original version a while ago (probably 2.3.3). Additionally, the app crashes consistently on downloading any larger podcasts (500+ espisodes). Is there a way to do a fresh install of version 2.3.3 in Yunohost package while these performance issues/bugs are addressed? The official younohost repository only allows the latest version of be installed. I tested both fixes suggested in this thread (disabling watcher, ignoring pre-fix) with minimal improvements.
Author
Owner

@JBlond commented on GitHub (Dec 13, 2023):

I am running the version: 2.6.0 in Yunohost environment. The peformance (loading the initial library, browsing etc.) is extremely slow as compared to original version a while ago (probably 2.3.3). Additionally, the app crashes consistently on downloading any larger podcasts (500+ espisodes). Is there a way to do a fresh install of version 2.3.3 in Yunohost package while these performance issues/bugs are addressed? The official younohost repository only allows the latest version of be installed. I tested both fixes suggested in this thread (disabling watcher, ignoring pre-fix) with minimal improvements.

Yes, with docker compose https://www.audiobookshelf.org/docs#docker-compose-install you can define the tag. instead of :latest you can use :2.3.3

@JBlond commented on GitHub (Dec 13, 2023): > I am running the version: 2.6.0 in Yunohost environment. The peformance (loading the initial library, browsing etc.) is extremely slow as compared to original version a while ago (probably 2.3.3). Additionally, the app crashes consistently on downloading any larger podcasts (500+ espisodes). Is there a way to do a fresh install of version 2.3.3 in Yunohost package while these performance issues/bugs are addressed? The official younohost repository only allows the latest version of be installed. I tested both fixes suggested in this thread (disabling watcher, ignoring pre-fix) with minimal improvements. Yes, with docker compose https://www.audiobookshelf.org/docs#docker-compose-install you can define the tag. instead of `:latest` you can use `:2.3.3`
Author
Owner

@AppUserOne commented on GitHub (Dec 14, 2023):

Yes, with docker compose https://www.audiobookshelf.org/docs#docker-compose-install you can define the tag. instead of :latest you can use :2.3.3

Thanks for the quick response. But I was hoping to find something like the following, supporting install of an earlier version. I believe docker compose method will require separate docker/docker-compose install outside of Yunohost web GUI and I haven't found some good stable guides around that setup
https://github.com/YunoHost-Apps/audiobookshelf_ynh

@AppUserOne commented on GitHub (Dec 14, 2023): > > > Yes, with docker compose https://www.audiobookshelf.org/docs#docker-compose-install you can define the tag. instead of `:latest` you can use `:2.3.3` Thanks for the quick response. But I was hoping to find something like the following, supporting install of an earlier version. I believe docker compose method will require separate docker/docker-compose install outside of Yunohost web GUI and I haven't found some good stable guides around that setup https://github.com/YunoHost-Apps/audiobookshelf_ynh
Author
Owner

@JBlond commented on GitHub (Dec 14, 2023):

You can, but you have to modify the install manifest https://github.com/YunoHost-Apps/audiobookshelf_ynh/blob/master/manifest.toml#L39-L41

@JBlond commented on GitHub (Dec 14, 2023): You can, but you have to modify the install manifest https://github.com/YunoHost-Apps/audiobookshelf_ynh/blob/master/manifest.toml#L39-L41
Author
Owner

@AppUserOne commented on GitHub (Dec 14, 2023):

You can, but you have to modify the install manifest https://github.com/YunoHost-Apps/audiobookshelf_ynh/blob/master/manifest.toml#L39-L41

Thank you so much. I was able to copy the repository over and modify the file to get to install the required version from within Yunohost web GUI. No more lagging loads and performance issues. Now hoping they all get resolved so that I can upgrade to the latest one.

@AppUserOne commented on GitHub (Dec 14, 2023): > You can, but you have to modify the install manifest https://github.com/YunoHost-Apps/audiobookshelf_ynh/blob/master/manifest.toml#L39-L41 Thank you so much. I was able to copy the repository over and modify the file to get to install the required version from within Yunohost web GUI. No more lagging loads and performance issues. Now hoping they all get resolved so that I can upgrade to the latest one.
Author
Owner

@advplyr commented on GitHub (Dec 31, 2023):

Another performance update in v2.7.1 for podcasts

@advplyr commented on GitHub (Dec 31, 2023): Another performance update in [v2.7.1](https://github.com/advplyr/audiobookshelf/releases/tag/v2.7.1) for podcasts
Author
Owner

@advplyr commented on GitHub (Jan 1, 2024):

At this point in v2.7.1 the performance issues should mostly be resolved.

For larger libraries it won't be as fast as v2.3.x and below because the data is being fetched as needed from the database instead of all being stored in memory. For obvious reasons we couldn't keep storing the entire database in memory.

There is still more to be done in optimizing the queries and reducing the amount of the data returned from the API but performance improvements never really end.

Let me know what other performance issues you are seeing

@advplyr commented on GitHub (Jan 1, 2024): At this point in v2.7.1 the performance issues should mostly be resolved. For larger libraries it won't be as fast as v2.3.x and below because the data is being fetched as needed from the database instead of all being stored in memory. For obvious reasons we couldn't keep storing the entire database in memory. There is still more to be done in optimizing the queries and reducing the amount of the data returned from the API but performance improvements never really end. Let me know what other performance issues you are seeing
Author
Owner

@ejstacey commented on GitHub (Jan 1, 2024):

Just some feedback: 2.7.1 is night and day faster than 2.7.0. I'm finally able to listen to some podcasts I have with near 1000 eps downloaded! I'll still keep an eye out, but it feels like the issue is completely solved for me. Thanks for sticking with this!

@ejstacey commented on GitHub (Jan 1, 2024): Just some feedback: 2.7.1 is night and day faster than 2.7.0. I'm finally able to listen to some podcasts I have with near 1000 eps downloaded! I'll still keep an eye out, but it feels like the issue is completely solved for me. Thanks for sticking with this!
Author
Owner

@Eftimin70 commented on GitHub (Jan 1, 2024):

Unfortunately version 2.7.1 did not change much on my side. I'm not using podcasts, just audiobooks and radio plays. On my setup the new version is still a lot slower than 2.3.3.

@Eftimin70 commented on GitHub (Jan 1, 2024): Unfortunately version 2.7.1 did not change much on my side. I'm not using podcasts, just audiobooks and radio plays. On my setup the new version is still a lot slower than 2.3.3.
Author
Owner

@advplyr commented on GitHub (Jan 1, 2024):

@Eftimin70 Roughly what are the size of your libraries? Anything notable like audiobooks with thousands of audio tracks or anything like that you can share?

Are you running the server with Docker desktop on Windows or how are you running the server?

Are you using a network file system for the database?

@advplyr commented on GitHub (Jan 1, 2024): @Eftimin70 Roughly what are the size of your libraries? Anything notable like audiobooks with thousands of audio tracks or anything like that you can share? Are you running the server with Docker desktop on Windows or how are you running the server? Are you using a network file system for the database?
Author
Owner

@Eftimin70 commented on GitHub (Jan 1, 2024):

@advplyr Here are my stats for the radio plays:

4165 Items in Library
3816 Overall Hours
361 Authors
305.7 Size (GB)
43901 Audio Tracks

Audiobookshelf is running in docker on a qnap with an Intel Celeron J4125. The Folders are directly hosted on the qnap server which is equipped with 20GB of RAM.

@Eftimin70 commented on GitHub (Jan 1, 2024): @advplyr Here are my stats for the radio plays: 4165 Items in Library 3816 Overall Hours 361 Authors 305.7 Size (GB) 43901 Audio Tracks Audiobookshelf is running in docker on a qnap with an Intel Celeron J4125. The Folders are directly hosted on the qnap server which is equipped with 20GB of RAM.
Author
Owner

@kaldigo commented on GitHub (Jan 3, 2024):

For me the library loading has been much faster with this update. The only problem I am having is that covers are taking up to 22 sec each to load
image
image
image
Thats with a library of 1319 audiobooks.

On the home page the load time is up to 2 sec per image
image
image
image

Audiobookshelf is running via docker on unraid. The server is running a i9-9900k with 32GB of RAM.

@kaldigo commented on GitHub (Jan 3, 2024): For me the library loading has been much faster with this update. The only problem I am having is that covers are taking up to 22 sec each to load ![image](https://github.com/advplyr/audiobookshelf/assets/6437691/9953a5a0-6c9f-4caa-80b7-9a327b4e7bd7) ![image](https://github.com/advplyr/audiobookshelf/assets/6437691/02443786-0e8d-46c9-8e0c-0309fbbe4339) ![image](https://github.com/advplyr/audiobookshelf/assets/6437691/6356be0a-bd25-42d9-aa3a-1d1e94578424) Thats with a library of 1319 audiobooks. On the home page the load time is up to 2 sec per image ![image](https://github.com/advplyr/audiobookshelf/assets/6437691/069f1f3f-486e-4617-8951-9ad65115618e) ![image](https://github.com/advplyr/audiobookshelf/assets/6437691/38198125-54af-4de7-b34e-144c1bf126e0) ![image](https://github.com/advplyr/audiobookshelf/assets/6437691/0eb111d0-6dea-44cd-a024-2dcfc3287ad9) Audiobookshelf is running via docker on unraid. The server is running a i9-9900k with 32GB of RAM.
Author
Owner

@hoggatt commented on GitHub (Jan 4, 2024):

Just updated from 2.3.3. to 2.7.1 and for podcasts, it is fast! Thanks for the effort! The home page takes a bit to start when the android app is initially loaded (although it did in 2.3.3 as well, maybe a touch slower in the newest version). Web version loads right away. The "Latest" page (which I use often) loads very quick for both the app and the web.

If I go into the library section (again, android app), a podcast with 750 episodes takes a second or two to load. Not bad at all! The page itself shows up all at once (after everything is loaded in the background). My opinion is that loading a skeleton page, then populating the content (youtube does this) makes it seem faster. For some reason it takes a second when I hit the back arrow too. The library section is blazing fast on the web though, so it might be an android app-related issue.

@hoggatt commented on GitHub (Jan 4, 2024): Just updated from 2.3.3. to 2.7.1 and for podcasts, it is fast! Thanks for the effort! The home page takes a bit to start when the android app is initially loaded (although it did in 2.3.3 as well, maybe a touch slower in the newest version). Web version loads right away. The "Latest" page (which I use often) loads very quick for both the app and the web. If I go into the library section (again, android app), a podcast with 750 episodes takes a second or two to load. Not bad at all! The page itself shows up all at once (after everything is loaded in the background). My opinion is that loading a skeleton page, then populating the content (youtube does this) makes it seem faster. For some reason it takes a second when I hit the back arrow too. The library section is blazing fast on the web though, so it might be an android app-related issue.
Author
Owner

@JBlond commented on GitHub (Jan 4, 2024):

With the new version, the "re-scan" of a library is much faster than before. Thanks for the effort.

@JBlond commented on GitHub (Jan 4, 2024): With the new version, the "re-scan" of a library is much faster than before. Thanks for the effort.
Author
Owner

@nichwall commented on GitHub (Nov 9, 2024):

Cover images being slow were addressed in https://github.com/advplyr/audiobookshelf/pull/3580 and are now much faster (currently only available in edge). There has been some more cleanup in the API and database queries, but there is still more to do.

@nichwall commented on GitHub (Nov 9, 2024): Cover images being slow were addressed in https://github.com/advplyr/audiobookshelf/pull/3580 and are now much faster (currently only available in `edge`). There has been some more cleanup in the API and database queries, but there is still more to do.
Author
Owner

@DDriggs00 commented on GitHub (Nov 9, 2024):

I think the biggest improvement will be when non-sqlite database support is added.

@DDriggs00 commented on GitHub (Nov 9, 2024): I think the biggest improvement will be when non-sqlite database support is added.
Author
Owner

@BlackHoleFox commented on GitHub (Nov 9, 2024):

sqlite is plenty fast for an application like audiobookshelf though :/. Architectural changes can make way bigger improvements then switching for a networked database.

@BlackHoleFox commented on GitHub (Nov 9, 2024): sqlite is plenty fast for an application like audiobookshelf though :/. Architectural changes can make way bigger improvements then switching for a networked database.
Author
Owner

@lkiesow commented on GitHub (Nov 10, 2024):

Exactly. The database system isn't the real problem here. It's more the database structure.

@lkiesow commented on GitHub (Nov 10, 2024): Exactly. The database system isn't the real problem here. It's more the database structure.
Author
Owner

@stelle007 commented on GitHub (Jan 20, 2025):

Any update on this?
It is still very slow for me, I am using mainly for podcasts, and I do have the datahorder disease :)

@stelle007 commented on GitHub (Jan 20, 2025): Any update on this? It is still very slow for me, I am using mainly for podcasts, and I do have the datahorder disease :)
Author
Owner

@r1aven commented on GitHub (Jan 22, 2025):

Any update on this? It is still very slow for me, I am using mainly for podcasts, and I do have the datahorder disease :)

@stelle007
Curious question - are you using the root account when experiencing the slow loading times? I continued to have slow loading times while using the root account, even after all of the updates/improvements, that I used to manage the library/podcasts/etc. I noticed that the user account I used as my main listening account wasn't experiencing the slow load problem so I decided to create yet another account and gave it all of the administrative permissions. Using this "new admin" account, my install is just as speedy as it once was and I no longer use the root account. It's worth a shot if you haven't tried.

@r1aven commented on GitHub (Jan 22, 2025): > Any update on this? It is still very slow for me, I am using mainly for podcasts, and I do have the datahorder disease :) @stelle007 Curious question - are you using the root account when experiencing the slow loading times? I continued to have slow loading times while using the root account, even after all of the updates/improvements, that I used to manage the library/podcasts/etc. I noticed that the user account I used as my main listening account wasn't experiencing the slow load problem so I decided to create yet another account and gave it all of the administrative permissions. Using this "new admin" account, my install is just as speedy as it once was and I no longer use the root account. It's worth a shot if you haven't tried.
Author
Owner

@stelle007 commented on GitHub (Jan 22, 2025):

@r1aven Thank you for that input.
Yes I have tried with other users one with admin rights and one with non admin rights, But it is the same result for both.
I do have 18072 Audio Tracks though, and It is only happening when I get a lot of Audio Tracks. I have also read somewhere that the amount of items is the issue.
I am running on docker, and I have tried fresh install with same result.

@stelle007 commented on GitHub (Jan 22, 2025): @r1aven Thank you for that input. Yes I have tried with other users one with admin rights and one with non admin rights, But it is the same result for both. I do have 18072 Audio Tracks though, and It is only happening when I get a lot of Audio Tracks. I have also read somewhere that the amount of items is the issue. I am running on docker, and I have tried fresh install with same result.
Author
Owner

@r1aven commented on GitHub (Jan 22, 2025):

@stelle007
Sorry to hear that didn't help. You do have about 10x the audio files than I. I too am running on docker and just remembered that I also made this change in my environmental variables which is also worth a shot. If it doesn't work, I'm out of my helpful ideas. Best of luck!
Found in this thread

environment:
  - NODE_ENV=production
  - NODE_OPTIONS=--max-old-space-size=8192
@r1aven commented on GitHub (Jan 22, 2025): @stelle007 Sorry to hear that didn't help. You do have about 10x the audio files than I. I too am running on docker and just remembered that I also made this change in my environmental variables which is also worth a shot. If it doesn't work, I'm out of my helpful ideas. Best of luck! [Found in this thread](https://github.com/advplyr/audiobookshelf/issues/1926#issuecomment-1639020501) environment: - NODE_ENV=production - NODE_OPTIONS=--max-old-space-size=8192
Author
Owner

@stelle007 commented on GitHub (Jan 22, 2025):

Again, thank you.But unfortunately I already have those options set.I did see from the thread you linked that advplyr wrote "Most of the OOM issues have been resolved and the remaining one I'm aware of is with podcast libraries where you have thousands of episodes downloaded."
I don't see a OOM issue, or any errors in the log, It just takes about 11 sec per image to load on the Library page.

@stelle007 commented on GitHub (Jan 22, 2025): Again, thank you.But unfortunately I already have those options set.I did see from the thread you linked that [advplyr](https://github.com/advplyr) wrote "Most of the OOM issues have been resolved and the remaining one I'm aware of is with podcast libraries where you have thousands of episodes downloaded." I don't see a OOM issue, or any errors in the log, It just takes about 11 sec per image to load on the Library page.
Author
Owner

@nichwall commented on GitHub (Jan 22, 2025):

I don't see a OOM issue, or any errors in the log, It just takes about 11 sec per image to load on the Library page.

What server version are you seeing 11 seconds to load per image?

@nichwall commented on GitHub (Jan 22, 2025): > I don't see a OOM issue, or any errors in the log, It just takes about 11 sec per image to load on the Library page. What server version are you seeing 11 seconds to load per image?
Author
Owner

@stelle007 commented on GitHub (Jan 22, 2025):

I don't see a OOM issue, or any errors in the log, It just takes about 11 sec per image to load on the Library page.

What server version are you seeing 11 seconds to load per image?

Any version since 2.4.0. I am on 2.18.1 now.
Well I can't say it's 11 per image since 2.4.0, but it have been incredibly slow since.
At one point I did try to rollback and run with v2.3.3 image, and that the ran fine.

@stelle007 commented on GitHub (Jan 22, 2025): > > I don't see a OOM issue, or any errors in the log, It just takes about 11 sec per image to load on the Library page. > > What server version are you seeing 11 seconds to load per image? Any version since 2.4.0. I am on 2.18.1 now. Well I can't say it's 11 per image since 2.4.0, but it have been incredibly slow since. At one point I did try to rollback and run with v2.3.3 image, and that the ran fine.
Author
Owner

@mikiher commented on GitHub (Jan 26, 2025):

@stelle007 Can I ask you to please share a few more details about your setup and system?

  • You said you have 18072 audio tracks, but I'd like to know how they are organized:
    • are these mostly books or podcasts?
    • how many books do you have in each book library?
    • how many podcasts, and what is the maximum number of episodes you have per podcast?
  • You said you run Docker. on which system?
  • How do you connect to the server?
    • Is it from a browser running on the same machine (using localhost), or through some Internet adderss?
    • Are you using a reverse proxy?
  • If I can see the Chrome timing for one of the slow loading images, I'd appreciate:
    • in Chrome, open Chrome Developer Tools (F12 or Ctrl+Shift+i)
    • Select the Network tab (in the top line)
    • Go the Chrome address bar and open one of the slow loading library pages
    • In the Network tab, click on one of the slow cover images (you will likely see many of them named cover&ts=<some-long-number>)
    • click the Timing tab.
    • Take a screenshot of the Timing tab contents and post it here.
@mikiher commented on GitHub (Jan 26, 2025): @stelle007 Can I ask you to please share a few more details about your setup and system? - You said you have 18072 audio tracks, but I'd like to know how they are organized: - are these mostly books or podcasts? - how many books do you have in each book library? - how many podcasts, and what is the maximum number of episodes you have per podcast? - You said you run Docker. on which system? - How do you connect to the server? - Is it from a browser running on the same machine (using localhost), or through some Internet adderss? - Are you using a reverse proxy? - If I can see the Chrome timing for one of the slow loading images, I'd appreciate: - in Chrome, open Chrome Developer Tools (F12 or Ctrl+Shift+i) - Select the `Network` tab (in the top line) - Go the Chrome address bar and open one of the slow loading library pages - In the `Network` tab, click on one of the slow cover images (you will likely see many of them named `cover&ts=<some-long-number>`) - click the `Timing` tab. - Take a screenshot of the `Timing` tab contents and post it here.
Author
Owner

@ScuttleSE commented on GitHub (Jan 26, 2025):

Original poster here. For me, the problem is still there, and without a way to know exactly what queries are being made, and how long they take, it is hard to pinpoint exactly what causes it. My guess is still the database.

Either queries are being done that are unnecessary, or they are being done in an extremely inefficient way. The problem isn't that it takes time to load an image, the problem is rather that it takes time to wait for the server to tell the browser what image to load.

When I look at the profile, the actual loading of the coverimages doesn't take long at all. The problem is that the aren't being loaded until after 35-40 seconds.

@ScuttleSE commented on GitHub (Jan 26, 2025): Original poster here. For me, the problem is still there, and without a way to know exactly what queries are being made, and how long they take, it is hard to pinpoint exactly what causes it. My guess is still the database. Either queries are being done that are unnecessary, or they are being done in an extremely inefficient way. The problem isn't that it takes time to load an image, the problem is rather that it takes time to wait for the server to tell the browser what image to load. When I look at the profile, the actual loading of the coverimages doesn't take long at all. The problem is that the aren't being loaded until after 35-40 seconds.
Author
Owner

@mikiher commented on GitHub (Jan 26, 2025):

Thanks. I appreciate the response.

It is hard to understand from the profile image you sent where the image requests actually spend their time.
If you're willing to answer the same questions I sent @stelle007 , I promise I will try to help with this until we resolve this.

Also, have you upgraded to the most recent version? In v2.17.0 we made some significant improvements in cover image loading, so I want to make sure these are included in the code you're running.

@mikiher commented on GitHub (Jan 26, 2025): Thanks. I appreciate the response. It is hard to understand from the profile image you sent where the image requests actually spend their time. If you're willing to answer the same questions I sent @stelle007 , I promise I will try to help with this until we resolve this. Also, have you upgraded to the most recent version? In v2.17.0 we made some significant improvements in cover image loading, so I want to make sure these are included in the code you're running.
Author
Owner

@nichwall commented on GitHub (Jan 26, 2025):

@ScuttleSE is the slow loading time every time you access something in the web client or only the first time? That almost sounds like the slow loading for filterData which is not very efficient to generate with the current data model, so it is generated once and cached until a change for media is detected (due to the cache being invalidated)

@nichwall commented on GitHub (Jan 26, 2025): @ScuttleSE is the slow loading time every time you access something in the web client or only the first time? That almost sounds like the slow loading for `filterData` which is not very efficient to generate with the current data model, so it is generated once and cached until a change for media is detected (due to the cache being invalidated)
Author
Owner

@ScuttleSE commented on GitHub (Jan 26, 2025):

@ScuttleSE is the slow loading time every time you access something in the web client or only the first time? That almost sounds like the slow loading for filterData which is not very efficient to generate with the current data model, so it is generated once and cached until a change for media is detected (due to the cache being invalidated)

It's when blowsing the audiobook library for example. I have just under 2000 titles. If I open the library and then scroll down about 80% of the page, it takes 40-45 seconds for anything to display

@ScuttleSE commented on GitHub (Jan 26, 2025): > [@ScuttleSE](https://github.com/ScuttleSE) is the slow loading time every time you access something in the web client or only the first time? That almost sounds like the slow loading for `filterData` which is not very efficient to generate with the current data model, so it is generated once and cached until a change for media is detected (due to the cache being invalidated) It's when blowsing the audiobook library for example. I have just under 2000 titles. If I open the library and then scroll down about 80% of the page, it takes 40-45 seconds for anything to display
Author
Owner

@ScuttleSE commented on GitHub (Jan 26, 2025):

When looking at the actual query-logging, it seems to be a huge number of small queries being done actually.

If I scroll past ~1800 titles, it looks like ABS actually queries all those 1800 titles before loading the ones I have scrolled to.

@ScuttleSE commented on GitHub (Jan 26, 2025): When looking at the actual query-logging, it seems to be a huge number of small queries being done actually. If I scroll past ~1800 titles, it looks like ABS actually queries all those 1800 titles before loading the ones I have scrolled to.
Author
Owner

@advplyr commented on GitHub (Jan 26, 2025):

Can you confirm what version of the server you are running?

@advplyr commented on GitHub (Jan 26, 2025): Can you confirm what version of the server you are running?
Author
Owner

@mikiher commented on GitHub (Jan 26, 2025):

I see.

I will ask you again to still provide the rest of the details I asked for above, except for the Chrome timing, since based on what you said I now think the issue is indeed not with cover image loading, but rather with concurrent page fetch requests.

Can you please let me know:

  • What sort order is selected?
  • When you first load the library page (i.e. the top books according to the sort order, before scrolling), how much time does it take to load the page?
  • How many books are visible on the screen
  • How do you scroll? with pgup/pgdn keys, or with the mouse wheel?
@mikiher commented on GitHub (Jan 26, 2025): I see. I will ask you again to still provide the rest of the details I asked for above, except for the Chrome timing, since based on what you said I now think the issue is indeed not with cover image loading, but rather with concurrent page fetch requests. Can you please let me know: - What sort order is selected? - When you first load the library page (i.e. the top books according to the sort order, before scrolling), how much time does it take to load the page? - How many books are visible on the screen - How do you scroll? with pgup/pgdn keys, or with the mouse wheel?
Author
Owner

@ScuttleSE commented on GitHub (Jan 26, 2025):

Can you confirm what version of the server you are running?

2.18.1

@ScuttleSE commented on GitHub (Jan 26, 2025): > Can you confirm what version of the server you are running? 2.18.1
Author
Owner

@mikiher commented on GitHub (Jan 26, 2025):

While I'm waiting for your response, I'll say a couple of things, which I'm quite sure are related to this issue, given what you described:

  1. We have a known unresolved issue with concurrent database queries, where if you have a number of them triggered in quick succession (like in the case of fast scrolling), they will interfere with one another and cause a general slowdown, leading to a visible and significant slowdown in page load time. I've tried to mitigate this by reducing the amount of queries sent during fast scrolling in #3726, but the solution is not perfect, and the server might still choke especially on weak hardware.
  2. The behavior of page queries (queries for the next batch of book records) is highly dependent on the sort order used. I improved some of the sort orders in PR #3767, but there are a few sort orders in which the page query is still an order of magnitude slower than with more optimized sort orders.
  3. The behavior of page queries is also currently dependant on the position of the batch you're asking for. The closer you are to the end of the list, the longer it will take to fulfill the query. I called out this issue when I worked on #3767, but have not worked on it yet.

So again, I'm quite sure the issue revolves around one or more of the above. If you can answer my questions, I'll be able to know which one pertains more to your specific setup.

@mikiher commented on GitHub (Jan 26, 2025): While I'm waiting for your response, I'll say a couple of things, which I'm quite sure are related to this issue, given what you described: 1. We have a known unresolved issue with concurrent database queries, where if you have a number of them triggered in quick succession (like in the case of fast scrolling), they will interfere with one another and cause a general slowdown, leading to a visible and significant slowdown in page load time. I've tried to mitigate this by reducing the amount of queries sent during fast scrolling in #3726, but the solution is not perfect, and the server might still choke especially on weak hardware. 2. The behavior of page queries (queries for the next batch of book records) is highly dependent on the sort order used. I improved some of the sort orders in PR #3767, but there are a few sort orders in which the page query is still an order of magnitude slower than with more optimized sort orders. 3. The behavior of page queries is also currently dependant on the position of the batch you're asking for. The closer you are to the end of the list, the longer it will take to fulfill the query. I called out this issue when I worked on #3767, but have not worked on it yet. So again, I'm quite sure the issue revolves around one or more of the above. If you can answer my questions, I'll be able to know which one pertains more to your specific setup.
Author
Owner

@JBlond commented on GitHub (Jan 26, 2025):

I have the same issue with a library with 300 items, even though it is not 45 seconds. more like 15.

* What sort order is selected?

Title DESC

* When you first load the library page (i.e. the top books according to the sort order, before scrolling), how much time does it take to load the page?

The visible part is there after like 3 to 4 seconds.

* How many books are visible on the screen

18 (view set to size 120)

* How do you scroll? with pgup/pgdn keys, or with the mouse wheel?

I use the mouse wheel default windows settings for the length

@JBlond commented on GitHub (Jan 26, 2025): I have the same issue with a library with 300 items, even though it is not 45 seconds. more like 15. > * What sort order is selected? Title DESC > * When you first load the library page (i.e. the top books according to the sort order, before scrolling), how much time does it take to load the page? The visible part is there after like 3 to 4 seconds. > * How many books are visible on the screen 18 (view set to size 120) > * How do you scroll? with pgup/pgdn keys, or with the mouse wheel? I use the mouse wheel default windows settings for the length
Author
Owner

@mikiher commented on GitHub (Jan 26, 2025):

@JBlond

Is it serving on Docker? On which system?

@mikiher commented on GitHub (Jan 26, 2025): @JBlond Is it serving on Docker? On which system?
Author
Owner

@JBlond commented on GitHub (Jan 26, 2025):

Is it serving on Docker? On which system?

Docker on Debian 12 all updates.

ABS 2.18.1

I may add the info that it isn't the only library in the database, only the largest.
Also #3767 did improve the speed. Yet it is not like before 2.3

@JBlond commented on GitHub (Jan 26, 2025): > Is it serving on Docker? On which system? Docker on Debian 12 all updates. ABS 2.18.1 I may add the info that it isn't the only library in the database, only the largest. Also #3767 did improve the speed. Yet it is not like before 2.3
Author
Owner

@mikiher commented on GitHub (Jan 26, 2025):

Is it serving on Docker? On which system?

Docker on Debian 12 all updates.

And on which hardware? Also, this is through localhost or local network? Just trying to make sure no network latency issues are involved

ABS 2.18.1

I may add the info that it isn't the only library in the database, only the largest. Also #3767 did improve the speed. Yet it is not like before 2.3

@mikiher commented on GitHub (Jan 26, 2025): > > Is it serving on Docker? On which system? > > Docker on Debian 12 all updates. And on which hardware? Also, this is through localhost or local network? Just trying to make sure no network latency issues are involved > > ABS 2.18.1 > > I may add the info that it isn't the only library in the database, only the largest. Also [#3767](https://github.com/advplyr/audiobookshelf/pull/3767) did improve the speed. Yet it is not like before 2.3
Author
Owner

@PhantomPhoton commented on GitHub (Jan 26, 2025):

@mikiher

I'm ABS 2.18.1 (modified with pragma values) on Docker.

I'm certainly in the boat for issue 1. If I scroll down too fast, even with the pragma changes, It'll crash the frontend. The backend reports Socket disconnected from client after 133624ms (Reason: transport close). If I let it sit long enough, the frontend partially comes back to life. None of the cover images load, but the data loads in for all the entries. However, trying to open an entry leads to a blank screen until I refresh the page.

I started to try to look into a way to force the initial load to be everything rather than a paginated view, but the frontend calculations are a bit beyond me to do so.

I really appreciate all the hard work you are doing to help us all out. Thank you very much.

@PhantomPhoton commented on GitHub (Jan 26, 2025): @mikiher I'm ABS 2.18.1 (modified with pragma values) on Docker. I'm certainly in the boat for issue 1. If I scroll down too fast, even with the pragma changes, It'll crash the frontend. The backend reports `Socket disconnected from client after 133624ms (Reason: transport close)`. If I let it sit long enough, the frontend partially comes back to life. None of the cover images load, but the data loads in for all the entries. However, trying to open an entry leads to a blank screen until I refresh the page. I started to try to look into a way to force the initial load to be everything rather than a paginated view, but the frontend calculations are a bit beyond me to do so. I really appreciate all the hard work you are doing to help us all out. Thank you very much.
Author
Owner

@mikiher commented on GitHub (Jan 26, 2025):

@mikiher

I'm ABS 2.18.1 (modified with pragma values) on Docker.

I'm certainly in the boat for issue 1. If I scroll down too fast, even with the pragma changes, It'll crash the frontend. The backend reports Socket disconnected from client after 133624ms (Reason: transport close). If I let it sit long enough, the frontend partially comes back to life. None of the cover images load, but the data loads in for all the entries. However, trying to open an entry leads to a blank screen until I refresh the page.

I started to try to look into a way to force the initial load to be everything rather than a paginated view, but the frontend calculations are a bit beyond me to do so.

I am inclined to think that this may be a good mitigation for not-so-large libraries (i.e up to about 500 books).
I will play with this a bit to see what's the impact on initial page load time.

I really appreciate all the hard work you are doing to help us all out. Thank you very much.

@mikiher commented on GitHub (Jan 26, 2025): > [@mikiher](https://github.com/mikiher) > > I'm ABS 2.18.1 (modified with pragma values) on Docker. > > I'm certainly in the boat for issue 1. If I scroll down too fast, even with the pragma changes, It'll crash the frontend. The backend reports `Socket disconnected from client after 133624ms (Reason: transport close)`. If I let it sit long enough, the frontend partially comes back to life. None of the cover images load, but the data loads in for all the entries. However, trying to open an entry leads to a blank screen until I refresh the page. > > I started to try to look into a way to force the initial load to be everything rather than a paginated view, but the frontend calculations are a bit beyond me to do so. I am inclined to think that this may be a good mitigation for not-so-large libraries (i.e up to about 500 books). I will play with this a bit to see what's the impact on initial page load time. > > I really appreciate all the hard work you are doing to help us all out. Thank you very much.
Author
Owner

@JBlond commented on GitHub (Jan 26, 2025):

And on which hardware? Also, this is through localhost or local network? Just trying to make sure no network latency issues are involved

Intel i5 4300U 1,9 GHz (c2/t4)
2 GB RAM
Samsung SSD 860 EVO 500G

Network the same switch. All devices connected via 1 Gbit LAN.
Tested browsers Firefox 128, Chromium 133

@JBlond commented on GitHub (Jan 26, 2025): > And on which hardware? Also, this is through localhost or local network? Just trying to make sure no network latency issues are involved Intel i5 4300U 1,9 GHz (c2/t4) 2 GB RAM Samsung SSD 860 EVO 500G Network the same switch. All devices connected via 1 Gbit LAN. Tested browsers Firefox 128, Chromium 133
Author
Owner

@JBlond commented on GitHub (Jan 26, 2025):

I am inclined to think that this may be a good mitigation for not-so-large libraries (i.e up to about 500 books). I will play with this a bit to see what's the impact on initial page load time.

Does that improve the speed? It is still a single database file. Just wondering.

@JBlond commented on GitHub (Jan 26, 2025): > I am inclined to think that this may be a good mitigation for not-so-large libraries (i.e up to about 500 books). I will play with this a bit to see what's the impact on initial page load time. Does that improve the speed? It is still a single database file. Just wondering.
Author
Owner

@PhantomPhoton commented on GitHub (Jan 26, 2025):

I am inclined to think that this may be a good mitigation for not-so-large libraries (i.e up to about 500 books). I will play with this a bit to see what's the impact on initial page load time.

Does that improve the speed? It is still a single database file. Just wondering.

Depends on what you are going for. The first page of entities will be slower, but if you're going for later entries, it's faster.

So when you query the database, you say, I want the entries sorted by this criteria. Generally the criteria to find the entries is the slow bit. Then to paginate it, you say, give me (for example) 12 entries from the query. That gives you the first page. To get the next page, you say, I want entries 13 to 24 from the query. There's nothing that holds the query results from the first query, so for the engine to figure out what entries 13 to 24 is, it needs to figure out what entries 1-12 is and discard them.

So for each page, you repeat the work it took to get the previous pages and discard it. So the final page query is the cost to find all the rows. By just doing a complete query on load, you save a lot of query time for the between pages, but at the cost that the first page takes as long as the last page would in the paginated version.

Does that make sense?

For me, I generally scroll somewhere in the middle of the list, so I rather just pay the full cost once. It's possible that other people tend to the first entries in the list where the pagination would be faster.

@PhantomPhoton commented on GitHub (Jan 26, 2025): > > I am inclined to think that this may be a good mitigation for not-so-large libraries (i.e up to about 500 books). I will play with this a bit to see what's the impact on initial page load time. > > Does that improve the speed? It is still a single database file. Just wondering. Depends on what you are going for. The first page of entities will be slower, but if you're going for later entries, it's faster. So when you query the database, you say, I want the entries sorted by this criteria. Generally the criteria to find the entries is the slow bit. Then to paginate it, you say, give me (for example) 12 entries from the query. That gives you the first page. To get the next page, you say, I want entries 13 to 24 from the query. There's nothing that holds the query results from the first query, so for the engine to figure out what entries 13 to 24 is, it needs to figure out what entries 1-12 is and discard them. So for each page, you repeat the work it took to get the previous pages and discard it. So the final page query is the cost to find all the rows. By just doing a complete query on load, you save a lot of query time for the between pages, but at the cost that the first page takes as long as the last page would in the paginated version. Does that make sense? For me, I generally scroll somewhere in the middle of the list, so I rather just pay the full cost once. It's possible that other people tend to the first entries in the list where the pagination would be faster.
Author
Owner

@mikiher commented on GitHub (Jan 26, 2025):

All what @PhantomPhoton said, plus a larger fetch size (even if not covering the whole library), may reduce the probablity for concurrent fetches due to fast scrolling, which leads to bad server behavior.

As mentioned, there's certainly a tradeoff here between initial page load time and faster loading of later entries.

@mikiher commented on GitHub (Jan 26, 2025): All what @PhantomPhoton said, plus a larger fetch size (even if not covering the whole library), may reduce the probablity for concurrent fetches due to fast scrolling, which leads to bad server behavior. As mentioned, there's certainly a tradeoff here between initial page load time and faster loading of later entries.
Author
Owner

@JBlond commented on GitHub (Jan 26, 2025):

Does that make sense?

Yes. A single large query in the first place vs a lot of small queries.

I tried your method scrolling down to 50% and that make the images load a lot faster.
I tried to split the libs into sizes of 100 items and there is no more delay when I scroll down to the end.

@JBlond commented on GitHub (Jan 26, 2025): > Does that make sense? Yes. A single large query in the first place vs a lot of small queries. I tried your method scrolling down to 50% and that make the images load a lot faster. I tried to split the libs into sizes of 100 items and there is no more delay when I scroll down to the end.
Author
Owner

@advplyr commented on GitHub (Jan 26, 2025):

The sorting and limiting is done in the db query so if it is properly indexed it doesn't need to know what items 1-12 are and discard them

@advplyr commented on GitHub (Jan 26, 2025): The sorting and limiting is done in the db query so if it is properly indexed it doesn't need to know what items 1-12 are and discard them
Author
Owner

@PhantomPhoton commented on GitHub (Jan 27, 2025):

The sorting and limiting is done in the db query so if it is properly indexed it doesn't need to know what items 1-12 are and discard them

Well, it does, it's just very fast to find them. The index isn't an array that has a fixed offset position to jump to, it's a b-tree and so you have to transverse the nodes to find how many counts each branch has to find out which branch to start processing from.

It is very fast, but it still does figure out what the first n would be before it can give you what offset you want is.

Though this is deep into the technical weeds.

@PhantomPhoton commented on GitHub (Jan 27, 2025): > The sorting and limiting is done in the db query so if it is properly indexed it doesn't need to know what items 1-12 are and discard them Well, it does, it's just very fast to find them. The index isn't an array that has a fixed offset position to jump to, it's a b-tree and so you have to transverse the nodes to find how many counts each branch has to find out which branch to start processing from. It is very fast, but it still does figure out what the first n would be before it can give you what offset you want is. Though this is deep into the technical weeds.
Author
Owner

@ScuttleSE commented on GitHub (Jan 27, 2025):

I see.

I will ask you again to still provide the rest of the details I asked for above, except for the Chrome timing, since based on what you said I now think the issue is indeed not with cover image loading, but rather with concurrent page fetch requests.

Can you please let me know:

* What sort order is selected?

* When you first load the library page (i.e. the top books according to the sort order, before scrolling), how much time does it take to load the page?

* How many books are visible on the screen

* How do you scroll? with pgup/pgdn keys, or with the mouse wheel?
  • Title, descending
  • The first library page loads fast, about 25 books, the queries takes a few milliseconds.
  • 25
  • Mouse pulling the scrollbar all the way to the bottom.

Out of curiosity, I logged the queries that occurred after the library was loaded and I used the scrollbar to go all the way to the bottom.

342 queries, almost all of them taking more and more time.

`[2025-01-27 05:41:50.925] DEBUG: Ran the following query in 4ms:

[2025-01-27 05:41:50.956] DEBUG: Ran the following query in 28ms:

[2025-01-27 05:41:50.975] DEBUG: Ran the following query in 15ms:

[2025-01-27 05:41:50.981] DEBUG: Ran the following query in 2ms:

[2025-01-27 05:41:50.988] DEBUG: Ran the following query in 5ms:

[2025-01-27 05:41:51.000] DEBUG: Ran the following query in 9ms:

[2025-01-27 05:41:51.011] DEBUG: Ran the following query in 8ms:

[2025-01-27 05:41:51.058] DEBUG: Ran the following query in 6ms:

[2025-01-27 05:41:51.061] DEBUG: Ran the following query in 1ms:

[2025-01-27 05:41:51.069] DEBUG: Ran the following query in 6ms:

[2025-01-27 05:41:51.070] DEBUG: Ran the following query in 4ms:

[2025-01-27 05:41:51.075] DEBUG: Ran the following query in 2ms:

[2025-01-27 05:41:51.128] DEBUG: Ran the following query in 42ms:

[2025-01-27 05:42:04.351] DEBUG: Ran the following query in 31ms:

[2025-01-27 05:42:04.414] DEBUG: Ran the following query in 1ms:

[2025-01-27 05:42:04.478] DEBUG: Ran the following query in 2ms:

[2025-01-27 05:42:04.489] DEBUG: Ran the following query in 7ms:

[2025-01-27 05:42:04.492] DEBUG: Ran the following query in 1ms:

[2025-01-27 05:42:04.495] DEBUG: Ran the following query in 1ms:

[2025-01-27 05:42:04.625] DEBUG: Ran the following query in 121ms:

[2025-01-27 05:42:04.627] DEBUG: Ran the following query in 1ms:

[2025-01-27 05:42:04.629] DEBUG: Ran the following query in 1ms:

[2025-01-27 05:42:04.713] DEBUG: Ran the following query in 82ms:

[2025-01-27 05:42:04.908] DEBUG: Ran the following query in 4ms:

[2025-01-27 05:42:04.919] DEBUG: Ran the following query in 4ms:

[2025-01-27 05:42:04.939] DEBUG: Ran the following query in 2ms:

[2025-01-27 05:42:04.943] DEBUG: Ran the following query in 2ms:

[2025-01-27 05:42:05.072] DEBUG: Ran the following query in 27ms:

[2025-01-27 05:42:05.074] DEBUG: Ran the following query in 52ms:

[2025-01-27 05:42:05.088] DEBUG: Ran the following query in 64ms:

[2025-01-27 05:42:05.127] DEBUG: Ran the following query in 42ms:

[2025-01-27 05:42:05.130] DEBUG: Ran the following query in 42ms:

[2025-01-27 05:42:05.143] DEBUG: Ran the following query in 2ms:

[2025-01-27 05:42:05.146] DEBUG: Ran the following query in 5ms:

[2025-01-27 05:42:05.193] DEBUG: Ran the following query in 34ms:

[2025-01-27 05:42:05.251] DEBUG: Ran the following query in 90ms:

[2025-01-27 05:42:05.316] DEBUG: Ran the following query in 57ms:

[2025-01-27 05:42:05.325] DEBUG: Ran the following query in 69ms:

[2025-01-27 05:42:05.327] DEBUG: Ran the following query in 2ms:

[2025-01-27 05:42:05.329] DEBUG: Ran the following query in 4ms:

[2025-01-27 05:42:05.343] DEBUG: Ran the following query in 5ms:

[2025-01-27 05:42:05.344] DEBUG: Ran the following query in 4ms:

[2025-01-27 05:42:05.355] DEBUG: Ran the following query in 6ms:

[2025-01-27 05:42:05.457] DEBUG: Ran the following query in 81ms:

[2025-01-27 05:42:05.466] DEBUG: Ran the following query in 4ms:

[2025-01-27 05:42:05.487] DEBUG: Ran the following query in 11ms:

[2025-01-27 05:42:05.519] DEBUG: Ran the following query in 41ms:

[2025-01-27 05:42:05.538] DEBUG: Ran the following query in 3ms:

[2025-01-27 05:42:05.540] DEBUG: Ran the following query in 4ms:

[2025-01-27 05:42:05.562] DEBUG: Ran the following query in 16ms:

[2025-01-27 05:42:05.564] DEBUG: Ran the following query in 15ms:

[2025-01-27 05:42:05.570] DEBUG: Ran the following query in 2ms:

[2025-01-27 05:42:05.571] DEBUG: Ran the following query in 3ms:

[2025-01-27 05:42:05.581] DEBUG: Ran the following query in 5ms:

[2025-01-27 05:42:05.582] DEBUG: Ran the following query in 4ms:

[2025-01-27 05:42:24.263] DEBUG: Ran the following query in 3ms:

[2025-01-27 05:42:24.330] DEBUG: Ran the following query in 52ms:

[2025-01-27 05:42:24.507] DEBUG: Ran the following query in 225ms:

[2025-01-27 05:42:24.568] DEBUG: Ran the following query in 11ms:

[2025-01-27 05:42:24.577] DEBUG: Ran the following query in 20ms:

[2025-01-27 05:42:35.448] DEBUG: Ran the following query in 4ms:

[2025-01-27 05:42:35.525] DEBUG: Ran the following query in 51ms:

[2025-01-27 05:42:35.527] DEBUG: Ran the following query in 38ms:

[2025-01-27 05:42:35.737] DEBUG: Ran the following query in 258ms:

[2025-01-27 05:42:35.934] DEBUG: Ran the following query in 423ms:

[2025-01-27 05:42:35.939] DEBUG: Ran the following query in 135ms:

[2025-01-27 05:42:35.945] DEBUG: Ran the following query in 424ms:

[2025-01-27 05:42:35.949] DEBUG: Ran the following query in 106ms:

[2025-01-27 05:42:35.978] DEBUG: Ran the following query in 248ms:

[2025-01-27 05:42:35.978] DEBUG: Ran the following query in 128ms:

[2025-01-27 05:42:36.152] DEBUG: Ran the following query in 421ms:

[2025-01-27 05:42:36.176] DEBUG: Ran the following query in 277ms:

[2025-01-27 05:42:36.192] DEBUG: Ran the following query in 422ms:

[2025-01-27 05:42:36.195] DEBUG: Ran the following query in 286ms:

[2025-01-27 05:42:36.202] DEBUG: Ran the following query in 283ms:

[2025-01-27 05:42:36.208] DEBUG: Ran the following query in 438ms:

[2025-01-27 05:42:36.221] DEBUG: Ran the following query in 436ms:

[2025-01-27 05:42:36.226] DEBUG: Ran the following query in 298ms:

[2025-01-27 05:42:36.232] DEBUG: Ran the following query in 444ms:

[2025-01-27 05:42:36.236] DEBUG: Ran the following query in 443ms:

[2025-01-27 05:42:36.240] DEBUG: Ran the following query in 438ms:

[2025-01-27 05:42:36.244] DEBUG: Ran the following query in 313ms:

[2025-01-27 05:42:36.247] DEBUG: Ran the following query in 457ms:

[2025-01-27 05:42:36.251] DEBUG: Ran the following query in 453ms:

[2025-01-27 05:42:36.255] DEBUG: Ran the following query in 464ms:

[2025-01-27 05:42:36.260] DEBUG: Ran the following query in 472ms:

[2025-01-27 05:42:36.270] DEBUG: Ran the following query in 456ms:

[2025-01-27 05:42:36.279] DEBUG: Ran the following query in 471ms:

[2025-01-27 05:42:36.283] DEBUG: Ran the following query in 472ms:

[2025-01-27 05:42:36.949] DEBUG: Ran the following query in 1007ms:

[2025-01-27 05:42:36.977] DEBUG: Ran the following query in 1130ms:

[2025-01-27 05:42:36.981] DEBUG: Ran the following query in 1027ms:

[2025-01-27 05:42:36.989] DEBUG: Ran the following query in 1135ms:

[2025-01-27 05:42:36.994] DEBUG: Ran the following query in 1131ms:

[2025-01-27 05:42:36.997] DEBUG: Ran the following query in 1137ms:

[2025-01-27 05:42:37.001] DEBUG: Ran the following query in 1134ms:

[2025-01-27 05:42:37.005] DEBUG: Ran the following query in 1149ms:

[2025-01-27 05:42:37.008] DEBUG: Ran the following query in 1120ms:

[2025-01-27 05:42:37.012] DEBUG: Ran the following query in 1121ms:

[2025-01-27 05:42:37.015] DEBUG: Ran the following query in 1122ms:

[2025-01-27 05:42:37.019] DEBUG: Ran the following query in 1124ms:

[2025-01-27 05:42:37.023] DEBUG: Ran the following query in 1126ms:

[2025-01-27 05:42:37.031] DEBUG: Ran the following query in 1145ms:

[2025-01-27 05:42:37.876] DEBUG: Ran the following query in 1894ms:

[2025-01-27 05:42:37.903] DEBUG: Ran the following query in 2023ms:

[2025-01-27 05:42:37.908] DEBUG: Ran the following query in 2024ms:

[2025-01-27 05:42:37.917] DEBUG: Ran the following query in 2016ms:

[2025-01-27 05:42:37.928] DEBUG: Ran the following query in 1739ms:

[2025-01-27 05:42:37.934] DEBUG: Ran the following query in 2026ms:

[2025-01-27 05:42:37.940] DEBUG: Ran the following query in 2036ms:

[2025-01-27 05:42:37.951] DEBUG: Ran the following query in 2040ms:

[2025-01-27 05:42:37.958] DEBUG: Ran the following query in 2044ms:

[2025-01-27 05:42:37.965] DEBUG: Ran the following query in 2049ms:

[2025-01-27 05:42:39.118] DEBUG: Ran the following query in 2919ms:

[2025-01-27 05:42:39.149] DEBUG: Ran the following query in 3223ms:

[2025-01-27 05:42:39.153] DEBUG: Ran the following query in 3231ms:

[2025-01-27 05:42:39.156] DEBUG: Ran the following query in 3232ms:

[2025-01-27 05:42:39.160] DEBUG: Ran the following query in 2940ms:

[2025-01-27 05:42:39.193] DEBUG: Ran the following query in 3255ms:

[2025-01-27 05:42:39.846] DEBUG: Ran the following query in 3907ms:

[2025-01-27 05:42:39.863] DEBUG: Ran the following query in 3922ms:

[2025-01-27 05:42:39.877] DEBUG: Ran the following query in 3613ms:

[2025-01-27 05:42:39.932] DEBUG: Ran the following query in 3985ms:

[2025-01-27 05:42:40.745] DEBUG: Ran the following query in 4793ms:

[2025-01-27 05:42:41.015] DEBUG: Ran the following query in 5067ms:

[2025-01-27 05:42:41.069] DEBUG: Ran the following query in 4099ms:

[2025-01-27 05:42:41.073] DEBUG: Ran the following query in 5122ms:

[2025-01-27 05:42:41.081] DEBUG: Ran the following query in 5103ms:

[2025-01-27 05:42:42.306] DEBUG: Ran the following query in 5322ms:

[2025-01-27 05:42:42.329] DEBUG: Ran the following query in 6348ms:

[2025-01-27 05:42:42.353] DEBUG: Ran the following query in 6347ms:

[2025-01-27 05:42:44.313] DEBUG: Ran the following query in 8266ms:

[2025-01-27 05:42:44.317] DEBUG: Ran the following query in 8141ms:

[2025-01-27 05:42:44.319] DEBUG: Ran the following query in 8188ms:

[2025-01-27 05:42:44.326] DEBUG: Ran the following query in 8146ms:

[2025-01-27 05:42:44.343] DEBUG: Ran the following query in 8160ms:

[2025-01-27 05:42:44.369] DEBUG: Ran the following query in 6457ms:

[2025-01-27 05:42:44.410] DEBUG: Ran the following query in 8322ms:

[2025-01-27 05:42:44.414] DEBUG: Ran the following query in 8235ms:

[2025-01-27 05:42:44.414] DEBUG: Ran the following query in 8238ms:

[2025-01-27 05:42:44.435] DEBUG: Ran the following query in 8237ms:

[2025-01-27 05:42:45.544] DEBUG: Ran the following query in 7599ms:

[2025-01-27 05:42:45.665] DEBUG: Ran the following query in 9459ms:

[2025-01-27 05:42:46.840] DEBUG: Ran the following query in 10633ms:

[2025-01-27 05:42:46.857] DEBUG: Ran the following query in 7711ms:

[2025-01-27 05:42:46.883] DEBUG: Ran the following query in 10659ms:

[2025-01-27 05:42:52.887] DEBUG: Ran the following query in 16662ms:

[2025-01-27 05:42:53.265] DEBUG: Ran the following query in 17035ms:

[2025-01-27 05:42:53.303] DEBUG: Ran the following query in 17064ms:

[2025-01-27 05:42:53.336] DEBUG: Ran the following query in 17094ms:

[2025-01-27 05:42:53.341] DEBUG: Ran the following query in 17098ms:

[2025-01-27 05:42:53.364] DEBUG: Ran the following query in 17118ms:

[2025-01-27 05:42:53.373] DEBUG: Ran the following query in 17126ms:

[2025-01-27 05:42:53.401] DEBUG: Ran the following query in 17151ms:

[2025-01-27 05:42:53.405] DEBUG: Ran the following query in 17154ms:

[2025-01-27 05:42:53.425] DEBUG: Ran the following query in 17171ms:

[2025-01-27 05:42:53.432] DEBUG: Ran the following query in 17177ms:

[2025-01-27 05:42:53.459] DEBUG: Ran the following query in 17201ms:

[2025-01-27 05:42:53.463] DEBUG: Ran the following query in 17204ms:

[2025-01-27 05:42:53.486] DEBUG: Ran the following query in 17223ms:

[2025-01-27 05:42:53.496] DEBUG: Ran the following query in 14333ms:

[2025-01-27 05:42:53.528] DEBUG: Ran the following query in 17293ms:

[2025-01-27 05:42:53.563] DEBUG: Ran the following query in 17324ms:

[2025-01-27 05:42:53.617] DEBUG: Ran the following query in 17382ms:

[2025-01-27 05:42:53.618] DEBUG: Ran the following query in 17389ms:

[2025-01-27 05:42:53.632] DEBUG: Ran the following query in 17359ms:

[2025-01-27 05:42:54.374] DEBUG: Ran the following query in 18089ms:

[2025-01-27 05:42:54.380] DEBUG: Ran the following query in 18093ms:

[2025-01-27 05:42:54.416] DEBUG: Ran the following query in 18122ms:

[2025-01-27 05:42:54.420] DEBUG: Ran the following query in 17450ms:

[2025-01-27 05:42:54.427] DEBUG: Ran the following query in 14526ms:

[2025-01-27 05:42:54.437] DEBUG: Ran the following query in 18155ms:

[2025-01-27 05:42:55.936] DEBUG: Ran the following query in 19654ms:

[2025-01-27 05:42:55.978] DEBUG: Ran the following query in 19704ms:

[2025-01-27 05:42:56.021] DEBUG: Ran the following query in 19038ms:

[2025-01-27 05:42:56.837] DEBUG: Ran the following query in 19858ms:

[2025-01-27 05:42:56.841] DEBUG: Ran the following query in 19861ms:

[2025-01-27 05:42:56.868] DEBUG: Ran the following query in 15799ms:

[2025-01-27 05:42:56.885] DEBUG: Ran the following query in 19893ms:

[2025-01-27 05:43:06.144] DEBUG: Ran the following query in 29147ms:

[2025-01-27 05:43:06.157] DEBUG: Ran the following query in 29153ms:

[2025-01-27 05:43:06.161] DEBUG: Ran the following query in 29157ms:

[2025-01-27 05:43:06.184] DEBUG: Ran the following query in 29183ms:

[2025-01-27 05:43:06.212] DEBUG: Ran the following query in 29204ms:

[2025-01-27 05:43:06.228] DEBUG: Ran the following query in 29218ms:

[2025-01-27 05:43:06.235] DEBUG: Ran the following query in 29224ms:

[2025-01-27 05:43:06.265] DEBUG: Ran the following query in 29250ms:

[2025-01-27 05:43:06.282] DEBUG: Ran the following query in 29267ms:

[2025-01-27 05:43:06.312] DEBUG: Ran the following query in 29305ms:

[2025-01-27 05:43:06.318] DEBUG: Ran the following query in 29299ms:

[2025-01-27 05:43:06.346] DEBUG: Ran the following query in 29324ms:

[2025-01-27 05:43:06.357] DEBUG: Ran the following query in 29334ms:

[2025-01-27 05:43:06.399] DEBUG: Ran the following query in 29369ms:

[2025-01-27 05:43:06.419] DEBUG: Ran the following query in 29388ms:

[2025-01-27 05:43:06.469] DEBUG: Ran the following query in 29451ms:

[2025-01-27 05:43:06.476] DEBUG: Ran the following query in 29441ms:

[2025-01-27 05:43:06.527] DEBUG: Ran the following query in 28624ms:

[2025-01-27 05:43:06.531] DEBUG: Ran the following query in 28628ms:

[2025-01-27 05:43:06.545] DEBUG: Ran the following query in 28639ms:

[2025-01-27 05:43:06.554] DEBUG: Ran the following query in 28647ms:

[2025-01-27 05:43:06.599] DEBUG: Ran the following query in 29565ms:

[2025-01-27 05:43:06.600] DEBUG: Ran the following query in 24272ms:

[2025-01-27 05:43:06.623] DEBUG: Ran the following query in 29623ms:

[2025-01-27 05:43:08.556] DEBUG: Ran the following query in 30646ms:

[2025-01-27 05:43:08.572] DEBUG: Ran the following query in 31575ms:

[2025-01-27 05:43:08.615] DEBUG: Ran the following query in 31622ms:

[2025-01-27 05:43:08.669] DEBUG: Ran the following query in 30730ms:

[2025-01-27 05:43:11.030] DEBUG: Ran the following query in 33086ms:

[2025-01-27 05:43:11.040] DEBUG: Ran the following query in 26627ms:

[2025-01-27 05:43:12.107] DEBUG: Ran the following query in 34168ms:

[2025-01-27 05:43:12.154] DEBUG: Ran the following query in 34234ms:

[2025-01-27 05:43:12.160] DEBUG: Ran the following query in 34239ms:

[2025-01-27 05:43:13.380] DEBUG: Ran the following query in 35449ms:

[2025-01-27 05:43:13.390] DEBUG: Ran the following query in 35458ms:

[2025-01-27 05:43:13.423] DEBUG: Ran the following query in 35467ms:

[2025-01-27 05:43:14.584] DEBUG: Ran the following query in 36622ms:

[2025-01-27 05:43:15.728] DEBUG: Ran the following query in 36582ms:

[2025-01-27 05:43:15.743] DEBUG: Ran the following query in 36632ms:

[2025-01-27 05:43:15.777] DEBUG: Ran the following query in 36667ms:

[2025-01-27 05:43:15.782] DEBUG: Ran the following query in 37818ms:

[2025-01-27 05:43:16.970] DEBUG: Ran the following query in 31404ms:

[2025-01-27 05:43:16.976] DEBUG: Ran the following query in 39019ms:

[2025-01-27 05:43:17.011] DEBUG: Ran the following query in 37859ms:

[2025-01-27 05:43:18.223] DEBUG: Ran the following query in 39070ms:

[2025-01-27 05:43:19.382] DEBUG: Ran the following query in 40223ms:

[2025-01-27 05:43:19.382] DEBUG: Ran the following query in 32525ms:

[2025-01-27 05:43:19.394] DEBUG: Ran the following query in 40238ms:

[2025-01-27 05:43:20.581] DEBUG: Ran the following query in 41419ms:

[2025-01-27 05:43:20.588] DEBUG: Ran the following query in 41433ms:

[2025-01-27 05:43:20.591] DEBUG: Ran the following query in 41432ms:

[2025-01-27 05:43:20.616] DEBUG: Ran the following query in 40753ms:

[2025-01-27 05:43:20.619] DEBUG: Ran the following query in 40755ms:

[2025-01-27 05:43:20.625] DEBUG: Ran the following query in 27062ms:

[2025-01-27 05:43:20.628] DEBUG: Ran the following query in 40727ms:

[2025-01-27 05:43:20.643] DEBUG: Ran the following query in 39637ms:

[2025-01-27 05:43:20.647] DEBUG: Ran the following query in 39641ms:

[2025-01-27 05:43:20.655] DEBUG: Ran the following query in 39586ms:

[2025-01-27 05:43:20.662] DEBUG: Ran the following query in 24651ms:

[2025-01-27 05:43:21.868] DEBUG: Ran the following query in 39570ms:

[2025-01-27 05:43:21.902] DEBUG: Ran the following query in 39605ms:

[2025-01-27 05:43:21.904] DEBUG: Ran the following query in 25042ms:

[2025-01-27 05:43:21.912] DEBUG: Ran the following query in 39584ms:

[2025-01-27 05:43:21.967] DEBUG: Ran the following query in 37654ms:

[2025-01-27 05:43:25.512] DEBUG: Ran the following query in 41196ms:

[2025-01-27 05:43:25.556] DEBUG: Ran the following query in 41234ms:

[2025-01-27 05:43:25.603] DEBUG: Ran the following query in 41260ms:

[2025-01-27 05:43:25.605] DEBUG: Ran the following query in 41262ms:

[2025-01-27 05:43:25.617] DEBUG: Ran the following query in 41272ms:

[2025-01-27 05:43:25.622] DEBUG: Ran the following query in 41276ms:

[2025-01-27 05:43:25.645] DEBUG: Ran the following query in 41245ms:

[2025-01-27 05:43:25.648] DEBUG: Ran the following query in 41248ms:

[2025-01-27 05:43:25.658] DEBUG: Ran the following query in 41245ms:

[2025-01-27 05:43:25.658] DEBUG: Ran the following query in 17007ms:

[2025-01-27 05:43:25.670] DEBUG: Ran the following query in 41354ms:

[2025-01-27 05:43:26.890] DEBUG: Ran the following query in 42577ms:

[2025-01-27 05:43:26.909] DEBUG: Ran the following query in 42588ms:

[2025-01-27 05:43:26.915] DEBUG: Ran the following query in 41349ms:

[2025-01-27 05:43:26.922] DEBUG: Ran the following query in 13508ms:

[2025-01-27 05:43:26.929] DEBUG: Ran the following query in 40072ms:

[2025-01-27 05:43:26.936] DEBUG: Ran the following query in 9939ms:

[2025-01-27 05:43:26.945] DEBUG: Ran the following query in 33700ms:

[2025-01-27 05:43:28.151] DEBUG: Ran the following query in 34905ms:

[2025-01-27 05:43:28.161] DEBUG: Ran the following query in 34825ms:

[2025-01-27 05:43:28.164] DEBUG: Ran the following query in 34800ms:

[2025-01-27 05:43:28.166] DEBUG: Ran the following query in 34873ms:

[2025-01-27 05:43:28.169] DEBUG: Ran the following query in 34875ms:

[2025-01-27 05:43:28.176] DEBUG: Ran the following query in 34812ms:

[2025-01-27 05:43:28.188] DEBUG: Ran the following query in 34763ms:

[2025-01-27 05:43:28.191] DEBUG: Ran the following query in 34766ms:

[2025-01-27 05:43:28.198] DEBUG: Ran the following query in 34739ms:

[2025-01-27 05:43:28.201] DEBUG: Ran the following query in 34742ms:

[2025-01-27 05:43:28.206] DEBUG: Ran the following query in 34720ms:

[2025-01-27 05:43:28.209] DEBUG: Ran the following query in 34723ms:

[2025-01-27 05:43:28.214] DEBUG: Ran the following query in 34694ms:

[2025-01-27 05:43:28.216] DEBUG: Ran the following query in 34696ms:

[2025-01-27 05:43:28.222] DEBUG: Ran the following query in 34659ms:

[2025-01-27 05:43:28.228] DEBUG: Ran the following query in 33812ms:

[2025-01-27 05:43:28.230] DEBUG: Ran the following query in 33814ms:

[2025-01-27 05:43:28.236] DEBUG: Ran the following query in 33817ms:

[2025-01-27 05:43:28.241] DEBUG: Ran the following query in 33822ms:

[2025-01-27 05:43:28.256] DEBUG: Ran the following query in 32284ms:

[2025-01-27 05:43:28.259] DEBUG: Ran the following query in 32287ms:

[2025-01-27 05:43:28.280] DEBUG: Ran the following query in 32269ms:

[2025-01-27 05:43:28.286] DEBUG: Ran the following query in 31425ms:

[2025-01-27 05:43:28.292] DEBUG: Ran the following query in 7683ms:

[2025-01-27 05:43:28.297] DEBUG: Ran the following query in 34961ms:

[2025-01-27 05:43:28.303] DEBUG: Ran the following query in 34902ms:

[2025-01-27 05:43:28.306] DEBUG: Ran the following query in 34905ms:

[2025-01-27 05:43:28.316] DEBUG: Ran the following query in 22136ms:

[2025-01-27 05:43:28.322] DEBUG: Ran the following query in 22095ms:

[2025-01-27 05:43:28.324] DEBUG: Ran the following query in 22096ms:

[2025-01-27 05:43:28.329] DEBUG: Ran the following query in 22065ms:

[2025-01-27 05:43:28.331] DEBUG: Ran the following query in 22067ms:

[2025-01-27 05:43:28.336] DEBUG: Ran the following query in 22024ms:

[2025-01-27 05:43:28.338] DEBUG: Ran the following query in 22026ms:

[2025-01-27 05:43:28.349] DEBUG: Ran the following query in 22003ms:

[2025-01-27 05:43:28.352] DEBUG: Ran the following query in 22173ms:

[2025-01-27 05:43:28.358] DEBUG: Ran the following query in 21958ms:

[2025-01-27 05:43:28.360] DEBUG: Ran the following query in 22014ms:

[2025-01-27 05:43:28.365] DEBUG: Ran the following query in 21896ms:

[2025-01-27 05:43:28.367] DEBUG: Ran the following query in 21898ms:

[2025-01-27 05:43:28.373] DEBUG: Ran the following query in 21847ms:

[2025-01-27 05:43:28.375] DEBUG: Ran the following query in 21849ms:

[2025-01-27 05:43:28.381] DEBUG: Ran the following query in 21783ms:

[2025-01-27 05:43:28.383] DEBUG: Ran the following query in 22179ms:

[2025-01-27 05:43:28.385] DEBUG: Ran the following query in 19782ms:

[2025-01-27 05:43:28.388] DEBUG: Ran the following query in 21789ms:

[2025-01-27 05:43:28.393] DEBUG: Ran the following query in 19742ms:

[2025-01-27 05:43:28.399] DEBUG: Ran the following query in 6503ms:

[2025-01-27 05:43:28.416] DEBUG: Ran the following query in 19813ms:

[2025-01-27 05:43:28.422] DEBUG: Ran the following query in 22023ms:

[2025-01-27 05:43:28.428] DEBUG: Ran the following query in 22223ms:

[2025-01-27 05:43:28.441] DEBUG: Ran the following query in 16339ms:

[2025-01-27 05:43:28.446] DEBUG: Ran the following query in 16292ms:

[2025-01-27 05:43:28.448] DEBUG: Ran the following query in 15034ms:

[2025-01-27 05:43:28.453] DEBUG: Ran the following query in 12682ms:

[2025-01-27 05:43:28.456] DEBUG: Ran the following query in 15076ms:

[2025-01-27 05:43:28.458] DEBUG: Ran the following query in 11489ms:

[2025-01-27 05:43:28.460] DEBUG: Ran the following query in 15080ms:

[2025-01-27 05:43:28.466] DEBUG: Ran the following query in 11469ms:

[2025-01-27 05:43:28.471] DEBUG: Ran the following query in 9090ms:

[2025-01-27 05:43:28.473] DEBUG: Ran the following query in 11503ms:

[2025-01-27 05:43:28.478] DEBUG: Ran the following query in 12707ms:

[2025-01-27 05:43:28.484] DEBUG: Ran the following query in 7903ms:

[2025-01-27 05:43:28.487] DEBUG: Ran the following query in 7878ms:

[2025-01-27 05:43:28.492] DEBUG: Ran the following query in 1583ms:

[2025-01-27 05:43:28.495] DEBUG: Ran the following query in 16392ms:

[2025-01-27 05:43:28.537] DEBUG: Ran the following query in 9156ms:

[2025-01-27 05:43:28.547] DEBUG: Ran the following query in 7966ms:

[2025-01-27 05:43:28.556] DEBUG: Ran the following query in 16402ms:

[2025-01-27 05:43:28.626] DEBUG: Ran the following query in 6730ms:

[2025-01-27 05:43:28.634] DEBUG: Ran the following query in 1725ms:

[2025-01-27 05:43:28.638] DEBUG: Ran the following query in 382ms:

[2025-01-27 05:43:28.639] DEBUG: Ran the following query in 383ms:

[2025-01-27 05:43:28.642] DEBUG: Ran the following query in 3098ms:

[2025-01-27 05:43:28.644] DEBUG: Ran the following query in 2999ms:

[2025-01-27 05:43:28.648] DEBUG: Ran the following query in 3046ms:

[2025-01-27 05:43:28.651] DEBUG: Ran the following query in 3049ms:

[2025-01-27 05:43:28.656] DEBUG: Ran the following query in 3112ms:

[2025-01-27 05:43:28.661] DEBUG: Ran the following query in 3015ms:

[2025-01-27 05:43:30.442] DEBUG: Ran the following query in 45ms:

[2025-01-27 05:43:30.444] DEBUG: Ran the following query in 45ms:
`

@ScuttleSE commented on GitHub (Jan 27, 2025): > I see. > > I will ask you again to still provide the rest of the details I asked for above, except for the Chrome timing, since based on what you said I now think the issue is indeed not with cover image loading, but rather with concurrent page fetch requests. > > Can you please let me know: > > * What sort order is selected? > > * When you first load the library page (i.e. the top books according to the sort order, before scrolling), how much time does it take to load the page? > > * How many books are visible on the screen > > * How do you scroll? with pgup/pgdn keys, or with the mouse wheel? * Title, descending * The first library page loads fast, about 25 books, the queries takes a few milliseconds. * 25 * Mouse pulling the scrollbar all the way to the bottom. Out of curiosity, I logged the queries that occurred after the library was loaded and I used the scrollbar to go all the way to the bottom. 342 queries, almost all of them taking more and more time. `[2025-01-27 05:41:50.925] DEBUG: Ran the following query in 4ms: [2025-01-27 05:41:50.956] DEBUG: Ran the following query in 28ms: [2025-01-27 05:41:50.975] DEBUG: Ran the following query in 15ms: [2025-01-27 05:41:50.981] DEBUG: Ran the following query in 2ms: [2025-01-27 05:41:50.988] DEBUG: Ran the following query in 5ms: [2025-01-27 05:41:51.000] DEBUG: Ran the following query in 9ms: [2025-01-27 05:41:51.011] DEBUG: Ran the following query in 8ms: [2025-01-27 05:41:51.058] DEBUG: Ran the following query in 6ms: [2025-01-27 05:41:51.061] DEBUG: Ran the following query in 1ms: [2025-01-27 05:41:51.069] DEBUG: Ran the following query in 6ms: [2025-01-27 05:41:51.070] DEBUG: Ran the following query in 4ms: [2025-01-27 05:41:51.075] DEBUG: Ran the following query in 2ms: [2025-01-27 05:41:51.128] DEBUG: Ran the following query in 42ms: [2025-01-27 05:42:04.351] DEBUG: Ran the following query in 31ms: [2025-01-27 05:42:04.414] DEBUG: Ran the following query in 1ms: [2025-01-27 05:42:04.478] DEBUG: Ran the following query in 2ms: [2025-01-27 05:42:04.489] DEBUG: Ran the following query in 7ms: [2025-01-27 05:42:04.492] DEBUG: Ran the following query in 1ms: [2025-01-27 05:42:04.495] DEBUG: Ran the following query in 1ms: [2025-01-27 05:42:04.625] DEBUG: Ran the following query in 121ms: [2025-01-27 05:42:04.627] DEBUG: Ran the following query in 1ms: [2025-01-27 05:42:04.629] DEBUG: Ran the following query in 1ms: [2025-01-27 05:42:04.713] DEBUG: Ran the following query in 82ms: [2025-01-27 05:42:04.908] DEBUG: Ran the following query in 4ms: [2025-01-27 05:42:04.919] DEBUG: Ran the following query in 4ms: [2025-01-27 05:42:04.939] DEBUG: Ran the following query in 2ms: [2025-01-27 05:42:04.943] DEBUG: Ran the following query in 2ms: [2025-01-27 05:42:05.072] DEBUG: Ran the following query in 27ms: [2025-01-27 05:42:05.074] DEBUG: Ran the following query in 52ms: [2025-01-27 05:42:05.088] DEBUG: Ran the following query in 64ms: [2025-01-27 05:42:05.127] DEBUG: Ran the following query in 42ms: [2025-01-27 05:42:05.130] DEBUG: Ran the following query in 42ms: [2025-01-27 05:42:05.143] DEBUG: Ran the following query in 2ms: [2025-01-27 05:42:05.146] DEBUG: Ran the following query in 5ms: [2025-01-27 05:42:05.193] DEBUG: Ran the following query in 34ms: [2025-01-27 05:42:05.251] DEBUG: Ran the following query in 90ms: [2025-01-27 05:42:05.316] DEBUG: Ran the following query in 57ms: [2025-01-27 05:42:05.325] DEBUG: Ran the following query in 69ms: [2025-01-27 05:42:05.327] DEBUG: Ran the following query in 2ms: [2025-01-27 05:42:05.329] DEBUG: Ran the following query in 4ms: [2025-01-27 05:42:05.343] DEBUG: Ran the following query in 5ms: [2025-01-27 05:42:05.344] DEBUG: Ran the following query in 4ms: [2025-01-27 05:42:05.355] DEBUG: Ran the following query in 6ms: [2025-01-27 05:42:05.457] DEBUG: Ran the following query in 81ms: [2025-01-27 05:42:05.466] DEBUG: Ran the following query in 4ms: [2025-01-27 05:42:05.487] DEBUG: Ran the following query in 11ms: [2025-01-27 05:42:05.519] DEBUG: Ran the following query in 41ms: [2025-01-27 05:42:05.538] DEBUG: Ran the following query in 3ms: [2025-01-27 05:42:05.540] DEBUG: Ran the following query in 4ms: [2025-01-27 05:42:05.562] DEBUG: Ran the following query in 16ms: [2025-01-27 05:42:05.564] DEBUG: Ran the following query in 15ms: [2025-01-27 05:42:05.570] DEBUG: Ran the following query in 2ms: [2025-01-27 05:42:05.571] DEBUG: Ran the following query in 3ms: [2025-01-27 05:42:05.581] DEBUG: Ran the following query in 5ms: [2025-01-27 05:42:05.582] DEBUG: Ran the following query in 4ms: [2025-01-27 05:42:24.263] DEBUG: Ran the following query in 3ms: [2025-01-27 05:42:24.330] DEBUG: Ran the following query in 52ms: [2025-01-27 05:42:24.507] DEBUG: Ran the following query in 225ms: [2025-01-27 05:42:24.568] DEBUG: Ran the following query in 11ms: [2025-01-27 05:42:24.577] DEBUG: Ran the following query in 20ms: [2025-01-27 05:42:35.448] DEBUG: Ran the following query in 4ms: [2025-01-27 05:42:35.525] DEBUG: Ran the following query in 51ms: [2025-01-27 05:42:35.527] DEBUG: Ran the following query in 38ms: [2025-01-27 05:42:35.737] DEBUG: Ran the following query in 258ms: [2025-01-27 05:42:35.934] DEBUG: Ran the following query in 423ms: [2025-01-27 05:42:35.939] DEBUG: Ran the following query in 135ms: [2025-01-27 05:42:35.945] DEBUG: Ran the following query in 424ms: [2025-01-27 05:42:35.949] DEBUG: Ran the following query in 106ms: [2025-01-27 05:42:35.978] DEBUG: Ran the following query in 248ms: [2025-01-27 05:42:35.978] DEBUG: Ran the following query in 128ms: [2025-01-27 05:42:36.152] DEBUG: Ran the following query in 421ms: [2025-01-27 05:42:36.176] DEBUG: Ran the following query in 277ms: [2025-01-27 05:42:36.192] DEBUG: Ran the following query in 422ms: [2025-01-27 05:42:36.195] DEBUG: Ran the following query in 286ms: [2025-01-27 05:42:36.202] DEBUG: Ran the following query in 283ms: [2025-01-27 05:42:36.208] DEBUG: Ran the following query in 438ms: [2025-01-27 05:42:36.221] DEBUG: Ran the following query in 436ms: [2025-01-27 05:42:36.226] DEBUG: Ran the following query in 298ms: [2025-01-27 05:42:36.232] DEBUG: Ran the following query in 444ms: [2025-01-27 05:42:36.236] DEBUG: Ran the following query in 443ms: [2025-01-27 05:42:36.240] DEBUG: Ran the following query in 438ms: [2025-01-27 05:42:36.244] DEBUG: Ran the following query in 313ms: [2025-01-27 05:42:36.247] DEBUG: Ran the following query in 457ms: [2025-01-27 05:42:36.251] DEBUG: Ran the following query in 453ms: [2025-01-27 05:42:36.255] DEBUG: Ran the following query in 464ms: [2025-01-27 05:42:36.260] DEBUG: Ran the following query in 472ms: [2025-01-27 05:42:36.270] DEBUG: Ran the following query in 456ms: [2025-01-27 05:42:36.279] DEBUG: Ran the following query in 471ms: [2025-01-27 05:42:36.283] DEBUG: Ran the following query in 472ms: [2025-01-27 05:42:36.949] DEBUG: Ran the following query in 1007ms: [2025-01-27 05:42:36.977] DEBUG: Ran the following query in 1130ms: [2025-01-27 05:42:36.981] DEBUG: Ran the following query in 1027ms: [2025-01-27 05:42:36.989] DEBUG: Ran the following query in 1135ms: [2025-01-27 05:42:36.994] DEBUG: Ran the following query in 1131ms: [2025-01-27 05:42:36.997] DEBUG: Ran the following query in 1137ms: [2025-01-27 05:42:37.001] DEBUG: Ran the following query in 1134ms: [2025-01-27 05:42:37.005] DEBUG: Ran the following query in 1149ms: [2025-01-27 05:42:37.008] DEBUG: Ran the following query in 1120ms: [2025-01-27 05:42:37.012] DEBUG: Ran the following query in 1121ms: [2025-01-27 05:42:37.015] DEBUG: Ran the following query in 1122ms: [2025-01-27 05:42:37.019] DEBUG: Ran the following query in 1124ms: [2025-01-27 05:42:37.023] DEBUG: Ran the following query in 1126ms: [2025-01-27 05:42:37.031] DEBUG: Ran the following query in 1145ms: [2025-01-27 05:42:37.876] DEBUG: Ran the following query in 1894ms: [2025-01-27 05:42:37.903] DEBUG: Ran the following query in 2023ms: [2025-01-27 05:42:37.908] DEBUG: Ran the following query in 2024ms: [2025-01-27 05:42:37.917] DEBUG: Ran the following query in 2016ms: [2025-01-27 05:42:37.928] DEBUG: Ran the following query in 1739ms: [2025-01-27 05:42:37.934] DEBUG: Ran the following query in 2026ms: [2025-01-27 05:42:37.940] DEBUG: Ran the following query in 2036ms: [2025-01-27 05:42:37.951] DEBUG: Ran the following query in 2040ms: [2025-01-27 05:42:37.958] DEBUG: Ran the following query in 2044ms: [2025-01-27 05:42:37.965] DEBUG: Ran the following query in 2049ms: [2025-01-27 05:42:39.118] DEBUG: Ran the following query in 2919ms: [2025-01-27 05:42:39.149] DEBUG: Ran the following query in 3223ms: [2025-01-27 05:42:39.153] DEBUG: Ran the following query in 3231ms: [2025-01-27 05:42:39.156] DEBUG: Ran the following query in 3232ms: [2025-01-27 05:42:39.160] DEBUG: Ran the following query in 2940ms: [2025-01-27 05:42:39.193] DEBUG: Ran the following query in 3255ms: [2025-01-27 05:42:39.846] DEBUG: Ran the following query in 3907ms: [2025-01-27 05:42:39.863] DEBUG: Ran the following query in 3922ms: [2025-01-27 05:42:39.877] DEBUG: Ran the following query in 3613ms: [2025-01-27 05:42:39.932] DEBUG: Ran the following query in 3985ms: [2025-01-27 05:42:40.745] DEBUG: Ran the following query in 4793ms: [2025-01-27 05:42:41.015] DEBUG: Ran the following query in 5067ms: [2025-01-27 05:42:41.069] DEBUG: Ran the following query in 4099ms: [2025-01-27 05:42:41.073] DEBUG: Ran the following query in 5122ms: [2025-01-27 05:42:41.081] DEBUG: Ran the following query in 5103ms: [2025-01-27 05:42:42.306] DEBUG: Ran the following query in 5322ms: [2025-01-27 05:42:42.329] DEBUG: Ran the following query in 6348ms: [2025-01-27 05:42:42.353] DEBUG: Ran the following query in 6347ms: [2025-01-27 05:42:44.313] DEBUG: Ran the following query in 8266ms: [2025-01-27 05:42:44.317] DEBUG: Ran the following query in 8141ms: [2025-01-27 05:42:44.319] DEBUG: Ran the following query in 8188ms: [2025-01-27 05:42:44.326] DEBUG: Ran the following query in 8146ms: [2025-01-27 05:42:44.343] DEBUG: Ran the following query in 8160ms: [2025-01-27 05:42:44.369] DEBUG: Ran the following query in 6457ms: [2025-01-27 05:42:44.410] DEBUG: Ran the following query in 8322ms: [2025-01-27 05:42:44.414] DEBUG: Ran the following query in 8235ms: [2025-01-27 05:42:44.414] DEBUG: Ran the following query in 8238ms: [2025-01-27 05:42:44.435] DEBUG: Ran the following query in 8237ms: [2025-01-27 05:42:45.544] DEBUG: Ran the following query in 7599ms: [2025-01-27 05:42:45.665] DEBUG: Ran the following query in 9459ms: [2025-01-27 05:42:46.840] DEBUG: Ran the following query in 10633ms: [2025-01-27 05:42:46.857] DEBUG: Ran the following query in 7711ms: [2025-01-27 05:42:46.883] DEBUG: Ran the following query in 10659ms: [2025-01-27 05:42:52.887] DEBUG: Ran the following query in 16662ms: [2025-01-27 05:42:53.265] DEBUG: Ran the following query in 17035ms: [2025-01-27 05:42:53.303] DEBUG: Ran the following query in 17064ms: [2025-01-27 05:42:53.336] DEBUG: Ran the following query in 17094ms: [2025-01-27 05:42:53.341] DEBUG: Ran the following query in 17098ms: [2025-01-27 05:42:53.364] DEBUG: Ran the following query in 17118ms: [2025-01-27 05:42:53.373] DEBUG: Ran the following query in 17126ms: [2025-01-27 05:42:53.401] DEBUG: Ran the following query in 17151ms: [2025-01-27 05:42:53.405] DEBUG: Ran the following query in 17154ms: [2025-01-27 05:42:53.425] DEBUG: Ran the following query in 17171ms: [2025-01-27 05:42:53.432] DEBUG: Ran the following query in 17177ms: [2025-01-27 05:42:53.459] DEBUG: Ran the following query in 17201ms: [2025-01-27 05:42:53.463] DEBUG: Ran the following query in 17204ms: [2025-01-27 05:42:53.486] DEBUG: Ran the following query in 17223ms: [2025-01-27 05:42:53.496] DEBUG: Ran the following query in 14333ms: [2025-01-27 05:42:53.528] DEBUG: Ran the following query in 17293ms: [2025-01-27 05:42:53.563] DEBUG: Ran the following query in 17324ms: [2025-01-27 05:42:53.617] DEBUG: Ran the following query in 17382ms: [2025-01-27 05:42:53.618] DEBUG: Ran the following query in 17389ms: [2025-01-27 05:42:53.632] DEBUG: Ran the following query in 17359ms: [2025-01-27 05:42:54.374] DEBUG: Ran the following query in 18089ms: [2025-01-27 05:42:54.380] DEBUG: Ran the following query in 18093ms: [2025-01-27 05:42:54.416] DEBUG: Ran the following query in 18122ms: [2025-01-27 05:42:54.420] DEBUG: Ran the following query in 17450ms: [2025-01-27 05:42:54.427] DEBUG: Ran the following query in 14526ms: [2025-01-27 05:42:54.437] DEBUG: Ran the following query in 18155ms: [2025-01-27 05:42:55.936] DEBUG: Ran the following query in 19654ms: [2025-01-27 05:42:55.978] DEBUG: Ran the following query in 19704ms: [2025-01-27 05:42:56.021] DEBUG: Ran the following query in 19038ms: [2025-01-27 05:42:56.837] DEBUG: Ran the following query in 19858ms: [2025-01-27 05:42:56.841] DEBUG: Ran the following query in 19861ms: [2025-01-27 05:42:56.868] DEBUG: Ran the following query in 15799ms: [2025-01-27 05:42:56.885] DEBUG: Ran the following query in 19893ms: [2025-01-27 05:43:06.144] DEBUG: Ran the following query in 29147ms: [2025-01-27 05:43:06.157] DEBUG: Ran the following query in 29153ms: [2025-01-27 05:43:06.161] DEBUG: Ran the following query in 29157ms: [2025-01-27 05:43:06.184] DEBUG: Ran the following query in 29183ms: [2025-01-27 05:43:06.212] DEBUG: Ran the following query in 29204ms: [2025-01-27 05:43:06.228] DEBUG: Ran the following query in 29218ms: [2025-01-27 05:43:06.235] DEBUG: Ran the following query in 29224ms: [2025-01-27 05:43:06.265] DEBUG: Ran the following query in 29250ms: [2025-01-27 05:43:06.282] DEBUG: Ran the following query in 29267ms: [2025-01-27 05:43:06.312] DEBUG: Ran the following query in 29305ms: [2025-01-27 05:43:06.318] DEBUG: Ran the following query in 29299ms: [2025-01-27 05:43:06.346] DEBUG: Ran the following query in 29324ms: [2025-01-27 05:43:06.357] DEBUG: Ran the following query in 29334ms: [2025-01-27 05:43:06.399] DEBUG: Ran the following query in 29369ms: [2025-01-27 05:43:06.419] DEBUG: Ran the following query in 29388ms: [2025-01-27 05:43:06.469] DEBUG: Ran the following query in 29451ms: [2025-01-27 05:43:06.476] DEBUG: Ran the following query in 29441ms: [2025-01-27 05:43:06.527] DEBUG: Ran the following query in 28624ms: [2025-01-27 05:43:06.531] DEBUG: Ran the following query in 28628ms: [2025-01-27 05:43:06.545] DEBUG: Ran the following query in 28639ms: [2025-01-27 05:43:06.554] DEBUG: Ran the following query in 28647ms: [2025-01-27 05:43:06.599] DEBUG: Ran the following query in 29565ms: [2025-01-27 05:43:06.600] DEBUG: Ran the following query in 24272ms: [2025-01-27 05:43:06.623] DEBUG: Ran the following query in 29623ms: [2025-01-27 05:43:08.556] DEBUG: Ran the following query in 30646ms: [2025-01-27 05:43:08.572] DEBUG: Ran the following query in 31575ms: [2025-01-27 05:43:08.615] DEBUG: Ran the following query in 31622ms: [2025-01-27 05:43:08.669] DEBUG: Ran the following query in 30730ms: [2025-01-27 05:43:11.030] DEBUG: Ran the following query in 33086ms: [2025-01-27 05:43:11.040] DEBUG: Ran the following query in 26627ms: [2025-01-27 05:43:12.107] DEBUG: Ran the following query in 34168ms: [2025-01-27 05:43:12.154] DEBUG: Ran the following query in 34234ms: [2025-01-27 05:43:12.160] DEBUG: Ran the following query in 34239ms: [2025-01-27 05:43:13.380] DEBUG: Ran the following query in 35449ms: [2025-01-27 05:43:13.390] DEBUG: Ran the following query in 35458ms: [2025-01-27 05:43:13.423] DEBUG: Ran the following query in 35467ms: [2025-01-27 05:43:14.584] DEBUG: Ran the following query in 36622ms: [2025-01-27 05:43:15.728] DEBUG: Ran the following query in 36582ms: [2025-01-27 05:43:15.743] DEBUG: Ran the following query in 36632ms: [2025-01-27 05:43:15.777] DEBUG: Ran the following query in 36667ms: [2025-01-27 05:43:15.782] DEBUG: Ran the following query in 37818ms: [2025-01-27 05:43:16.970] DEBUG: Ran the following query in 31404ms: [2025-01-27 05:43:16.976] DEBUG: Ran the following query in 39019ms: [2025-01-27 05:43:17.011] DEBUG: Ran the following query in 37859ms: [2025-01-27 05:43:18.223] DEBUG: Ran the following query in 39070ms: [2025-01-27 05:43:19.382] DEBUG: Ran the following query in 40223ms: [2025-01-27 05:43:19.382] DEBUG: Ran the following query in 32525ms: [2025-01-27 05:43:19.394] DEBUG: Ran the following query in 40238ms: [2025-01-27 05:43:20.581] DEBUG: Ran the following query in 41419ms: [2025-01-27 05:43:20.588] DEBUG: Ran the following query in 41433ms: [2025-01-27 05:43:20.591] DEBUG: Ran the following query in 41432ms: [2025-01-27 05:43:20.616] DEBUG: Ran the following query in 40753ms: [2025-01-27 05:43:20.619] DEBUG: Ran the following query in 40755ms: [2025-01-27 05:43:20.625] DEBUG: Ran the following query in 27062ms: [2025-01-27 05:43:20.628] DEBUG: Ran the following query in 40727ms: [2025-01-27 05:43:20.643] DEBUG: Ran the following query in 39637ms: [2025-01-27 05:43:20.647] DEBUG: Ran the following query in 39641ms: [2025-01-27 05:43:20.655] DEBUG: Ran the following query in 39586ms: [2025-01-27 05:43:20.662] DEBUG: Ran the following query in 24651ms: [2025-01-27 05:43:21.868] DEBUG: Ran the following query in 39570ms: [2025-01-27 05:43:21.902] DEBUG: Ran the following query in 39605ms: [2025-01-27 05:43:21.904] DEBUG: Ran the following query in 25042ms: [2025-01-27 05:43:21.912] DEBUG: Ran the following query in 39584ms: [2025-01-27 05:43:21.967] DEBUG: Ran the following query in 37654ms: [2025-01-27 05:43:25.512] DEBUG: Ran the following query in 41196ms: [2025-01-27 05:43:25.556] DEBUG: Ran the following query in 41234ms: [2025-01-27 05:43:25.603] DEBUG: Ran the following query in 41260ms: [2025-01-27 05:43:25.605] DEBUG: Ran the following query in 41262ms: [2025-01-27 05:43:25.617] DEBUG: Ran the following query in 41272ms: [2025-01-27 05:43:25.622] DEBUG: Ran the following query in 41276ms: [2025-01-27 05:43:25.645] DEBUG: Ran the following query in 41245ms: [2025-01-27 05:43:25.648] DEBUG: Ran the following query in 41248ms: [2025-01-27 05:43:25.658] DEBUG: Ran the following query in 41245ms: [2025-01-27 05:43:25.658] DEBUG: Ran the following query in 17007ms: [2025-01-27 05:43:25.670] DEBUG: Ran the following query in 41354ms: [2025-01-27 05:43:26.890] DEBUG: Ran the following query in 42577ms: [2025-01-27 05:43:26.909] DEBUG: Ran the following query in 42588ms: [2025-01-27 05:43:26.915] DEBUG: Ran the following query in 41349ms: [2025-01-27 05:43:26.922] DEBUG: Ran the following query in 13508ms: [2025-01-27 05:43:26.929] DEBUG: Ran the following query in 40072ms: [2025-01-27 05:43:26.936] DEBUG: Ran the following query in 9939ms: [2025-01-27 05:43:26.945] DEBUG: Ran the following query in 33700ms: [2025-01-27 05:43:28.151] DEBUG: Ran the following query in 34905ms: [2025-01-27 05:43:28.161] DEBUG: Ran the following query in 34825ms: [2025-01-27 05:43:28.164] DEBUG: Ran the following query in 34800ms: [2025-01-27 05:43:28.166] DEBUG: Ran the following query in 34873ms: [2025-01-27 05:43:28.169] DEBUG: Ran the following query in 34875ms: [2025-01-27 05:43:28.176] DEBUG: Ran the following query in 34812ms: [2025-01-27 05:43:28.188] DEBUG: Ran the following query in 34763ms: [2025-01-27 05:43:28.191] DEBUG: Ran the following query in 34766ms: [2025-01-27 05:43:28.198] DEBUG: Ran the following query in 34739ms: [2025-01-27 05:43:28.201] DEBUG: Ran the following query in 34742ms: [2025-01-27 05:43:28.206] DEBUG: Ran the following query in 34720ms: [2025-01-27 05:43:28.209] DEBUG: Ran the following query in 34723ms: [2025-01-27 05:43:28.214] DEBUG: Ran the following query in 34694ms: [2025-01-27 05:43:28.216] DEBUG: Ran the following query in 34696ms: [2025-01-27 05:43:28.222] DEBUG: Ran the following query in 34659ms: [2025-01-27 05:43:28.228] DEBUG: Ran the following query in 33812ms: [2025-01-27 05:43:28.230] DEBUG: Ran the following query in 33814ms: [2025-01-27 05:43:28.236] DEBUG: Ran the following query in 33817ms: [2025-01-27 05:43:28.241] DEBUG: Ran the following query in 33822ms: [2025-01-27 05:43:28.256] DEBUG: Ran the following query in 32284ms: [2025-01-27 05:43:28.259] DEBUG: Ran the following query in 32287ms: [2025-01-27 05:43:28.280] DEBUG: Ran the following query in 32269ms: [2025-01-27 05:43:28.286] DEBUG: Ran the following query in 31425ms: [2025-01-27 05:43:28.292] DEBUG: Ran the following query in 7683ms: [2025-01-27 05:43:28.297] DEBUG: Ran the following query in 34961ms: [2025-01-27 05:43:28.303] DEBUG: Ran the following query in 34902ms: [2025-01-27 05:43:28.306] DEBUG: Ran the following query in 34905ms: [2025-01-27 05:43:28.316] DEBUG: Ran the following query in 22136ms: [2025-01-27 05:43:28.322] DEBUG: Ran the following query in 22095ms: [2025-01-27 05:43:28.324] DEBUG: Ran the following query in 22096ms: [2025-01-27 05:43:28.329] DEBUG: Ran the following query in 22065ms: [2025-01-27 05:43:28.331] DEBUG: Ran the following query in 22067ms: [2025-01-27 05:43:28.336] DEBUG: Ran the following query in 22024ms: [2025-01-27 05:43:28.338] DEBUG: Ran the following query in 22026ms: [2025-01-27 05:43:28.349] DEBUG: Ran the following query in 22003ms: [2025-01-27 05:43:28.352] DEBUG: Ran the following query in 22173ms: [2025-01-27 05:43:28.358] DEBUG: Ran the following query in 21958ms: [2025-01-27 05:43:28.360] DEBUG: Ran the following query in 22014ms: [2025-01-27 05:43:28.365] DEBUG: Ran the following query in 21896ms: [2025-01-27 05:43:28.367] DEBUG: Ran the following query in 21898ms: [2025-01-27 05:43:28.373] DEBUG: Ran the following query in 21847ms: [2025-01-27 05:43:28.375] DEBUG: Ran the following query in 21849ms: [2025-01-27 05:43:28.381] DEBUG: Ran the following query in 21783ms: [2025-01-27 05:43:28.383] DEBUG: Ran the following query in 22179ms: [2025-01-27 05:43:28.385] DEBUG: Ran the following query in 19782ms: [2025-01-27 05:43:28.388] DEBUG: Ran the following query in 21789ms: [2025-01-27 05:43:28.393] DEBUG: Ran the following query in 19742ms: [2025-01-27 05:43:28.399] DEBUG: Ran the following query in 6503ms: [2025-01-27 05:43:28.416] DEBUG: Ran the following query in 19813ms: [2025-01-27 05:43:28.422] DEBUG: Ran the following query in 22023ms: [2025-01-27 05:43:28.428] DEBUG: Ran the following query in 22223ms: [2025-01-27 05:43:28.441] DEBUG: Ran the following query in 16339ms: [2025-01-27 05:43:28.446] DEBUG: Ran the following query in 16292ms: [2025-01-27 05:43:28.448] DEBUG: Ran the following query in 15034ms: [2025-01-27 05:43:28.453] DEBUG: Ran the following query in 12682ms: [2025-01-27 05:43:28.456] DEBUG: Ran the following query in 15076ms: [2025-01-27 05:43:28.458] DEBUG: Ran the following query in 11489ms: [2025-01-27 05:43:28.460] DEBUG: Ran the following query in 15080ms: [2025-01-27 05:43:28.466] DEBUG: Ran the following query in 11469ms: [2025-01-27 05:43:28.471] DEBUG: Ran the following query in 9090ms: [2025-01-27 05:43:28.473] DEBUG: Ran the following query in 11503ms: [2025-01-27 05:43:28.478] DEBUG: Ran the following query in 12707ms: [2025-01-27 05:43:28.484] DEBUG: Ran the following query in 7903ms: [2025-01-27 05:43:28.487] DEBUG: Ran the following query in 7878ms: [2025-01-27 05:43:28.492] DEBUG: Ran the following query in 1583ms: [2025-01-27 05:43:28.495] DEBUG: Ran the following query in 16392ms: [2025-01-27 05:43:28.537] DEBUG: Ran the following query in 9156ms: [2025-01-27 05:43:28.547] DEBUG: Ran the following query in 7966ms: [2025-01-27 05:43:28.556] DEBUG: Ran the following query in 16402ms: [2025-01-27 05:43:28.626] DEBUG: Ran the following query in 6730ms: [2025-01-27 05:43:28.634] DEBUG: Ran the following query in 1725ms: [2025-01-27 05:43:28.638] DEBUG: Ran the following query in 382ms: [2025-01-27 05:43:28.639] DEBUG: Ran the following query in 383ms: [2025-01-27 05:43:28.642] DEBUG: Ran the following query in 3098ms: [2025-01-27 05:43:28.644] DEBUG: Ran the following query in 2999ms: [2025-01-27 05:43:28.648] DEBUG: Ran the following query in 3046ms: [2025-01-27 05:43:28.651] DEBUG: Ran the following query in 3049ms: [2025-01-27 05:43:28.656] DEBUG: Ran the following query in 3112ms: [2025-01-27 05:43:28.661] DEBUG: Ran the following query in 3015ms: [2025-01-27 05:43:30.442] DEBUG: Ran the following query in 45ms: [2025-01-27 05:43:30.444] DEBUG: Ran the following query in 45ms: `
Author
Owner

@ScuttleSE commented on GitHub (Jan 27, 2025):

Almost all of the queries at similar to this one:

SELECT bookAuthor.id, bookAuthor.authorId, bookAuthor.createdAt, bookAuthor.bookId, author.id ASauthor.id, author.nameASauthor.nameFROMbookAuthorsASbookAuthor LEFT OUTER JOINauthorsASauthorONbookAuthor.authorId=author.idWHEREbookAuthor.bookIdIN ('cce1cccd-16a9-4526-a8c6-e351720dea05', '70a19088-5291-40ef-99f9-099355ab1c55', '2ca1c76b-6166-405b-9fb9-fcd91a31a3f1', '3f5708b1-c1bd-4ddd-9ce1-a22a51168952', '5fc117d1-5a68-43de-9cbb-edb9c3380664', '6714cfe4-3ccb-4540-97ca-0a80987b676f', 'f0dc204c-5e3e-470d-9a6e-0f97db69bf7a', 'a2a6a223-558e-4efd-bbcf-0f319377978d', '01cc19d2-e855-4046-83a1-a9adf4350e1a', '826c106a-17af-40f2-b72d-37f78104303c', 'a270e6ba-69b9-4ac6-9b03-afd22c99b35f', '5e184ebd-71bc-417b-833a-b435b2ba0dea', 'd21992d2-1ddb-4dcd-b028-264bd27948db', 'dfc1bc55-defa-4be2-ad44-30f6625784c6', '1f25cd61-f3b4-4b8c-8001-3ba8f3cc59dd', '45d35118-313e-4b38-a057-2e1076c5b1a3', '008314ae-ac23-450a-934d-2a6464987da5', '17f9ae17-abe4-4c73-ad9e-2c5c8d3018c4', '15720dd1-a67d-4ba0-b84e-d8c69e093d02', '48fa1bf3-4ccd-47d1-a5e2-eda5ffd58629', '1c5b3e53-9d52-48f8-93a6-7374dbd55de4', '08af8dbf-89dd-4864-88f1-64cc3a120d24', 'aff1ebfc-5f4b-46f9-866d-09c98263f8d8', 'deb7d449-ff7c-4abd-9a61-48466d1eaa80', 'ae0eb3c5-d6ac-4936-8aa3-a7d290f38016', 'd73dfde1-086e-4b73-92b4-a9ccd9de7422', '1d944758-37f4-458a-b8eb-eb1dbf00815b', '4faba6ea-e1dc-48b6-9585-a023eb5237c6', '8db683d2-98ef-4c85-9fa6-bd8fed8474e7', '35def283-fa45-48f7-8c8e-005eb0b3aba9', '919f5175-c789-4e36-88c9-023814caf063', '70ba7717-6506-4914-bcb6-999a93f9a626', '2c2f9f97-3171-45d3-bdd8-ffba2ac04f3a', '0a6c7b10-a687-45b0-9a30-308a23514e31', '410505ce-0e15-4b31-bf77-587d35bb15fc') ORDER BYbookAuthor.createdAtASC;

@ScuttleSE commented on GitHub (Jan 27, 2025): Almost all of the queries at similar to this one: `SELECT `bookAuthor`.`id`, `bookAuthor`.`authorId`, `bookAuthor`.`createdAt`, `bookAuthor`.`bookId`, `author`.`id` AS `author.id`, `author`.`name` AS `author.name` FROM `bookAuthors` AS `bookAuthor` LEFT OUTER JOIN `authors` AS `author` ON `bookAuthor`.`authorId` = `author`.`id` WHERE `bookAuthor`.`bookId` IN ('cce1cccd-16a9-4526-a8c6-e351720dea05', '70a19088-5291-40ef-99f9-099355ab1c55', '2ca1c76b-6166-405b-9fb9-fcd91a31a3f1', '3f5708b1-c1bd-4ddd-9ce1-a22a51168952', '5fc117d1-5a68-43de-9cbb-edb9c3380664', '6714cfe4-3ccb-4540-97ca-0a80987b676f', 'f0dc204c-5e3e-470d-9a6e-0f97db69bf7a', 'a2a6a223-558e-4efd-bbcf-0f319377978d', '01cc19d2-e855-4046-83a1-a9adf4350e1a', '826c106a-17af-40f2-b72d-37f78104303c', 'a270e6ba-69b9-4ac6-9b03-afd22c99b35f', '5e184ebd-71bc-417b-833a-b435b2ba0dea', 'd21992d2-1ddb-4dcd-b028-264bd27948db', 'dfc1bc55-defa-4be2-ad44-30f6625784c6', '1f25cd61-f3b4-4b8c-8001-3ba8f3cc59dd', '45d35118-313e-4b38-a057-2e1076c5b1a3', '008314ae-ac23-450a-934d-2a6464987da5', '17f9ae17-abe4-4c73-ad9e-2c5c8d3018c4', '15720dd1-a67d-4ba0-b84e-d8c69e093d02', '48fa1bf3-4ccd-47d1-a5e2-eda5ffd58629', '1c5b3e53-9d52-48f8-93a6-7374dbd55de4', '08af8dbf-89dd-4864-88f1-64cc3a120d24', 'aff1ebfc-5f4b-46f9-866d-09c98263f8d8', 'deb7d449-ff7c-4abd-9a61-48466d1eaa80', 'ae0eb3c5-d6ac-4936-8aa3-a7d290f38016', 'd73dfde1-086e-4b73-92b4-a9ccd9de7422', '1d944758-37f4-458a-b8eb-eb1dbf00815b', '4faba6ea-e1dc-48b6-9585-a023eb5237c6', '8db683d2-98ef-4c85-9fa6-bd8fed8474e7', '35def283-fa45-48f7-8c8e-005eb0b3aba9', '919f5175-c789-4e36-88c9-023814caf063', '70ba7717-6506-4914-bcb6-999a93f9a626', '2c2f9f97-3171-45d3-bdd8-ffba2ac04f3a', '0a6c7b10-a687-45b0-9a30-308a23514e31', '410505ce-0e15-4b31-bf77-587d35bb15fc') ORDER BY `bookAuthor`.`createdAt` ASC; `
Author
Owner

@mikiher commented on GitHub (Jan 27, 2025):

Thanks for the data.

Your issue does seem similar to the one described by others.

Around which piece of code did you put your measurement?

Regarding the query you show - this is actually just the last part of a multi-query sequence (this once brings the authors for the books that were returned by main query). If you're really into analyzing query performance on your setup and are able to modify the code, you can add the following lines here

  logging: true,
  benchmark: true

So the sequelize query looks like this:

    const { rows: books, count } = await Database.bookModel.findAndCountAll({
      where: bookWhere,
      distinct: true,
      attributes: bookAttributes,
      replacements,
      include: [
        {
          model: Database.libraryItemModel,
          required: true,
          where: libraryItemWhere,
          include: libraryItemIncludes
        },
        seriesInclude,
        authorInclude,
        ...bookIncludes
      ],
      order: sortOrder,
      subQuery: false,
      limit: limit || null,
      offset,
      logging: true,
      benchmark: true
    })

You will see in the logs that the sequelize query is translated into 4 SQL queries:

  • A count query (usually relatively quick)
  • The main query (the one which usually takes the most time to run)
  • A query to merge series data into the main query results (usually very quick)
  • A query to merge author data into the main query results (the one you show above, usually very quick)

I suspect that the queries which seem to take a lot of time are ones where there are multiple concurrent queries running together (due to fast scrolling), Issue no. 1 in my comment above. Concurrent queries seems to seriously mess up Sequelize/SQLite performance.

As I said above, I'm trying to play with increasing the fetch size to decrease the probability of concurrency. I will also try playing with disallowing concurrent queries altogether (i.e. put a mutex on query execution). Stay tuned...

@mikiher commented on GitHub (Jan 27, 2025): Thanks for the data. Your issue does seem similar to the one described by others. Around which piece of code did you put your measurement? Regarding the query you show - this is actually just the last part of a multi-query sequence (this once brings the authors for the books that were returned by main query). If you're really into analyzing query performance on your setup and are able to modify the code, you can add the following lines [here](https://github.com/advplyr/audiobookshelf/blob/6ed2b575b06519d5ab4748019cd5fa3d9886f863/server/utils/queries/libraryItemsBookFilters.js#L582) ```js logging: true, benchmark: true ``` So the sequelize query looks like this: ```js const { rows: books, count } = await Database.bookModel.findAndCountAll({ where: bookWhere, distinct: true, attributes: bookAttributes, replacements, include: [ { model: Database.libraryItemModel, required: true, where: libraryItemWhere, include: libraryItemIncludes }, seriesInclude, authorInclude, ...bookIncludes ], order: sortOrder, subQuery: false, limit: limit || null, offset, logging: true, benchmark: true }) ``` You will see in the logs that the sequelize query is translated into 4 SQL queries: - A count query (usually relatively quick) - The main query (the one which usually takes the most time to run) - A query to merge series data into the main query results (usually very quick) - A query to merge author data into the main query results (the one you show above, usually very quick) I suspect that the queries which seem to take a lot of time are ones where there are multiple concurrent queries running together (due to fast scrolling), Issue no. 1 in my comment above. Concurrent queries seems to seriously mess up Sequelize/SQLite performance. As I said above, I'm trying to play with increasing the fetch size to decrease the probability of concurrency. I will also try playing with disallowing concurrent queries altogether (i.e. put a mutex on query execution). Stay tuned...
Author
Owner

@stelle007 commented on GitHub (Jan 27, 2025):

@stelle007 Can I ask you to please share a few more details about your setup and system?

* You said you have 18072 audio tracks, but I'd like to know how they are organized:
  
  * are these mostly books or podcasts?
  * how many books do you have in each book library?
  * how many podcasts, and what is the maximum number of episodes you have per podcast?

* You said you run Docker. on which system?

* How do you connect to the server?
  
  * Is it from a browser running on the same machine (using localhost), or through some Internet adderss?
  * Are you using a reverse proxy?

* If I can see the Chrome timing for one of the slow loading images, I'd appreciate:
  
  * in Chrome, open Chrome Developer Tools (F12 or Ctrl+Shift+i)
  * Select the `Network` tab (in the top line)
  * Go the Chrome address bar and open one of the slow loading library pages
  * In the `Network` tab, click on one of the slow cover images (you will likely see many of them named `cover&ts=<some-long-number>`)
  * click the `Timing` tab.
  * Take a screenshot of the `Timing` tab contents and post it here.

WOW this threat took off with a lot of posts :)

  1. I only have Podcasts running
  2. Zero books in the ABS instance in question, I made another ABS instance for books this have 157 Books, this is running fine.
  3. 158 Podcasts, And the one with the most episodes is 935
  4. Synology DS720+ (INTEL Celeron J4125) SSD Storage, 10 Gb Memory
  5. I connect through Browser Or Android ABS App, It's the same issue on all browers and Apps I have tried.
  6. Yes, I am Running through Nginx Proxy Manager
  7. It looks like it is loading the Page in chunks of 48 Podcasts/episodes a time.
  8. I also added a second screenshot of metadata loading

I have also tried running it (ABS) in docker on a Debian server, AMD Ryzen 7 5700G, 128 Gb Ram and NVME storage. And a Proxmox LXC container, (Don't remember hardware)

I did fresh install and podcast fetch on all, but It showed the same symptoms.

Image

Image

@stelle007 commented on GitHub (Jan 27, 2025): > [@stelle007](https://github.com/stelle007) Can I ask you to please share a few more details about your setup and system? > > * You said you have 18072 audio tracks, but I'd like to know how they are organized: > > * are these mostly books or podcasts? > * how many books do you have in each book library? > * how many podcasts, and what is the maximum number of episodes you have per podcast? > > * You said you run Docker. on which system? > > * How do you connect to the server? > > * Is it from a browser running on the same machine (using localhost), or through some Internet adderss? > * Are you using a reverse proxy? > > * If I can see the Chrome timing for one of the slow loading images, I'd appreciate: > > * in Chrome, open Chrome Developer Tools (F12 or Ctrl+Shift+i) > * Select the `Network` tab (in the top line) > * Go the Chrome address bar and open one of the slow loading library pages > * In the `Network` tab, click on one of the slow cover images (you will likely see many of them named `cover&ts=<some-long-number>`) > * click the `Timing` tab. > * Take a screenshot of the `Timing` tab contents and post it here. WOW this threat took off with a lot of posts :) 1. I only have Podcasts running 2. Zero books in the ABS instance in question, I made another ABS instance for books this have 157 Books, this is running fine. 3. 158 Podcasts, And the one with the most episodes is 935 4. Synology DS720+ (INTEL Celeron J4125) SSD Storage, 10 Gb Memory 5. I connect through Browser Or Android ABS App, It's the same issue on all browers and Apps I have tried. 6. Yes, I am Running through Nginx Proxy Manager 7. It looks like it is loading the Page in chunks of 48 Podcasts/episodes a time. 8. I also added a second screenshot of metadata loading I have also tried running it (ABS) in docker on a Debian server, AMD Ryzen 7 5700G, 128 Gb Ram and NVME storage. And a Proxmox LXC container, (Don't remember hardware) I did fresh install and podcast fetch on all, but It showed the same symptoms. ![Image](https://github.com/user-attachments/assets/6660fd21-5d2d-419c-b42a-417d4be5dd55) ![Image](https://github.com/user-attachments/assets/f2bfac0e-44e8-4888-87a0-7fa47fdb525b)
Author
Owner

@mikiher commented on GitHub (Jan 27, 2025):

@stelle007 Thank you for the data.

I think your case is somewhat different from the others (podcast and books library queries are different queries).

Just a couple to make sure I get it correct:

  • It is the podcast library page (with the 158 podcasts) that is slow to load, and not the podcast episodes table page, right?
  • Is the initial load time (when you click on Library to load the page) also very slow? or is it only when you scroll down?
  • What sort order are you using on the podcasts library page?
  • How many podcasts are visible on the page (before you scroll to see more)?
@mikiher commented on GitHub (Jan 27, 2025): @stelle007 Thank you for the data. I think your case is somewhat different from the others (podcast and books library queries are different queries). Just a couple to make sure I get it correct: - It is the podcast library page (with the 158 podcasts) that is slow to load, and not the podcast episodes table page, right? - Is the initial load time (when you click on `Library` to load the page) also very slow? or is it only when you scroll down? - What sort order are you using on the podcasts library page? - How many podcasts are visible on the page (before you scroll to see more)?
Author
Owner

@PhantomPhoton commented on GitHub (Jan 27, 2025):

I started looking into why it appeared as all the concurrent queries appeared to be serialized and discovered that sequelize currently only supports Single-thread or Serialized sqlite threading models. The Multi-thread model is completely safe to use and would allow concurrent read query execution (it still serializes write queries). I added a feature request to sequelize to add support for the Multi-thread mode which should really improve the responsiveness for these concurrent queries.

@PhantomPhoton commented on GitHub (Jan 27, 2025): I started looking into why it appeared as all the concurrent queries appeared to be serialized and discovered that [sequelize](https://sequelize.org/docs/v7/databases/sqlite/) currently only supports [Single-thread or Serialized](https://www.sqlite.org/threadsafe.html) sqlite threading models. The Multi-thread model is completely safe to use and would allow concurrent read query execution (it still serializes write queries). I added a [feature request](https://github.com/sequelize/sequelize/issues/17684) to sequelize to add support for the Multi-thread mode which should really improve the responsiveness for these concurrent queries.
Author
Owner

@stelle007 commented on GitHub (Jan 27, 2025):

@stelle007 Thank you for the data.

I think your case is somewhat different from the others (podcast and books library queries are different queries).

Just a couple to make sure I get it correct:

* It is the podcast library page (with the 158 podcasts) that is slow to load, and not the podcast episodes table page, right?

* Is the initial load time (when you click on `Library` to load the page) also very slow? or is it only when you scroll down?

* What sort order are you using on the podcasts library page?

* How many podcasts are visible on the page (before you scroll to see more)?
  • Yes, that is correct library page, that is slow to load, if I search for podcasts, the individual podcast page load fast.
  • It's hard to say for sure, but I would say around 10 sec for the initial podcast's to to load is 10 sec, and then 13 sec per chunk after I start scrolling.
  • All, Title A-Z
  • With the screen I am on now, I see 32 (8x4), but it loads 48, when I get past 48, It starts loading new once, and the 48 loads again

At one point I had my Audio books on the same container, and they were Just as slow to load as the Podcasts, that's why I made a new container for the Audio books.

@stelle007 commented on GitHub (Jan 27, 2025): > [@stelle007](https://github.com/stelle007) Thank you for the data. > > I think your case is somewhat different from the others (podcast and books library queries are different queries). > > Just a couple to make sure I get it correct: > > * It is the podcast library page (with the 158 podcasts) that is slow to load, and not the podcast episodes table page, right? > > * Is the initial load time (when you click on `Library` to load the page) also very slow? or is it only when you scroll down? > > * What sort order are you using on the podcasts library page? > > * How many podcasts are visible on the page (before you scroll to see more)? - Yes, that is correct library page, that is slow to load, if I search for podcasts, the individual podcast page load fast. - It's hard to say for sure, but I would say around 10 sec for the initial podcast's to to load is 10 sec, and then 13 sec per chunk after I start scrolling. - All, Title A-Z - With the screen I am on now, I see 32 (8x4), but it loads 48, when I get past 48, It starts loading new once, and the 48 loads again At one point I had my Audio books on the same container, and they were Just as slow to load as the Podcasts, that's why I made a new container for the Audio books.
Author
Owner

@mikiher commented on GitHub (Jan 28, 2025):

I started looking into why it appeared as all the concurrent queries appeared to be serialized and discovered that sequelize currently only supports Single-thread or Serialized sqlite threading models. The Multi-thread model is completely safe to use and would allow concurrent read query execution (it still serializes write queries). I added a feature request to sequelize to add support for the Multi-thread mode which should really improve the responsiveness for these concurrent queries.

What I'm struggling with this explanation is that when concurrent queries are running, the cummulative run time seems to go much beyond the sum of expected run times of the individual queries (for example, non-concurrent requests take 50 ms each, but 5 concurrent requests take 5 seconds). Something really fishy is happening, either inside Sequelize or in SQLite (I suspect Sequelize).

Also, note that we're currently using Sequelize 6, not 7.

@mikiher commented on GitHub (Jan 28, 2025): > I started looking into why it appeared as all the concurrent queries appeared to be serialized and discovered that [sequelize](https://sequelize.org/docs/v7/databases/sqlite/) currently only supports [Single-thread or Serialized](https://www.sqlite.org/threadsafe.html) sqlite threading models. The Multi-thread model is completely safe to use and would allow concurrent read query execution (it still serializes write queries). I added a [feature request](https://github.com/sequelize/sequelize/issues/17684) to sequelize to add support for the Multi-thread mode which should really improve the responsiveness for these concurrent queries. What I'm struggling with this explanation is that when concurrent queries are running, the cummulative run time seems to go much beyond the sum of expected run times of the individual queries (for example, non-concurrent requests take 50 ms each, but 5 concurrent requests take 5 seconds). Something really fishy is happening, either inside Sequelize or in SQLite (I suspect Sequelize). Also, note that we're currently using Sequelize 6, not 7.
Author
Owner

@PhantomPhoton commented on GitHub (Jan 28, 2025):

What I'm struggling with this explanation is that when concurrent queries are running, the cummulative run time seems to go much beyond the sum of expected run times of the individual queries (for example, non-concurrent requests take 50 ms each, but 5 concurrent requests take 5 seconds). Something really fishy is happening, either inside Sequelize or in SQLite (I suspect Sequelize).

I think you are absolutely right. There does seem to be something else going on. Getting concurrent read queries is just one potential improvement, presuming there's not an architectural reason why Sequelize doesn't support multi-threaded queries, however, figuring out faster query performance would be a huge win everywhere.

Also, note that we're currently using Sequelize 6, not 7.

Thank you for that clarification. I checked the docs and 6 has the same restriction as 7 does.

@PhantomPhoton commented on GitHub (Jan 28, 2025): > What I'm struggling with this explanation is that when concurrent queries are running, the cummulative run time seems to go much beyond the sum of expected run times of the individual queries (for example, non-concurrent requests take 50 ms each, but 5 concurrent requests take 5 seconds). Something really fishy is happening, either inside Sequelize or in SQLite (I suspect Sequelize). I think you are absolutely right. There does seem to be something else going on. Getting concurrent read queries is just one potential improvement, presuming there's not an architectural reason why Sequelize doesn't support multi-threaded queries, however, figuring out faster query performance would be a huge win everywhere. > Also, note that we're currently using Sequelize 6, not 7. Thank you for that clarification. I checked the docs and 6 has the same restriction as 7 does.
Author
Owner

@mikiher commented on GitHub (Jan 28, 2025):

@ScuttleSE

Around which piece of code did you put your measurement?

Ah, stupid me... you didn't need to change the code, you just ran the server with QUERY_LOGGING=benchmark.

Regarding the query you show - this is actually just the last part of a multi-query sequence (this once brings the authors for the books that were returned by main query). If you're really into analyzing query performance on your setup and are able to modify the code, you can add the following lines here

logging: true,
benchmark: true
So the sequelize query looks like this:

const { rows: books, count } = await Database.bookModel.findAndCountAll({
  where: bookWhere,
  distinct: true,
  attributes: bookAttributes,
  replacements,
  include: [
    {
      model: Database.libraryItemModel,
      required: true,
      where: libraryItemWhere,
      include: libraryItemIncludes
    },
    seriesInclude,
    authorInclude,
    ...bookIncludes
  ],
  order: sortOrder,
  subQuery: false,
  limit: limit || null,
  offset,
  logging: true,
  benchmark: true
})

The code I showed above logs the underlying SQL queries and the timing for this specific Sequelize query, rather than using the QUERY_LOGGING env variable, which shows it for all Sequelize queries. But obviously you need to modify the code to do this, whereas with QUERY_LOGGING, you don't.

You will see in the logs that the sequelize query is translated into 4 SQL queries:

  • A count query (usually relatively quick)
  • The main query (the one which usually takes the most time to run)
  • A query to merge series data into the main query results (usually very quick)
  • A query to merge author data into the main query results (the one you show above, usually very quick)

I suspect that the queries which seem to take a lot of time are ones where there are multiple concurrent queries running together (due to fast scrolling), Issue no. 1 in my comment above. Concurrent queries seems to seriously mess up Sequelize/SQLite performance.

As I said above, I'm trying to play with increasing the fetch size to decrease the probability of concurrency. I will also try playing with disallowing concurrent queries altogether (i.e. put a mutex on query execution). Stay tuned...

@mikiher commented on GitHub (Jan 28, 2025): @ScuttleSE > Around which piece of code did you put your measurement? Ah, stupid me... you didn't need to change the code, you just ran the server with `QUERY_LOGGING=benchmark`. > > Regarding the query you show - this is actually just the last part of a multi-query sequence (this once brings the authors for the books that were returned by main query). If you're really into analyzing query performance on your setup and are able to modify the code, you can add the following lines [here](https://github.com/advplyr/audiobookshelf/blob/6ed2b575b06519d5ab4748019cd5fa3d9886f863/server/utils/queries/libraryItemsBookFilters.js#L582) > > logging: true, > benchmark: true > So the sequelize query looks like this: > > const { rows: books, count } = await Database.bookModel.findAndCountAll({ > where: bookWhere, > distinct: true, > attributes: bookAttributes, > replacements, > include: [ > { > model: Database.libraryItemModel, > required: true, > where: libraryItemWhere, > include: libraryItemIncludes > }, > seriesInclude, > authorInclude, > ...bookIncludes > ], > order: sortOrder, > subQuery: false, > limit: limit || null, > offset, > logging: true, > benchmark: true > }) The code I showed above logs the underlying SQL queries and the timing for this specific Sequelize query, rather than using the `QUERY_LOGGING` env variable, which shows it for all Sequelize queries. But obviously you need to modify the code to do this, whereas with `QUERY_LOGGING`, you don't. > You will see in the logs that the sequelize query is translated into 4 SQL queries: > > * A count query (usually relatively quick) > * The main query (the one which usually takes the most time to run) > * A query to merge series data into the main query results (usually very quick) > * A query to merge author data into the main query results (the one you show above, usually very quick) > > I suspect that the queries which seem to take a lot of time are ones where there are multiple concurrent queries running together (due to fast scrolling), Issue no. 1 in my comment above. Concurrent queries seems to seriously mess up Sequelize/SQLite performance. > > As I said above, I'm trying to play with increasing the fetch size to decrease the probability of concurrency. I will also try playing with disallowing concurrent queries altogether (i.e. put a mutex on query execution). Stay tuned...
Author
Owner

@mikiher commented on GitHub (Feb 1, 2025):

@ScuttleSE and others who are sorting their book library by title (ascending or descending) - I've made some progress investigating this, and I have a couple of additional questions regarding your specific case:

  • In your general Audiobookshelf settings, do you have Ignore prefixes when sorting enabled?
  • Have you enabled Collapse Series in the library page (the option that shows all books in a series as a single entry)?
@mikiher commented on GitHub (Feb 1, 2025): @ScuttleSE and others who are sorting their book library by title (ascending or descending) - I've made some progress investigating this, and I have a couple of additional questions regarding your specific case: - In your general Audiobookshelf settings, do you have `Ignore prefixes when sorting` enabled? - Have you enabled `Collapse Series` in the library page (the option that shows all books in a series as a single entry)?
Author
Owner

@ScuttleSE commented on GitHub (Feb 1, 2025):

@ScuttleSE and others who are sorting their book library by title (ascending or descending) - I've made some progress investigating this, and I have a couple of additional questions regarding your specific case:

* In your general Audiobookshelf settings, do you have `Ignore prefixes when sorting` enabled?

* Have you enabled `Collapse Series` in the library page (the option that shows all books in a series as a single entry)?

Yes on the first one, with just "the" as an ignored prefix

No to the second one.

@ScuttleSE commented on GitHub (Feb 1, 2025): > [@ScuttleSE](https://github.com/ScuttleSE) and others who are sorting their book library by title (ascending or descending) - I've made some progress investigating this, and I have a couple of additional questions regarding your specific case: > > * In your general Audiobookshelf settings, do you have `Ignore prefixes when sorting` enabled? > > * Have you enabled `Collapse Series` in the library page (the option that shows all books in a series as a single entry)? Yes on the first one, with just "the" as an ignored prefix No to the second one.
Author
Owner

@JBlond commented on GitHub (Feb 2, 2025):

@ScuttleSE and others who are sorting their book library by title (ascending or descending) - I've made some progress investigating this, and I have a couple of additional questions regarding your specific case:

* In your general Audiobookshelf settings, do you have `Ignore prefixes when sorting` enabled?

no

* Have you enabled `Collapse Series` in the library page (the option that shows all books in a series as a single entry)?

no

@JBlond commented on GitHub (Feb 2, 2025): > [@ScuttleSE](https://github.com/ScuttleSE) and others who are sorting their book library by title (ascending or descending) - I've made some progress investigating this, and I have a couple of additional questions regarding your specific case: > > * In your general Audiobookshelf settings, do you have `Ignore prefixes when sorting` enabled? no > * Have you enabled `Collapse Series` in the library page (the option that shows all books in a series as a single entry)? no
Author
Owner

@mikiher commented on GitHub (Feb 2, 2025):

Thank you, I'm working on some changes that are likely to improve your loading and scrolling experience. Stay tuned.

@mikiher commented on GitHub (Feb 2, 2025): Thank you, I'm working on some changes that are likely to improve your loading and scrolling experience. Stay tuned.
Author
Owner

@mikiher commented on GitHub (Feb 6, 2025):

@stelle007

While I'm working on this, v2.19.0 has been released, which allows setting some SQLite pragma values through environment variables, requested by @PhantomPhoton who has a setup similar to yours (a very large podcast database).

@PhantomPhoton reports in #3750 that setting up some of those values improved his page load time siginificantly. I'm not yet directly working on podcast library query performance, but in the meantime you may want to experiment with setting up these values on your setup as well.

The environment variables and values used by @PhantomPhoton were:

SQLITE_CACHE_SIZE=-262144
SQLITE_MMAP_SIZE=268435456
SQLITE_TEMP_STORE=2

You can set these up in your docker container, restart the container, and see if you see any changes in latency.

To verify that the server is using the environment variables you set, look for the following lines in the server log:

INFO: [Database] Running "PRAGMA mmap_size = 268435456"
INFO: [Database] Running "PRAGMA cache_size = -262144"
INFO: [Database] Running "PRAGMA temp_store = 2"
@mikiher commented on GitHub (Feb 6, 2025): @stelle007 While I'm working on this, v2.19.0 has been released, which allows setting some SQLite pragma values through environment variables, requested by @PhantomPhoton who has a setup similar to yours (a very large podcast database). @PhantomPhoton reports in #3750 that setting up some of those values improved his page load time siginificantly. I'm not yet directly working on podcast library query performance, but in the meantime you may want to experiment with setting up these values on your setup as well. The environment variables and values used by @PhantomPhoton were: ``` SQLITE_CACHE_SIZE=-262144 SQLITE_MMAP_SIZE=268435456 SQLITE_TEMP_STORE=2 ``` You can set these up in your docker container, restart the container, and see if you see any changes in latency. To verify that the server is using the environment variables you set, look for the following lines in the server log: ``` INFO: [Database] Running "PRAGMA mmap_size = 268435456" INFO: [Database] Running "PRAGMA cache_size = -262144" INFO: [Database] Running "PRAGMA temp_store = 2" ```
Author
Owner

@stelle007 commented on GitHub (Feb 6, 2025):

@stelle007

While I'm working on this, v2.19.0 has been released, which allows setting some SQLite pragma values through environment variables, requested by @PhantomPhoton who has a setup similar to yours (a very large podcast database).

@PhantomPhoton reports in #3750 that setting up some of those values improved his page load time siginificantly. I'm not yet directly working on podcast library query performance, but in the meantime you may want to experiment with setting up these values on your setup as well.

The environment variables and values used by @PhantomPhoton were:

SQLITE_CACHE_SIZE=-262144
SQLITE_MMAP_SIZE=268435456
SQLITE_TEMP_STORE=2

You can set these up in your docker container, restart the container, and see if you see any changes in latency.

To verify that the server is using the environment variables you set, look for the following lines in the server log:

INFO: [Database] Running "PRAGMA mmap_size = 268435456"
INFO: [Database] Running "PRAGMA cache_size = -262144"
INFO: [Database] Running "PRAGMA temp_store = 2"

Thank you, that is such a huge improvement, thank you both so much, I think it is 2-3 seconds per page now.
This is great !

Thank you !

@stelle007 commented on GitHub (Feb 6, 2025): > [@stelle007](https://github.com/stelle007) > > While I'm working on this, v2.19.0 has been released, which allows setting some SQLite pragma values through environment variables, requested by [@PhantomPhoton](https://github.com/PhantomPhoton) who has a setup similar to yours (a very large podcast database). > > [@PhantomPhoton](https://github.com/PhantomPhoton) reports in [#3750](https://github.com/advplyr/audiobookshelf/issues/3750) that setting up some of those values improved his page load time siginificantly. I'm not yet directly working on podcast library query performance, but in the meantime you may want to experiment with setting up these values on your setup as well. > > The environment variables and values used by [@PhantomPhoton](https://github.com/PhantomPhoton) were: > > ``` > SQLITE_CACHE_SIZE=-262144 > SQLITE_MMAP_SIZE=268435456 > SQLITE_TEMP_STORE=2 > ``` > > You can set these up in your docker container, restart the container, and see if you see any changes in latency. > > To verify that the server is using the environment variables you set, look for the following lines in the server log: > > ``` > INFO: [Database] Running "PRAGMA mmap_size = 268435456" > INFO: [Database] Running "PRAGMA cache_size = -262144" > INFO: [Database] Running "PRAGMA temp_store = 2" > ``` Thank you, that is such a huge improvement, thank you both so much, I think it is 2-3 seconds per page now. This is great ! Thank you !
Author
Owner

@mikiher commented on GitHub (Feb 6, 2025):

I'm happy this works for you. Although it doesn't solve the core issue, it's good that it's improving the situaiton significantly.

2-3 seconds per page is still way too high, and I'm still intending to work on improving this by optimizing database queries, though it might be some time until I get to it, and the solution might not be simple.

@mikiher commented on GitHub (Feb 6, 2025): I'm happy this works for you. Although it doesn't solve the core issue, it's good that it's improving the situaiton significantly. 2-3 seconds per page is still way too high, and I'm still intending to work on improving this by optimizing database queries, though it might be some time until I get to it, and the solution might not be simple.
Author
Owner

@mikiher commented on GitHub (Feb 12, 2025):

@stelle007 @PhantomPhoton

I'd like to separate your issue (podcast library page loading performance) from the book library page loading performance which was address here. I opened a separate issue #3965 to track that.

Let's continue discussing there.

@mikiher commented on GitHub (Feb 12, 2025): @stelle007 @PhantomPhoton I'd like to separate your issue (podcast library page loading performance) from the book library page loading performance which was address here. I opened a separate issue [#3965](https://github.com/advplyr/audiobookshelf/issues/3965) to track that. Let's continue discussing there.
Author
Owner

@mikiher commented on GitHub (Feb 13, 2025):

@ScuttleSE @JBlond

I'm interested to know if v2.19.2 improved book page loading time for you (please skip v2.19.1, it was a buggy release).

@mikiher commented on GitHub (Feb 13, 2025): @ScuttleSE @JBlond I'm interested to know if v2.19.2 improved book page loading time for you (please skip v2.19.1, it was a buggy release).
Author
Owner

@JBlond commented on GitHub (Feb 13, 2025):

@ScuttleSE @JBlond

I'm interested to know if v2.19.2 improved book page loading time for you (please skip v2.19.1, it was a buggy release).

it is a lot faster with my lib 266 books. Once the images are in the browser cache each slow scrolling like 5 rows. Each row 8 books (aka 40 books at once) it takes now only 25 to 40 ms for the query.

Thank you for your awesome work.

@JBlond commented on GitHub (Feb 13, 2025): > [@ScuttleSE](https://github.com/ScuttleSE) [@JBlond](https://github.com/JBlond) > > I'm interested to know if v2.19.2 improved book page loading time for you (please skip v2.19.1, it was a buggy release). it is a lot faster with my lib 266 books. Once the images are in the browser cache each slow scrolling like 5 rows. Each row 8 books (aka 40 books at once) it takes now only 25 to 40 ms for the query. Thank you for your awesome work.
Author
Owner

@ScuttleSE commented on GitHub (Feb 13, 2025):

@ScuttleSE @JBlond

I'm interested to know if v2.19.2 improved book page loading time for you (please skip v2.19.1, it was a buggy release).

It's a lot faster. My library is just under 2000 books. Opening the library and scrolling to the bottom now takes about 6 seconds

Still looks like it is loading all 2000 coverimages, but it is doing it a lot faster

@ScuttleSE commented on GitHub (Feb 13, 2025): > [@ScuttleSE](https://github.com/ScuttleSE) [@JBlond](https://github.com/JBlond) > > I'm interested to know if v2.19.2 improved book page loading time for you (please skip v2.19.1, it was a buggy release). It's a lot faster. My library is just under 2000 books. Opening the library and scrolling to the bottom now takes about 6 seconds Still looks like it is loading all 2000 coverimages, but it is doing it a lot faster
Author
Owner

@mikiher commented on GitHub (Feb 13, 2025):

Still looks like it is loading all 2000 coverimages, but it is doing it a lot faster

Whether it loads all images or not depends on how fast you scroll - if scrolling is fast enough, it may skip some of them.

You can check how many actual image requests are done through the developer console network tab - click on Img to show only image requests. I will look if there's some more optimization to squeeze there, but there's a tradeoff here - if you wait too late loading the items (which in turns triggers the cover image fetch), you're more likely to see a visible delay in loading the page when you stop scrolling.

@mikiher commented on GitHub (Feb 13, 2025): > Still looks like it is loading all 2000 coverimages, but it is doing it a lot faster Whether it loads all images or not depends on how fast you scroll - if scrolling is fast enough, it may skip some of them. You can check how many actual image requests are done through the developer console network tab - click on `Img` to show only image requests. I will look if there's some more optimization to squeeze there, but there's a tradeoff here - if you wait too late loading the items (which in turns triggers the cover image fetch), you're more likely to see a visible delay in loading the page when you stop scrolling.
Author
Owner

@darthShadow commented on GitHub (Feb 13, 2025):

This was closed earlier but may be worth a revisit: https://github.com/advplyr/audiobookshelf/issues/3090

That way, you could delay loading the actual images till they enter the viewport.

@darthShadow commented on GitHub (Feb 13, 2025): This was closed earlier but may be worth a revisit: https://github.com/advplyr/audiobookshelf/issues/3090 That way, you could delay loading the actual images till they enter the viewport.
Author
Owner

@ScuttleSE commented on GitHub (Feb 13, 2025):

Still looks like it is loading all 2000 coverimages, but it is doing it a lot faster

Whether it loads all images or not depends on how fast you scroll - if scrolling is fast enough, it may skip some of them.

You can check how many actual image requests are done through the developer console network tab - click on Img to show only image requests. I will look if there's some more optimization to squeeze there, but there's a tradeoff here - if you wait too late loading the items (which in turns triggers the cover image fetch), you're more likely to see a visible delay in loading the page when you stop scrolling.

Just tested that. Loaded up the library. I have 25 thumbnails visible at 180 pixels(?). Quickly pulled the scrollbar all the way to the bottom

608 images loaded. Out of 1986.

On a local connection I guess it's not an issue, but remotely it would really slow things down I assume.

@ScuttleSE commented on GitHub (Feb 13, 2025): > > Still looks like it is loading all 2000 coverimages, but it is doing it a lot faster > > Whether it loads all images or not depends on how fast you scroll - if scrolling is fast enough, it may skip some of them. > > You can check how many actual image requests are done through the developer console network tab - click on `Img` to show only image requests. I will look if there's some more optimization to squeeze there, but there's a tradeoff here - if you wait too late loading the items (which in turns triggers the cover image fetch), you're more likely to see a visible delay in loading the page when you stop scrolling. Just tested that. Loaded up the library. I have 25 thumbnails visible at 180 pixels(?). Quickly pulled the scrollbar all the way to the bottom 608 images loaded. Out of 1986. On a local connection I guess it's not an issue, but remotely it would really slow things down I assume.
Author
Owner

@mikiher commented on GitHub (Feb 13, 2025):

This was closed earlier but may be worth a revisit: #3090

That way, you could delay loading the actual images till they enter the viewport.

Interesting. I will look into that.

@mikiher commented on GitHub (Feb 13, 2025): > This was closed earlier but may be worth a revisit: [#3090](https://github.com/advplyr/audiobookshelf/issues/3090) > > That way, you could delay loading the actual images till they enter the viewport. Interesting. I will look into that.
Author
Owner

@PhantomPhoton commented on GitHub (Feb 13, 2025):

You can check how many actual image requests are done through the developer console network tab - click on Img to show only image requests. I will look if there's some more optimization to squeeze there, but there's a tradeoff here - if you wait too late loading the items (which in turns triggers the cover image fetch), you're more likely to see a visible delay in loading the page when you stop scrolling.

I've been meaning to look into why my browser doesn't cache the cover images (least for podcasts). Every cover is requested from the server, as if it's not getting cached at all, and if you scroll down too fast, it seems to hit a point where everything just sits until it times out. If the cover images are cached by the browser, first load would be rough, but future loads would be a lot better. I presume it's some sort of issue with the response headers preventing the cache, but haven't made the time to get them sorted out yet.

@PhantomPhoton commented on GitHub (Feb 13, 2025): > You can check how many actual image requests are done through the developer console network tab - click on `Img` to show only image requests. I will look if there's some more optimization to squeeze there, but there's a tradeoff here - if you wait too late loading the items (which in turns triggers the cover image fetch), you're more likely to see a visible delay in loading the page when you stop scrolling. I've been meaning to look into why my browser doesn't cache the cover images (least for podcasts). Every cover is requested from the server, as if it's not getting cached at all, and if you scroll down too fast, it seems to hit a point where everything just sits until it times out. If the cover images are cached by the browser, first load would be rough, but future loads would be a lot better. I presume it's some sort of issue with the response headers preventing the cache, but haven't made the time to get them sorted out yet.
Author
Owner

@mikiher commented on GitHub (Feb 13, 2025):

Just tested that. Loaded up the library. I have 25 thumbnails visible at 180 pixels(?). Quickly pulled the scrollbar all the way to the bottom

608 images loaded. Out of 1986.

That sounds about right. I will see if I can get the number down a bit, and the blur hash feature mentioned by @darthShadow might help here as well.

On a local connection I guess it's not an issue, but remotely it would really slow things down I assume.

Yeah, of course, depending on bandwith and connection type - but that is unavoidable right now. Note that once the browser has them, the images are locally cached for about a day, so scrolling up and down after the initial scroll will load images much faster. Of course if you have a lot of books, they might be thrown out of the cache, but generally the browser cache can hold a lot images.

@mikiher commented on GitHub (Feb 13, 2025): > Just tested that. Loaded up the library. I have 25 thumbnails visible at 180 pixels(?). Quickly pulled the scrollbar all the way to the bottom > > 608 images loaded. Out of 1986. That sounds about right. I will see if I can get the number down a bit, and the blur hash feature mentioned by @darthShadow might help here as well. > > On a local connection I guess it's not an issue, but remotely it would really slow things down I assume. Yeah, of course, depending on bandwith and connection type - but that is unavoidable right now. Note that once the browser has them, the images are locally cached for about a day, so scrolling up and down after the initial scroll will load images much faster. Of course if you have a lot of books, they might be thrown out of the cache, but generally the browser cache can hold a lot images.
Author
Owner

@mikiher commented on GitHub (Feb 13, 2025):

I've been meaning to look into why my browser doesn't cache the cover images (least for podcasts). Every cover is requested from the server, as if it's not getting cached at all, and if you scroll down too fast, it seems to hit a point where everything just sits until it times out. If the cover images are cached by the browser, first load would be rough, but future loads would be a lot better. I presume it's some sort of issue with the response headers preventing the cache, but haven't made the time to get them sorted out yet.

No, that should not happen. The images are supposed to have response headers that allow browser caching for 24 hours. If that does not work, we should fix it. After you scroll up and down the library, do you still see image requests going out in the Network tab (Note that the requests might still appear, but the size column should show them as served from the browser's disk cache).

Update: yeah I just checked, the cover image response headers are correctly set (I remembered since I wrote it):

cache-control: private, max-age=86400

Which means that the browser should cache the image for 86400 seconds==24 hours. The private just means that caching by any proxies in the middle is not allowed. We could certainly increase the TTL to more than 24 hours. I think I did that to be on the safe side, but we could essentially cache forever - there's a cache busting mechanism which changes the cover image url if the image changed.

@mikiher commented on GitHub (Feb 13, 2025): > I've been meaning to look into why my browser doesn't cache the cover images (least for podcasts). Every cover is requested from the server, as if it's not getting cached at all, and if you scroll down too fast, it seems to hit a point where everything just sits until it times out. If the cover images are cached by the browser, first load would be rough, but future loads would be a lot better. I presume it's some sort of issue with the response headers preventing the cache, but haven't made the time to get them sorted out yet. No, that should not happen. The images are supposed to have response headers that allow browser caching for 24 hours. If that does not work, we should fix it. After you scroll up and down the library, do you still see image requests going out in the Network tab (Note that the requests might still appear, but the size column should show them as served from the browser's disk cache). _Update:_ yeah I just checked, the cover image response headers are correctly set (I remembered since I wrote it): ``` cache-control: private, max-age=86400 ``` Which means that the browser should cache the image for 86400 seconds==24 hours. The `private` just means that caching by any proxies in the middle is not allowed. We could certainly increase the TTL to more than 24 hours. I think I did that to be on the safe side, but we could essentially cache forever - there's a cache busting mechanism which changes the cover image url if the image changed.
Author
Owner

@PhantomPhoton commented on GitHub (Feb 13, 2025):

Update: yeah I just checked, the cover image response headers are correctly set (I remembered since I wrote it):

cache-control: private, max-age=86400

Which means that the browser should cache the image for 86400 seconds==24 hours. The private just means that caching by any proxies in the middle is not allowed. We could certainly increase the TTL to more than 24 hours. I think I did that to be on the safe side, but we could essentially cache forever - there's a cache busting mechanism which changes the cover image url if the image changed.

Oh my, I am a bonehead! So my cover requests included Cache-Control: no-cache, which is why they weren't being cached, I had toggled disable caches in dev tools when I was benchmarking the sql pragma changes and forgot to toggle it back...

Apologies for the incorrect issue! Everything is working just fine

@PhantomPhoton commented on GitHub (Feb 13, 2025): > _Update:_ yeah I just checked, the cover image response headers are correctly set (I remembered since I wrote it): > > ``` > cache-control: private, max-age=86400 > ``` > > Which means that the browser should cache the image for 86400 seconds==24 hours. The `private` just means that caching by any proxies in the middle is not allowed. We could certainly increase the TTL to more than 24 hours. I think I did that to be on the safe side, but we could essentially cache forever - there's a cache busting mechanism which changes the cover image url if the image changed. Oh my, I am a bonehead! So my cover requests included `Cache-Control: no-cache`, which is why they weren't being cached, I had toggled disable caches in dev tools when I was benchmarking the sql pragma changes and forgot to toggle it back... Apologies for the incorrect issue! Everything is working just fine
Author
Owner

@mikiher commented on GitHub (Feb 13, 2025):

Yeah, I also have disable-cache enabled in my browser dev tools Network tab by default for testing purposes...

@mikiher commented on GitHub (Feb 13, 2025): Yeah, I also have disable-cache enabled in my browser dev tools Network tab by default for testing purposes...
Author
Owner

@Eftimin70 commented on GitHub (Feb 13, 2025):

The normal library view is now really fast, thank you! But with "collapse series" selected it still is a lot slower than pre-2.4.0

@Eftimin70 commented on GitHub (Feb 13, 2025): The normal library view is now really fast, thank you! But with "collapse series" selected it still is a lot slower than pre-2.4.0
Author
Owner

@mikiher commented on GitHub (Feb 13, 2025):

The normal library view is now really fast, thank you! But with "collapse series" selected it still is a lot slower than pre-2.4.0

Yes, the "collapse series" setting really complicates the database queries, and that code path has not been optimized yet.

I tried to focus first on the the some of the queries that are relatively easier to optimize - some of them require more effort.

@mikiher commented on GitHub (Feb 13, 2025): > The normal library view is now really fast, thank you! But with "collapse series" selected it still is a lot slower than pre-2.4.0 Yes, the "collapse series" setting really complicates the database queries, and that code path has not been optimized yet. I tried to focus first on the the some of the queries that are relatively easier to optimize - some of them require more effort.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1364