Skip to content

Significant RAM and CPU impact #252

@bengotow

Description

@bengotow

Hey folks! I installed Scout APM on our service last night (deployment 6dca in the graphs below) and have noticed some really significant RAM and CPU impacts that will force us to disable it again for now. I'm sure this is NOT typical but our application isn't super unusual so I wanted to bring it to your attention. Most interestingly it does not seem to be correlated with volume of traffic to the service - this is actually nice because I think it narrows down the problem quite a bit.

Service details:

  • Express application running NodeJS 12 using TypeORM and Postgres (pg)
  • Fairly low traffic app - no more than 10 requests / second typically.
  • Also using Sentry for error reporting and Sqreen (https://www.sqreen.com/) a security agent our client requires.
    + I think this Sqreen service could be interacting with ScoutAPM, both do sketchy observational stuff. ;-)

When the app launches it calls setInterval to schedule a few recurring tasks, and it also calls an async function that sits in a loop processing data from another system forever. I unfortunately can't share the code, but it more or less looks like this. I suspect that somehow this is causing Scout to keep data/context around forever - there's nothing else I can think of that would increase RAM usage by 500MB.

If I get a chance I can try to make a sample project to repro but I don't think I'll have time in the next week.

# main.ts

async function pollQueue() {
  while (true) {
     // use `request` module to hit an internal API
     // use TypeORM to make several pg queries and process results, queue more jobs
     await sleep(500ms)
  }
}
pollQueue()

image

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions