the inner inboundStream
is retaining backpressure, but the outer inboundStream
is not: it is adding a child task to the DiscardingTaskGroup
and immediately continuing to the next connection. instead of allowing a pileup in an AsyncStream
of requests, we are just moving the pileup to the task group. am i missing something here?
the site serves requests in a linear queue to insulate mongod
from concurrent requests. an actor
-based synchronization model doesn’t provide this guarantee because actors are re-entrant.
the swift application is really just an intermediary between the outside world and a local mongod
process. there is not much point in “cancelling” a database request - they are written to execute within a predictable amount of time so cancelling it would have the same amount of latency as just waiting for the query to return.
yeah… persistent metrics are hard. data visualization is hard.
however, it seems unlikely that this is a Query of Death situation, precisely because the site serves requests in a linear queue. if the problem were a specific query, then normal queries made during an attack wouldn’t also be as slow as i’ve observed.