iiab / calibre-web

:books: Web app for browsing, reading and downloading eBooks stored in a Calibre database
GNU General Public License v3.0
4 stars 5 forks source link

Download tasks don't seem to run simultaneously, causing delays #58

Open deldesir opened 11 months ago

deldesir commented 11 months ago

Issue/Problem

The current task processing mechanism in Calibre-Web relies on apscheduler for managing various tasks, including format conversions, uploads, and metadata-related activities. It has been recently optimized to support downloads (see #9). While apscheduler is functional, there have been observations that tasks might not be processed concurrently in an asynchronous manner, causing potential delays in download task execution.

Proposed Solution

To enhance the processing of tasks within Calibre-Web, I propose either leveraging apsheduler.AsyncScheduler (https://apscheduler.readthedocs.io/en/master/api.html#apscheduler.AsyncScheduler) or integrating Redis Queue (RQ) as an alternative job queuing system (https://python-rq.org/).

holta commented 11 months ago

Thanks @deldesir for explaining when you can!

Related:

deldesir commented 11 months ago
  • How serious are delays?

Well, that depends. The delays happen when users try to download multiple things at once. Even though downloads are in separate threads, other tasks get lined up in a queue, so users have to wait for one task to finish before the next starts.

  • Can you give a few specific examples with details? (Whether or not there might appear to be patterns?)
  • Steps to Reproduce:
  • Initiate the download of several videos simultaneously.
  • Observe the "Tasks" page in Calibre-Web.
holta commented 11 months ago

Excellent summary to help us all keep track, Thanks @deldesir! Annoying-but-tolerable for now.

Two much-higher-priorities in December 2023:

DESIGN PRINCIPLE 1: Honor Low-Income Teachers/Students with "Near-Zero Bureaucracy"(TM) deep learning experiences 📐🧭 🖼️

DESIGN PRINCIPLE 2: Ignore Geeky Corner Cases — keep focus on above — remove features to welcome the masses authentically!

holta commented 10 months ago

Tangentially related question is how educators/parents/curriculum designers can monitor their ongoing "Download to IIAB" downloads' progress: