Summarizing container hurts responsiveness
Notes based on Igor's feedback and Team's thread
There are other reasons for unresponsiveness (like we are breaking op processing into chunks and yielding between batches every once in a while to let other activity go through).
-
We create summarizing container right away on becoming connected (which happens right after processing a ton of ops for main container). Can we have some delay / maybe heuristic to know when there is some idleness?
-
I'm not sure this is Igor's issue, but we could be more efficient by not closing summarizing container on loss of connection (which happens frequently due to PUSH closing socket). Instead of starting expensive process of hydrating new summarizing container after main one connects, we can have some fuzzy logic to reuse old container in some cases. For example, if we reconnect within next 15 seconds, processing ops would be more efficient. Or even better - if re-connection and processing of ops by main container was fast / did not include summary acks, then processing of ops is preferred over starting new summarizing container.
-
We have awaits in many places, but these places are unlikely to yield enough time for user-critical tasks. Should we insert in various places calls that would assess duration between those calls and if too much time elapsed, they would use timer to yield some amount of time for other things?
Created issue #1088 to track (1) above.
As a note, (2) above was partially addressed in work to recover documents and reinforcing the SummaryManager state machine.
Now when a summarizer client is created, it will always call run on that created one. So for fast disconnect reconnect scenarios, we won't be respawning as many as possible in between these transitions, we will be waiting for the summarizer client to finish connecting and then disconnecting before taking additional actions. This should reduce the overhead between states a bit.
There is still more room for improvement here, so I'll leave this issue open.
Referencing PR: #1838.
Related: #3969 (if not dupe...)
Yes, it's a dup and not worth keeping.