feat(subscriber): Reduce default retention to six seconds#504
feat(subscriber): Reduce default retention to six seconds#504grahamking wants to merge 1 commit into
Conversation
`tokio-console`'s default `retain_for` is six seconds. These two values should match, no point send tokio-console information it's not going to use. Fixes the display issue where on initial connect tokio-console will show hundreds of tasks, and then immediately stop displaying them. Reduces default memory usage.
|
The reason that the retention periods for I'm definitely open to changes to these default values, as they were picked pretty arbitrarily, but it's important to consider that they're controlling fairly different things. |
|
I didn't realise that thanks. The trouble I hit, and I think many people hit, is that the one hour retention looks an awful lot like a memory leak. Memory grows (often quite rapidly) for the first hour. It also makes the message too big for tokio-console to decode, so after a few minutes that stopped working for me (hopefully #503 will help). Would it be possible to only keep the objects that are a parent? I haven't looked yet, but if you think it can be done I could try working on that instead. |
Hmm, we could look into something like that. It's somewhat complex, because we don't know if a span will be the parent of another span when the span is created; it only becomes a parent when another span is created inside it. However, we could track whether a closed span is the parent of a currently open span, and only retain spans if they are currently live or the parent of a currently live span. That would allow us to retain significantly less data. If you're still interested to work on that, I would be happy to merge a PR making such a change, and I can help answer questions about how to implement it. Another option for reducing memory use, which might be a bigger project, is to change the |
tokio-console's defaultretain_foris six seconds. These two values should match, no point send tokio-console information it's not going to use.Fixes the display issue where on initial connect tokio-console will show hundreds of tasks, and then immediately stop displaying them.
Reduces default memory usage.