From c09cedf241b973cacd67d250c5d1a34af7da9644 Mon Sep 17 00:00:00 2001 From: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> Date: Wed, 2 Apr 2025 20:27:40 +0000 Subject: [PATCH 1/3] just latency section --- docs/admin/networking/index.md | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/docs/admin/networking/index.md b/docs/admin/networking/index.md index e85c196daa619..90d2fe5043f82 100644 --- a/docs/admin/networking/index.md +++ b/docs/admin/networking/index.md @@ -197,6 +197,64 @@ low-latency browser experiences for geo-distributed teams. To learn more, see [Workspace Proxies](./workspace-proxies.md). +## Latency + +Coder measures and reports several types of latency, providing insights into the performance of your deployment. Understanding these metrics can help you diagnose issues and optimize the user experience. + +There are three main types of latency metrics for your Coder deployment: + +- Dashboard-to-server latency: + + The Coder UI measures round-trip time to the Coder server or workspace proxy using built-in browser timing capabilities. + + This appears in the user interface next to your username, showing how responsive the dashboard is. + +- Workspace connection latency: + + The latency shown on the workspace dashboard measures the round-trip time between the workspace agent and its DERP relay server. + + This metric is displayed in milliseconds on the workspace dashboard and specifically shows the agent-to-relay latency, not direct P2P connections. + + Total end-to-end latency experienced by a user is a combination of dashboard-to-server latency plus this agent-to-relay latency. + +- Database latency: + + For administrators, Coder monitors and reports database query performance in the health dashboard. + +### How latency is classified + +Latency measurements are color-coded in the dashboard: + +- **Green** (<150ms): Good performance. +- **Yellow** (150-300ms): Moderate latency that might affect user experience. +- **Red** (>300ms): High latency that will noticeably affect user experience. + +### View latency information + +- **Dashboard**: The global latency indicator appears in the top navigation bar. +- **Workspace list**: Each workspace shows its connection latency. +- **Health dashboard**: Administrators can view advanced metrics including database latency. +- **CLI**: Use `coder ping ` to measure and analyze latency from the command line. + +### Factors that affect latency + +- **Geographic distance**: Physical distance between users, Coder server, and workspaces. +- **Network connectivity**: Quality of internet connections and routing. +- **Infrastructure**: Cloud provider regions and network optimization. +- **P2P connectivity**: Whether direct connections can be established or relays are needed. + +### How to optimize latency + +To improve latency and user experience: + +- **Deploy workspace proxies**: Place [proxies](./workspace-proxies.md) in regions closer to users, connecting back to your single Coder server deployment. +- **Use P2P connections**: Ensure network configurations permit direct connections. +- **Strategic placement**: Deploy your Coder server in a region where most users work. +- **Network configuration**: Optimize routing between users and workspaces. +- **Check firewall rules**: Ensure they don't block necessary Coder connections. + +For help troubleshooting connection issues, including latency problems, refer to the [networking troubleshooting guide](./troubleshooting.md). + ## Up next - Learn about [Port Forwarding](./port-forwarding.md) From 9e7dc7b1d01e0c27c7cf1ff4cb331f13e747a119 Mon Sep 17 00:00:00 2001 From: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> Date: Wed, 2 Apr 2025 20:37:31 +0000 Subject: [PATCH 2/3] add multiple workspace proxies latency --- docs/admin/networking/workspace-proxies.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/admin/networking/workspace-proxies.md b/docs/admin/networking/workspace-proxies.md index 1a6e1b82fd357..3cabea87ebae9 100644 --- a/docs/admin/networking/workspace-proxies.md +++ b/docs/admin/networking/workspace-proxies.md @@ -208,6 +208,15 @@ up to 60 seconds. ![Workspace proxy picker](../../images/admin/networking/workspace-proxies/ws-proxy-picker.png) +## Multiple workspace proxies + +When multiple workspace proxies are deployed: + +- The browser measures latency to each available proxy independently. +- Users can select their preferred proxy from the dashboard. +- The system can automatically select the lowest-latency proxy. +- The dashboard latency indicator shows latency to the currently selected proxy. + ## Observability Coder workspace proxy exports metrics via the HTTP endpoint, which can be From 0497c0afca5d80b053a4860d14b12f7107bf85c0 Mon Sep 17 00:00:00 2001 From: Edward Angert Date: Thu, 3 Apr 2025 14:19:11 -0400 Subject: [PATCH 3/3] Update docs/admin/networking/index.md --- docs/admin/networking/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/admin/networking/index.md b/docs/admin/networking/index.md index 90d2fe5043f82..bde453cef1fed 100644 --- a/docs/admin/networking/index.md +++ b/docs/admin/networking/index.md @@ -215,7 +215,7 @@ There are three main types of latency metrics for your Coder deployment: This metric is displayed in milliseconds on the workspace dashboard and specifically shows the agent-to-relay latency, not direct P2P connections. - Total end-to-end latency experienced by a user is a combination of dashboard-to-server latency plus this agent-to-relay latency. + To estimate the total end-to-end latency experienced by a user, add the dashboard-to-server latency to this agent-to-relay latency. - Database latency: