Skip to content
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

Reduce CPU while polling for console log changes #1354

Merged
merged 1 commit into from
Dec 12, 2023

Commits on Dec 12, 2023

  1. Reduce CPU while polling for console log changes

    The current implementation polls the file system for changes to stdout/stderr files on disk. This polling causes high CPU while logs are visible in the UI.
    
    To reduce the problem, we introduce a small sleep that happens only when we are caught up with the contents of the file. The delay of 100ms is forever in computer time (i.e. it's a low duty cycle activity) while also being very fast for a human's perception.
    
    Note that if logs start streaming in fast, we will not hit this sleep. It only occurs when we've read everything. If in the subsequent 100ms new logs arrive, they'll all be processed in the next iteration of the loop.
    
    Longer term we hope to have a console log streaming API from DCP for this.
    drewnoakes committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    681350f View commit details
    Browse the repository at this point in the history