Preprint
Article

This version is not peer-reviewed.

A Computable Residency Threshold for p99 Latency Collapse in Streaming Java Microservices: Spring MVC Versus Spring WebFlux Under Spring AI Token-Stream Workloads

Submitted:

24 November 2026

Posted:

26 November 2026

You are already at the latest version

Abstract
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.
Keywords: 
;  ;  ;  ;  ;  ;  ;  ;  ;  
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.