Log viewer performance does not scale well
-
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).
-
@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. -
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.
-
@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?
-
@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). -
@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.