Search code examples
open-liberty

How can I limit the number of HTTP connections in OpenLiberty?


I want to limit the number of HTTP connections for web applications on OpenLiberty. Which parameters should I change to do this? I'm looking at the docs, should I change maxConcurrentStreams in HTTPOption or maxThread in executer?


Solution

  • There isn't an existing property to specifically limit HTTP connections, so I'd recommend using maxOpenConnections, which is a tcpOptions configuration[1]. That property allows you to restrict the number of open connections for a TCP endpoint. The default value is 128000.

    maxConcurrentStreams applies specifically to HTTP/2 the number of streams that are allowed per HTTP/2 (TCP) connection, and maxThread won't directly accomplish what you want.

    [1] https://openliberty.io/docs/21.0.0.2/reference/config/httpEndpoint.html#tcpOptions