spring-cloud / spring-cloud/spring-cloud-gateway

Question: What could be causing this latency?

Open
#3,846 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
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.

Image

I have attached a full grafana trace, with sensitive data redacted, follow this steps to visualize it:

  1. go to https://play.grafana.org/goto/EnS0xlyNR?orgId=1 (no need for account)
  2. click on Import trace
  3. upload the json trace Trace-d04d00-2025-07-09 15_57_06.json
  4. you should be able to visualize data
Image

do you guys have any tip / suggestion to what else could I check?

thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.