Skip to content

Commit 682467e

Browse files
committed
add comment on idle conn tuning
1 parent 698e697 commit 682467e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

coderd/tailnet.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,14 @@ func NewServerTailnet(
9999
transport: tailnetTransport.Clone(),
100100
}
101101
tn.transport.DialContext = tn.dialContext
102-
tn.transport.MaxIdleConnsPerHost = 10
102+
// These options are mostly just picked at random, and they can likely be
103+
// fine tuned further. Generally, users are running applications in dev mode
104+
// which can generate hundreds of requests per page load, so we increased
105+
// MaxIdleConnsPerHost from 2 to 6 and removed the limit of total idle
106+
// conns.
107+
tn.transport.MaxIdleConnsPerHost = 6
103108
tn.transport.MaxIdleConns = 0
109+
tn.transport.IdleConnTimeout = 10 * time.Minute
104110
// We intentionally don't verify the certificate chain here.
105111
// The connection to the workspace is already established and most
106112
// apps are already going to be accessed over plain HTTP, this config

0 commit comments

Comments
 (0)