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

Proctree improvements (RSS/Performance) #4261

Merged
merged 4 commits into from
Aug 23, 2024
Merged

Commits on Aug 23, 2024

  1. chore: benchmark proctree

    geyslan committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    36ca022 View commit details
    Browse the repository at this point in the history
  2. perf: remove mutex, add concurrency tests

    Public proctree methods already make use of the mutex of the inner lru
    cache. This commit removes the outer mutex and adds concurrency tests
    to ensure that the proctree is safe to use concurrently.
    geyslan committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    976704f View commit details
    Browse the repository at this point in the history
  3. perf: use proctree expirable lru cache

    hashicorp LRU increases RSS over time. This change uses the proctree
    lru cache to an expirable one, which will remove entries after a
    certain time.
    
    Two flags/options were added to the proctree command to control the
    cache TTLs. The default is 120 seconds.
    
    flags:
    
      --proctree process-cache-ttl=60
      --proctree thread-cache-ttl=60
    
    yaml config:
    
        cache-ttl:
            process: 60
            thread: 60
    geyslan committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    cb89e2f View commit details
    Browse the repository at this point in the history
  4. fix: create a new fresh string for comm

    comm had the same inner address as the original string which it was
    created from (basename). This caused the original underlying bytes to
    be preserved and not garbage collected.
    
    Converting it to a byte slice and then back to a string guarantees that
    a new string is created releasing the original reference.
    geyslan committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    4b89620 View commit details
    Browse the repository at this point in the history