Skip to content

Ory Tunnel requests are 2x slower than hitting Ory Network directly #315

@mt-krainski

Description

@mt-krainski

Preflight checklist

Describe the bug

I noticed that making a request through an Ory Tunnel is roughly 2x slower than making a request directly to Ory.

I think the culprit is here: https://github.com/ory/cli/blob/5e5efa77c077225c16416d85984d0a311f02e82e/cmd/cloudx/proxy/proxy.go#L180C1-L181C1

My Go is not great, but if I understand correctly, this will call Ory for every request the tunnel/proxy is receiving, even if that request is /sessions/whoami? This means that the identity of the user is verified first and then the actual request is handled, which makes sense for the Ory Proxy when it proxies requests to a separate backend service, but perhaps doesn't make sense if the proxy or tunnel are actually proxying a request to Ory?

Reproducing the bug

  1. Get a session token or cookie from an Ory session
  2. Call Ory directly and time the request duration
  3. Call Ory through an Ory Tunnel and time the request duration

I can provide a more detailed steps to reproduce, but I think the difficulty here is that it requires the specific Ory session token and Ory domain to try with

Relevant log output

No response

Relevant configuration

No response

Version

v0.1.36

On which operating system are you observing this issue?

Ory Network

In which environment are you deploying?

Ory Network

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions