Bug 15313 - CLI queries used by iPeng are very slow in TinySC
: CLI queries used by iPeng are very slow in TinySC
Status: CLOSED FIXED
Product: SB Touch
Classification: Unclassified
Component: API
: unspecified
: Other Other
: P1 normal (vote)
: 7.5.0
Assigned To: Andy Grundman
: TinySC
Depends on:
Blocks: 7992
  Show dependency treegraph
 
Reported: 2009-12-16 05:52 UTC by Andy Grundman
Modified: 2010-04-08 17:25 UTC (History)
4 users (show)

See Also:
Category: Bug


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Grundman 2009-12-16 05:52:34 UTC
All the queries used by iPeng to build it's caches perform pretty badly in 
TinySC.  CPU is pegged for many minutes when iPeng connects. Mostly this is due 
to heavy use of DBIx::Class, so this code should be improved with native DBI 
queries if possible.
Comment 1 Joerg Schwieder 2009-12-16 06:06:55 UTC
Anything I can do from the iPeng side to support this?

I believe the main burden is on the albums query which requests albums+artists (for the album), I believe this query is implemented in a very inefficient manner, doing one artist query per album instead of building a joint index or something.

I _need_ the artist, but it would be possible to e.g. query the artist in a second run if this speeds things up (currently, it would slow things further down)
Comment 2 Andy Grundman 2009-12-16 06:11:29 UTC
I'm going to take a look first at improving the queries, I'm sure it can be fixed on the server side.
Comment 3 SVN Bot 2009-12-17 11:28:13 UTC
 == Auto-comment from SVN commit #29649 to the slim repo by andy ==
 == https://svn.slimdevices.com/slim?view=revision&revision=29649 ==

Bug 15313, reduce queries for albums query with tags a, used by iPeng. This may return wrong artist results for albums, this is only a partial fix
Comment 4 Andy Grundman 2009-12-18 11:36:51 UTC
The albums query is much better now, probably good enough.  What do you think 
Joerg?
Comment 5 Joerg Schwieder 2009-12-18 11:50:00 UTC
TinySC only?
From which build on is this? Will give it a try.
Comment 6 Andy Grundman 2009-12-18 11:51:22 UTC
7.5-embedded and it's in last night's Fab4 nightly.
Comment 7 Joerg Schwieder 2009-12-18 14:15:09 UTC
OK, gave it a try on FAB 4.
I still can't get embedded to run, it hangs as soon as I connect iPeng or open the web UI, maybe some plugin incompatibility.

FAB4 looks good, though. I only have a limited library of ~250 Albums and ~3.000 tracks to test with on USB but the cache sync was reasonably fast (similar to my normal Via C7 system) even though a scan was running in the background and the device was playing music (from the USB drive) during the time. I also did a few cache flushes in the row and synced all caches simultaneously (what iPeng usually does not do).

You mentioned some possible artists mismatches, I didn't get any of those (checked all albums), is this comment still valid?

One thing: TinySC does not group multiple-disc albums, is this still how it's supposed to be?
Comment 8 Andy Grundman 2009-12-18 14:27:37 UTC
Artist results in the album query should be fine, I was wrong about that.

Default of groupdiscs=1 will be set later, but it's buggy right now.
Comment 9 SVN Bot 2009-12-29 12:53:19 UTC
 == Auto-comment from SVN commit #29702 to the slim repo by andy ==
 == https://svn.slimdevices.com/slim?view=revision&revision=29702 ==

Fixed bug 15313, refactor albums query to use native DBI, much faster now.  Removed Jive query cache now that the 3 main queries are fast enough to not need it
Comment 10 Chris Owens 2010-04-08 17:25:02 UTC
This bug has been marked fixed in a released version of Squeezebox Server or the accompanying firmware or mysqueezebox.com release.

If you are still seeing this issue, please let us know!