Skip to content

Commit 7c2c1ea

Browse files
committed
fix: increases DERP send queue length to 512 for increased throughput
Signed-off-by: Spike Curtis <spike@coder.com>
1 parent 0fa29af commit 7c2c1ea

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

derp/derp_server.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@ func init() {
7070
}
7171

7272
const (
73-
perClientSendQueueDepth = 32 // packets buffered for sending
73+
// perClientSendQueueDepth is the number of packets to buffer for sending.
74+
// CODER: We've modified this to 512, up from 32 in upstream Tailscale to improve DERP
75+
// throughput. 32 is an understandable number for big, public DERP servers that Tailscale run,
76+
// serving many thousands of connections, and where Tailscale is footing the bill. In Coder's
77+
// use case, we are serving hundreds to low thousands of users and the user's own company is
78+
// paying the bills. In testing, it increases DERP throughput up to 6x.
79+
perClientSendQueueDepth = 512
7480
writeTimeout = 2 * time.Second
7581
)
7682

0 commit comments

Comments
 (0)