spring-cloud / spring-cloud/spring-cloud-gateway
Question: What could be causing this latency?
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
Hello,
I'm having some latency issues with my SCG MVC, I'm running on 4.3.0, latency is pretty high in most of the requests that are routed through the gateway, the ping and the network between the two services is good, it's on the same LAN in DC, ping is <1ms.
the route is something as simple as
return GatewayRouterFunctions.route(authService)
.route(host(gatewayHostname).and(path("/service-path/**")), HandlerFunctions.http(uri))
.before(BeforeFilterFunctions.stripPrefix(1))
.filter(tokenRelay())
.build()
the upstream server takes 343ms, but the full gateway response takes 1.13s
same thing is happening on my local machine, may need to try with a reproducer if possible soon.
I have attached a full grafana trace, with sensitive data redacted, follow this steps to visualize it:
- go to https://play.grafana.org/goto/EnS0xlyNR?orgId=1 (no need for account)
- click on Import trace
- upload the json trace Trace-d04d00-2025-07-09 15_57_06.json
- you should be able to visualize data
do you guys have any tip / suggestion to what else could I check?
thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported GatewayRouterFunctions route and compare the 343 ms upstream time with the 1.13 s full gateway response. Inspect the attached Grafana trace and reproduce the request locally on version 4.3.0 if possible. Done would mean identifying the source of the added latency and documenting a reproducible cause or confirming the required next diagnostic step.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- api, backend, observability, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100