Skip to content

Port exhaustion regression #198

@ntwilson

Description

@ntwilson

Using FsHttp with the default httpClientFactory on an Azure Web App to send many HTTP requests to the same domain results in SNAT port exhaustion, with the error

System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

From what I can tell, this is because the default factory will create a new HttpClient instance for each request. Microsoft documentation states that if you are not using HttpClientFactory with DI, you should have a singleton HttpClient for the lifetime of your application to avoid the port exhaustion problem.

It looks like this problem was fixed in #37, but then reintroduced later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions