Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Log viewer performance does not scale well

    Support
    logs
    4
    9
    344
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      Robin last edited by girish

      If an app outputs a reasonable volume of logging (let's say, a few hundred lines), the performance of a browser tab viewing those logs seems to bog down pretty seriously over time.

      I don't know for sure how the viewer is implemented, but if it's trying to keep the entire log content loaded, that might be a problem with some more chatty apps. And if it's trying to keep it all in the DOM, that's also perhaps a problem.

      I imagine this isn't an easy problem to solve, just thought I'd report it 🙂

      (I'm using Firefox if it matters).

      nebulon 1 Reply Last reply Reply Quote 1
      • nebulon
        nebulon Staff @Robin last edited by

        @robin This is exactly how it is implemented and indeed not very smart but simple. I've done a couple of basic approaches to fix this, but it gets hard quickly and thus resorted to "just reload the browser for now"

        Also as a workaround during app packaging, where one might want to keep a long backlog, using the cloudron logs -f in a native terminal will nearly always be better.

        1 Reply Last reply Reply Quote 1
        • robi
          robi last edited by

          How can we get the equivalent of a a tail -n 200 + tail -fas the input to the log viewer?

          Life of Advanced Technology

          1 Reply Last reply Reply Quote 0
          • girish
            girish Staff last edited by

            I run into this often in development. In fact, sometimes it freezes firefox entirely 🙂

            On a side note, I also don't like that the apptask logs and app logs are interleaved and thus appear out of order. This is mostly a limitation of our logging system.

            robi 1 Reply Last reply Reply Quote 0
            • robi
              robi @girish last edited by

              @girish said in Log viewer performance does not scale well:

              On a side note, I also don't like that the apptask logs and app logs are interleaved and thus appear out of order. This is mostly a limitation of our logging system.

              can they be tagged differently?

              Life of Advanced Technology

              girish 1 Reply Last reply Reply Quote 0
              • girish
                girish Staff @robi last edited by

                @robi yes. they are in different files - app.log and apptask.log . we were lazy and just do tail -f apptask.log app.log . But what needs to happens is to read each file line by line and order the log lines based on the timestamp. This is only a problem for content already existing in the log files. When new log lines get added, it will interleave correctly (because of how tail works).

                robi 1 Reply Last reply Reply Quote 0
                • robi
                  robi @girish last edited by robi

                  @girish sounds like you need a time tag to help sync the previous logs too. Like the "clap" used in in audio/video.

                  Or perhaps be even more clever, and cat the files into a temp file thats aligned, which is then appended by the tail -f.

                  Using a ring buffer to avoid excessive memory usage.

                  Life of Advanced Technology

                  girish 1 Reply Last reply Reply Quote 0
                  • girish
                    girish Staff @robi last edited by

                    @robi we have the time tag too (it's on each line) . we just have to sort it, but it's not annoyed me enough yet to do it 🙂

                    robi 1 Reply Last reply Reply Quote 0
                    • robi
                      robi @girish last edited by

                      @girish lol, "Just do it!" 😉

                      Life of Advanced Technology

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Powered by NodeBB