Skip to content

Kong Latency Issue with local docker setup #14398

Open
@frosk1

Description

@frosk1

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

3.9.0

Current Behavior

I was following the official docker setup guides:
https://docs.konghq.com/gateway/3.10.x/install/docker/

To setup a local docker kong conatiner in dbless mode.

I also spawn an nginx container for kong to proxy requests to.

Unfortunately I get a huge 40seconds latency (X-Kong-Proxy-Latency: 40020) see here:

curl -i http://localhost:8000/mock -H "Connection: close"

HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Content-Length: 615
Connection: close
Server: nginx/1.27.4
Date: Fri, 04 Apr 2025 23:12:31 GMT
Last-Modified: Wed, 05 Feb 2025 11:06:32 GMT
ETag: "67a34638-267"
Accept-Ranges: bytes
X-Kong-Upstream-Latency: 1
**X-Kong-Proxy-Latency: 40020**
Via: 1.1 kong/3.9.0
X-Kong-Request-Id: f8c007238db998260a2d6957e9c83a32

Expected Behavior

only seeing a few ms for this.

Steps To Reproduce

  1. Ubuntu 22.04.5 LT
  2. Kong 3.9.0 docker image
  3. Start kong docker via:
docker run -d --rm --name kong-dbless \
--network=kong-net \
-v "$(pwd):/kong/declarative/" \
-e "KONG_DATABASE=off" \
-e "KONG_DECLARATIVE_CONFIG=/kong/declarative/kong.yml" \
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
-e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001" \
-e "KONG_ADMIN_GUI_URL=http://localhost:8002" \
-p 8000:8000 \
-p 8443:8443 \
-p 8001:8001 \
-p 8444:8444 \
-p 8002:8002 \
-p 8445:8445 \
-p 8003:8003 \
-p 8004:8004 \
kong:3.9.0
  1. with kong declarative config like this:
_format_version: "3.0"
_transform: true

services:
  - name: example_service
    host: echo-nginx
    port: 80
    protocol: http
    routes:
      - name: example_route
        paths:
          - /mock
        strip_path: true
  1. start nginx echo via:
docker run -d --rm --name echo-nginx --network kong-net -p 2082:80 nginx
  1. perform curl:
curl -i http://localhost:8000/mock

Anything else?

I dont know whats going on in Kong, the upstream service is not the issue according to the curl outcome. stale or zombi tcp things are also not going on I literally checked everything there, also no hanging connections as well...

Can someone help here, what is happening where do those 40s come from?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions