A Computable Residency Threshold for p99 Latency Collapse in Streaming Java Microservices: Spring MVC Versus Spring WebFlux Under Spring AI Token-Stream Workloads
Modern Java web services increasingly expose streaming endpoints that hold server resources for seconds per request, including large language model (LLM) chat endpoints built with Spring AI. Prior comparisons of asynchronous and reactive Java stacks focused on requests that released their resources in milliseconds. This study tests a residency-threshold hypothesis under sustained open-loop load. For a servlet-asynchronous implementation in which each stream occupies one of T workers, T/E[response] gives a nominal capacity estimate from the below-knee mean worker residency E[response]. On a calibrated 150-token chat workload, the nominal threshold was 204 requests per second. The asynchronous p99 was 4.5× the reactive p99 at 200 requests per second and 9.2× at 210 over 180-s measurement windows, with zero rejections in these cells. Queue growth at 210 requests per second implies an effective completion rate of approximately 193 tasks per second, consistent with degradation at 200. Across 108 measurement cells, the transition also appeared without the AI abstraction, moved earlier when a mid-stream tool call extended worker residency, and had no reactive counterpart within the measured grid. A buffered control and an output-token sweep support the role of worker residency. The nominal threshold and the observed onset of queueing provide complementary information for capacity planning.
Authors
- Alexandru Boicea (ORCID: https://orcid.org/0000-0001-9739-0161)
- Cătălin Tudose (ORCID: https://orcid.org/0009-0008-0461-8939)
- Andrei Zbarcea
- Victor Asavei
Publication Details
- Journal
- Preprints.org
- Published
- 2026-11-26
- DOI
- https://doi.org/10.20944/preprints202611.2699.v1
- Primary Topic
- Software System Performance and Reliability
- Type
- preprint