First scan of a library makes the hole app unusable until finished #140

Closed
opened 2026-04-24 22:59:25 +02:00 by adam · 4 comments
Owner

Originally created by @mx03 on GitHub (Dec 22, 2021).

The site not loads or takes very long (html and all local resources), the websocket is not responding and the ajax requests takes 20secs or more.
image

Looks like something is blocking.

Originally created by @mx03 on GitHub (Dec 22, 2021). The site not loads or takes very long (html and all local resources), the websocket is not responding and the ajax requests takes 20secs or more. ![image](https://user-images.githubusercontent.com/1390929/147077647-581ddee5-4e60-4d1e-a1ab-5e0b65c50ff6.png) Looks like something is blocking.
adam closed this issue 2026-04-24 22:59:25 +02:00
Author
Owner

@advplyr commented on GitHub (Dec 24, 2021):

Are you still having this issue? The socket is unable to connect?
I know the request payload can be reduced, but it shouldn't impact the socket connection

@advplyr commented on GitHub (Dec 24, 2021): Are you still having this issue? The socket is unable to connect? I know the request payload can be reduced, but it shouldn't impact the socket connection
Author
Owner

@mx03 commented on GitHub (Dec 24, 2021):

Sorry i think there is a misunderstanding.

  1. new audiobookshelf instance or adding a new library (settings->libraries-> add new folder)
  2. start a first scan on the new library or start a force scan
  3. scanning started
  4. audiobookshelf is unusable (websocket connection timed out, every requests takes minutes)
  5. scanning is finished
  6. everything works again

The problem is only relevant if there are multiple user that want to use that instance while a new library is added.

For me it looks like the nodejs loop is getting blocked by something while this scanning, because even the static requests like the Logo48.png are not working.

@mx03 commented on GitHub (Dec 24, 2021): Sorry i think there is a misunderstanding. 1. new audiobookshelf instance or adding a new library (settings->libraries-> add new folder) 2. start a first scan on the new library or start a force scan 3. scanning started 4. audiobookshelf is unusable (websocket connection timed out, every requests takes minutes) 5. scanning is finished 6. everything works again The problem is only relevant if there are multiple user that want to use that instance while a new library is added. For me it looks like the nodejs loop is getting blocked by something while this scanning, because even the static requests like the Logo48.png are not working.
Author
Owner

@advplyr commented on GitHub (Dec 24, 2021):

Ah okay, got it.
When the scanner probes an audio file using ffmpeg it should be done in a worker thread.
This file https://github.com/advplyr/audiobookshelf/blob/master/server/scanner/AudioFileScanner.js will need to be updated to manage a worker pool of probes.

@advplyr commented on GitHub (Dec 24, 2021): Ah okay, got it. When the scanner probes an audio file using ffmpeg it should be done in a worker thread. This file https://github.com/advplyr/audiobookshelf/blob/master/server/scanner/AudioFileScanner.js will need to be updated to manage a worker pool of probes.
Author
Owner

@advplyr commented on GitHub (Apr 24, 2022):

Consolidating scanner performance issues here #444

@advplyr commented on GitHub (Apr 24, 2022): Consolidating scanner performance issues here #444
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#140