Skip to content

Web console: Severe performance problems viewing large log files #5474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spadgett opened this issue Oct 29, 2015 · 13 comments
Closed

Web console: Severe performance problems viewing large log files #5474

spadgett opened this issue Oct 29, 2015 · 13 comments

Comments

@spadgett
Copy link
Member

I tried to load the log for my heapster pod, which is at least 20K+ lines. It took maybe 15 minutes, consumed 1GB of RAM, and pegged my CPU at over 100% when I finally stopped it. The only thing I've done in the browser tab since refreshing is view the log.

screen shot 2015-10-28 at 8 24 27 pm

Looping `ng-repeat` over each log line is likely the problem. We're also passing each line to `filter : logSearch`, which I didn't think was used. Still working on profiling it.

I also noticed that my Vagrant VM running OpenShift was using ~125% CPU.

/cc @jwforres @benjaminapetersen

@spadgett
Copy link
Member Author

CPU Usage:

openshift_web_console_and_2__hack_serve-local-assets_sh__bash_

@smarterclayton
Copy link
Contributor

Verify you have at least master in the last day - just to eliminate the potential for the CPU bug jordan fixed.

@liggitt
Copy link
Contributor

liggitt commented Oct 29, 2015

How does a large log get chunked? One message per line? 20k messages would be a lot

@liggitt
Copy link
Contributor

liggitt commented Oct 29, 2015

Possible leads for large list performance: http://tech.small-improvements.com/2013/09/10/angularjs-performance-with-large-lists/

@jwforres
Copy link
Member

Some thoughts at 2am...

We knew we were going to hit some issues here, which is why we requested the api enhancements for partial log retrieval. Did any of those happen to get done early?

Is there any way for us to do a preemptive HEAD request to know how big the log would be? For very large logs we could show a message like github does with large files/diffs and recommend using the cli... guessing our raw file download would still cause problems since it does things in memory

@spadgett
Copy link
Member Author

Verify you have at least master in the last day - just to eliminate the potential for the CPU bug jordan fixed.

Yeah, I did a clean build of the latest yesterday evening before seeing this.

@spadgett
Copy link
Member Author

How does a large log get chunked? One message per line?

Yes, one message for each line.

@spadgett
Copy link
Member Author

If I remove the ng-repeat rendering of the log, CPU usage drops to 10-15%, so the problem seems to be client side.

@jwforres
Copy link
Member

So the only reason to have the lines broken out into individual divs, vs
just using a

 was to add the line numbers to the front

On Thu, Oct 29, 2015 at 9:37 AM, Sam Padgett [email protected]
wrote:

If I remove the ng-repeat rendering of the log, CPU usage drops to
10-15%, so the problem seems to be client side.


Reply to this email directly or view it on GitHub
#5474 (comment).

@spadgett
Copy link
Member Author

If I use direct DOM manipulation instead of ng-repeat, performance is quite a bit better although the log still loads somewhat slowly. We might be gated by how fast the data comes over the web socket.

@jwforres
Copy link
Member

Not surprising, angular falls over after a certain number of data bindings
:)

On Thu, Oct 29, 2015 at 9:48 AM, Sam Padgett [email protected]
wrote:

If I use direct DOM manipulation instead of ng-repeat, performance is
quite a bit better although the log still loads somewhat slowly. We might
be gated by how fast the data comes over the web socket.


Reply to this email directly or view it on GitHub
#5474 (comment).

@spadgett
Copy link
Member Author

So the only reason to have the lines broken out into individual divs, vs just using a <pre> was to add the line numbers to the front

We can still add line numbers, although this is not very "Angular."

        var lineNumber = 1;
        streamer.onMessage(function(msg) {
          $('<div class="log-line"/>').text(lineNumber + ": " + msg).appendTo('#logContent');
          lineNumber++;
        });

@smarterclayton
Copy link
Contributor

All of the things we discussed are in.

limitBytes - total number of bytes returned in a chunk
tail - last N lines
sinceTimestamp = time or sinceSeconds = relative time in seconds

time + tail + limitBytes should work correctly.

On Thu, Oct 29, 2015 at 2:31 AM, Jessica Forrester <[email protected]

wrote:

Some thoughts at 2am...

We knew we were going to hit some issues here, which is why we requested
the api enhancements for partial log retrieval. Did any of those happen to
get done early?

Is there any way for us to do a preemptive HEAD request to know how big
the log would be? For very large logs we could show a message like github
does with large files/diffs and recommend using the cli... guessing our raw
file download would still cause problems since it does things in memory


Reply to this email directly or view it on GitHub
#5474 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants