Skip to content

[Announcement]: 12/8/25: Upcoming change to the default value of MaxConnsPerHost in SDK HTTP clients #3243

@lucix-aws

Description

@lucix-aws

An upcoming release of aws-sdk-go-v2 on 12/8/25 will ship a behavioral change in the default HTTP client behavior used by the SDK. Specifically, the value of http.Transport.MaxConnsPerHost will be set to 2048 instead of 0.

The previous value of zero meant that there was no hard limit. We believe this change is necessary to prevent customers from accidentally creating request storms, which can lead to production pain and inflated billing costs. We chose 2048 as a middle ground - we don't want to disrupt existing customer workflows with too aggressive of a limit, and we believe the number selected is a reasonable limit such to prevent runaway storms.

We intend to further dial down this number over time as customers adjust to the change. Future changes to the default value would be communicated before release.

Customers of the SDK that are directly configuring their own HTTP client instances (or more specifically, the http.Transport used by the stdlib HTTP client) will not be affected.

As a reminder, you can configure your own HTTP client and transport by setting HTTPClient on a service client's options. You can do this globally through config.LoadDefaultConfig + NewFromConfig, or directly in New/NewFromConfig using functional options.

A utility API, NewBuildableClient, exists to simplify this configuration. The following sample program demonstrates its usage.

package main

import (
	"context"
	"net/http"

	awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
	"github.com/aws/aws-sdk-go-v2/config"
	"github.com/aws/aws-sdk-go-v2/service/s3"
)

func main() {
	httpClient := awshttp.NewBuildableClient().
		WithTransportOptions(func(t *http.Transport) {
			t.MaxConnsPerHost = 0 // no limit
		})

	// option 1: set custom http client on shared config
	cfg, err := config.LoadDefaultConfig(context.Background(),
		config.WithHTTPClient(httpClient))
	if err != nil {
		panic(err)
	}

	// option 2: set custom http client on specific service
	svc := s3.NewFromConfig(cfg, func(o *s3.Options) {
		o.HTTPClient = httpClient
	})
	if err != nil {
		panic(err)
	}

	// ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    announcementThis is an announcement issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions