Long time to establish first ping #512

Closed
opened 2025-12-29 02:19:21 +01:00 by adam · 2 comments
Owner

Originally created by @JulienMalka on GitHub (May 18, 2023).

Bug description

Whenever I try to initiate a connection with one of my machines, the first ping is always very slow, taking sometimes up to 10 seconds. After the first connection, I can ping instantly.
I am not sure this is a normal behaviour, as the connection is supposed to go through the DERP servers if a direct connection has not (yet) be made.
This is somewhat confirmed because if I run tailscale ping with a machine where connection has not yet been established I get

pong from machine (fd7a:115c:a1e0::a) via DERP(par) in 3ms
pong from machine (fd7a:115c:a1e0::a) via DERP(par) in 3ms
pong from machine (fd7a:115c:a1e0::a) via DERP(par) in 7ms
pong from machine (fd7a:115c:a1e0::a) via DERP(par) in 3ms
pong from machine (fd7a:115c:a1e0::a) via ip:port in 0s

and it would seem that in this case the connection was made via DERP servers until a direct connection was made. Why is this not the case when I use the ping command or try to initiate a httpconnection ?

Environment

  • OS:
  • Headscale version:
  • Tailscale version:
  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

To Reproduce

Originally created by @JulienMalka on GitHub (May 18, 2023). <!-- Before posting a bug report, discuss the behaviour you are expecting with the Discord community to make sure that it is truly a bug. The issue tracker is not the place to ask for support or how to set up Headscale. Bug reports without the sufficient information will be closed. Headscale is a multinational community across the globe. Our language is English. All bug reports needs to be in English. --> ## Bug description <!-- A clear and concise description of what the bug is. Describe the expected bahavior and how it is currently different. If you are unsure if it is a bug, consider discussing it on our Discord server first. --> Whenever I try to initiate a connection with one of my machines, the first ping is always very slow, taking sometimes up to 10 seconds. After the first connection, I can ping instantly. I am not sure this is a normal behaviour, as the connection is supposed to go through the DERP servers if a direct connection has not (yet) be made. This is somewhat confirmed because if I run `tailscale ping` with a machine where connection has not yet been established I get ``` pong from machine (fd7a:115c:a1e0::a) via DERP(par) in 3ms pong from machine (fd7a:115c:a1e0::a) via DERP(par) in 3ms pong from machine (fd7a:115c:a1e0::a) via DERP(par) in 7ms pong from machine (fd7a:115c:a1e0::a) via DERP(par) in 3ms pong from machine (fd7a:115c:a1e0::a) via ip:port in 0s ``` and it would seem that in this case the connection was made via DERP servers until a direct connection was made. Why is this not the case when I use the `ping` command or try to initiate a `http`connection ? ## Environment <!-- Please add relevant information about your system. For example: - Version of headscale used - Version of tailscale client - OS (e.g. Linux, Mac, Cygwin, WSL, etc.) and version - Kernel version - The relevant config parameters you used - Log output --> - OS: - Headscale version: - Tailscale version: <!-- We do not support running Headscale in a container nor behind a (reverse) proxy. If either of these are true for your environment, ask the community in Discord instead of filing a bug report. --> - [x] Headscale is behind a (reverse) proxy - [ ] Headscale runs in a container ## To Reproduce <!-- Steps to reproduce the behavior. -->
adam added the stalebug labels 2025-12-29 02:19:21 +01:00
adam closed this issue 2025-12-29 02:19:21 +01:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 15, 2023):

This issue is stale because it has been open for 180 days with no activity.

@github-actions[bot] commented on GitHub (Nov 15, 2023): This issue is stale because it has been open for 180 days with no activity.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 30, 2023):

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions[bot] commented on GitHub (Nov 30, 2023): This issue was closed because it has been inactive for 14 days since being marked as stale.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#512