Forem Creators and Builders 🌱

Discussion on: This is the best optimization PR.

Collapse
 
ellativity profile image
Ella (she/her/elle) • Edited

@jamie @djuber @jdoss πŸ™Œ

Collapse
 
jamie profile image
Jamie Gaskins

Thanks for the ping @ellativity !

It turns out that there was a small memory leak that only shows itself in some configurations β€” it still existed even in DEV, but it was such a slow leak in DEV's config (and we run it on pretty beefy instances) that it didn't cause any trouble and was honestly only detectable in certain visualizations of the graph. Self-hosters were the main ones to see this issue. Specifically, if you didn't have certain env vars configured, the recurring job that caused the leak would fail and run 10x as often.

And there was another configuration bug that compounded it by holding telemetry data in memory if there was nowhere to report it to.

We fixed one of them last week and the other this week and the default self-host config now has a constant memory profile. Here's how it all played out on one of our internal self-hosted instances in the out-of-the-box configuration:

Forem self-host memory usage in the default configuration. Memory usage first goes up very steeply with both memory leaks in play, then after the first was fixed it rose more slowly but still shows evidence of a leak. After the second leak was fixed, memory usage remains relatively constant.

Note the sharp rise in memory in the beginning, then after the first leak was fixed we noticed the second one. Then after we fixed that one, it all smoothed right out! These fixes should help self-hosted communities immensely! πŸ’―

Collapse
 
akhil profile image
Akhil Naidu

Yes, it really helped a lot.