Skip to content

Commit

Permalink
tweak resolver config
Browse files Browse the repository at this point in the history
  • Loading branch information
bnewbold committed Feb 23, 2025
1 parent ee1f3ea commit 2ad64c7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cmd/domesday/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,23 @@ func NewServer(config Config) (*Server, error) {
baseDir := identity.BaseDirectory{
PLCURL: config.PLCHost,
HTTPClient: http.Client{
Timeout: time.Second * 10, // TODO: config
Timeout: time.Second * 10,
Transport: &http.Transport{
// would want this around 100ms for services doing lots of handle resolution (to reduce number of idle connections). Impacts PLC connections as well, but not too bad.
IdleConnTimeout: time.Millisecond * 100,
MaxIdleConns: 1000,
},
},
Resolver: net.Resolver{

Check failure on line 58 in cmd/domesday/server.go

View workflow job for this annotation

GitHub Actions / build-and-test

undefined: net
Dial: func(ctx context.Context, network, address string) (net.Conn, error) {

Check failure on line 59 in cmd/domesday/server.go

View workflow job for this annotation

GitHub Actions / build-and-test

undefined: net
d := net.Dialer{Timeout: time.Second * 3}

Check failure on line 60 in cmd/domesday/server.go

View workflow job for this annotation

GitHub Actions / build-and-test

undefined: net
return d.DialContext(ctx, network, address)
},
},
PLCLimiter: rate.NewLimiter(rate.Limit(config.PLCRateLimit), 1),
TryAuthoritativeDNS: true,
SkipDNSDomainSuffixes: []string{".bsky.social", ".staging.bsky.dev"},
// TODO: UserAgent: "domesday",
}

// TODO: config these timeouts
Expand Down

0 comments on commit 2ad64c7

Please sign in to comment.