Skip to content

Commit 43d584c

Browse files
authored
docs: add a section about latency and how it's measured (#16734)
closes #14942 - what latency is measured - where it's reported - how users experience latency - how to lower latency [preview](https://coder.com/docs/@14942-latency/admin/networking#latency) --------- Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com>
1 parent 42e5d71 commit 43d584c

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

docs/admin/networking/index.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,64 @@ low-latency browser experiences for geo-distributed teams.
197197

198198
To learn more, see [Workspace Proxies](./workspace-proxies.md).
199199

200+
## Latency
201+
202+
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.
203+
204+
There are three main types of latency metrics for your Coder deployment:
205+
206+
- Dashboard-to-server latency:
207+
208+
The Coder UI measures round-trip time to the Coder server or workspace proxy using built-in browser timing capabilities.
209+
210+
This appears in the user interface next to your username, showing how responsive the dashboard is.
211+
212+
- Workspace connection latency:
213+
214+
The latency shown on the workspace dashboard measures the round-trip time between the workspace agent and its DERP relay server.
215+
216+
This metric is displayed in milliseconds on the workspace dashboard and specifically shows the agent-to-relay latency, not direct P2P connections.
217+
218+
To estimate the total end-to-end latency experienced by a user, add the dashboard-to-server latency to this agent-to-relay latency.
219+
220+
- Database latency:
221+
222+
For administrators, Coder monitors and reports database query performance in the health dashboard.
223+
224+
### How latency is classified
225+
226+
Latency measurements are color-coded in the dashboard:
227+
228+
- **Green** (<150ms): Good performance.
229+
- **Yellow** (150-300ms): Moderate latency that might affect user experience.
230+
- **Red** (>300ms): High latency that will noticeably affect user experience.
231+
232+
### View latency information
233+
234+
- **Dashboard**: The global latency indicator appears in the top navigation bar.
235+
- **Workspace list**: Each workspace shows its connection latency.
236+
- **Health dashboard**: Administrators can view advanced metrics including database latency.
237+
- **CLI**: Use `coder ping <workspace>` to measure and analyze latency from the command line.
238+
239+
### Factors that affect latency
240+
241+
- **Geographic distance**: Physical distance between users, Coder server, and workspaces.
242+
- **Network connectivity**: Quality of internet connections and routing.
243+
- **Infrastructure**: Cloud provider regions and network optimization.
244+
- **P2P connectivity**: Whether direct connections can be established or relays are needed.
245+
246+
### How to optimize latency
247+
248+
To improve latency and user experience:
249+
250+
- **Deploy workspace proxies**: Place [proxies](./workspace-proxies.md) in regions closer to users, connecting back to your single Coder server deployment.
251+
- **Use P2P connections**: Ensure network configurations permit direct connections.
252+
- **Strategic placement**: Deploy your Coder server in a region where most users work.
253+
- **Network configuration**: Optimize routing between users and workspaces.
254+
- **Check firewall rules**: Ensure they don't block necessary Coder connections.
255+
256+
For help troubleshooting connection issues, including latency problems, refer to the [networking troubleshooting guide](./troubleshooting.md).
257+
200258
## Up next
201259

202260
- Learn about [Port Forwarding](./port-forwarding.md)

docs/admin/networking/workspace-proxies.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,15 @@ up to 60 seconds.
208208

209209
![Workspace proxy picker](../../images/admin/networking/workspace-proxies/ws-proxy-picker.png)
210210

211+
## Multiple workspace proxies
212+
213+
When multiple workspace proxies are deployed:
214+
215+
- The browser measures latency to each available proxy independently.
216+
- Users can select their preferred proxy from the dashboard.
217+
- The system can automatically select the lowest-latency proxy.
218+
- The dashboard latency indicator shows latency to the currently selected proxy.
219+
211220
## Observability
212221

213222
Coder workspace proxy exports metrics via the HTTP endpoint, which can be

0 commit comments

Comments
 (0)