metaphysics icon indicating copy to clipboard operation
metaphysics copied to clipboard

[Optimizations] Try to reduce peak memory usage

Open alloy opened this issue 7 years ago • 2 comments

Besides our throughput going down when under pressure, we’d also like to run on smaller Heroku dynos.

@craigspaeth Can you paste dump any of your current investigations here?

  • [ ] Add per-request GraphQL insights to NewRelic, so we can find the queries that trigger these spikes. #492.

alloy avatar Dec 07 '16 01:12 alloy

It appears we have an occasional run-away memory leak not obviously associated with spikes in throughput.

image

I do see a correlation in Gravity response time with the most recent memory spike, but as you can see below it doesn't correspond with the prior two spikes:

image

Because NewRelic doesn't breakdown by GraphQL query, it's tricky to get much insight from it. We could try implementing Apollo Optics to do better, but we might also be able to implement some manual reporting to NR to get enough of a breakdown.

These spikes only started after the last deploy which comes with these changes...

image

...digging through those PRs, I'm pretty convinced it's in this PR with one of the updated deps.

craigspaeth avatar Dec 07 '16 01:12 craigspaeth

Because NewRelic doesn't breakdown by GraphQL query, it's tricky to get much insight from it. We could try implementing Apollo Optics to do better, but we might also be able to implement some manual reporting to NR to get enough of a breakdown.

I agree that we need this first, we need to be able to reproduce the leak to diagnose it.

I’ll get on that first.

alloy avatar Dec 07 '16 15:12 alloy