Uploaded image for project: 'ListenBrainz'
  1. ListenBrainz
  2. LB-1584

Extremely slow lookup times/timeout when requesting listens with huge insert and listen date difference

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • API
    • None

      I noticed something really odd going on when fetching listens that have been inserted a long time after they got listened to.

      I started slowly but surely adding listens on the 01 of june 2023 for recordings I knew I listened to in the past, but not sure when. This has for consequence that the listened_at and the inserted_at date being widely different:

      {{

      {"inserted_at": 1714719745,"listened_at": 1688194938}

      }}

       

      But one thing I noticed, is the huge response time on the web UI, and api requests just straight up being timed out. Here's a link to demonstrate

      https://listenbrainz.org/user/RustyNova/?max_ts=1702569461

      https://api.listenbrainz.org/1/user/rustynova/listens?max_ts=1702569461

       

      It is probably not good for the postgre server either to go fetch those listens, so would be great to have it fixed

          [LB-1584] Extremely slow lookup times/timeout when requesting listens with huge insert and listen date difference

          Monkey added a comment - - edited

          I think this might be the same issue as LB-1630, as if you ask for a single or a few listens the response time is acceptable: https://api.listenbrainz.org/1/user/rustynova/listens?max_ts=1702569461&count=5

          However, it tries by default to request 25 listens, and if there is a large amount of time in-between listens the request will take a looooong time.

          Monkey added a comment - - edited I think this might be the same issue as LB-1630 , as if you ask for a single or a few listens the response time is acceptable: https://api.listenbrainz.org/1/user/rustynova/listens?max_ts=1702569461&count=5 However, it tries by default to request 25 listens, and if there is a large amount of time in-between listens the request will take a looooong time.

            Unassigned Unassigned
            RustyNova RustyNova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Version Package