HTTP

This section defines servers that agents contact during benchmarks, allowing configurations for multiple targets with specific connection settings

All servers that Hyperfoil should contact must be declared in this section. Before the benchmark starts Hyperfoil agents will open connections to the target servers; if this connection fails the benchmark is terminated immediatelly.

You can either declare single target server (the default one) within this section or more of them:

http:
  host: http://example.com
  ...
http:
- host: http://example.com
  sharedConnections: 100
- host: http://example.com:8080
  sharedConnections: 50

HTTP configuration has these properties:

PropertyDefaultDescription
protocolEither http or https
hostHostname of the server. For convenience you can use the http[s]://host[:port] inline syntax as shown above
port80 or 443Default is based on the protocol
sharedConnections1Number of connections to open. It is recommended to set this property to a non-default value.
connectionStrategySHARED_POOLConnection pooling model (see details below)
addressesSupply list of IPs or IP:port targets that will be used for the connections instead of resolving the host in DNS and using port as set - host and port will be used only for Host headers and SNI. If this list contains more addresses the connections will be split evenly.
requestTimeout30 secondsDefault request timeout, this can be overridden in each httpRequest.
allowHttp1xtrueAllow HTTP 1.1 for connections (e.g. during ALPN).
allowHttp2xtrueAllow HTTP 2.0 for connections (e.g. during ALPN). If both 1.1 and 2.0 are allowed and https is not used (which would trigger ALPN) Hyperfoil will use HTTP 1.1. If only 2.0 is allowed Hyperfoil will start with HTTP 1.1 and perform protocol upgrade to 2.0.
directHttp2falseStart with H2C HTTP 2.0 without protocol upgrade. Makes sense only for plain text (http) connections. Currently not implemented.
maxHttp2Streams100Maximum number of requests concurrently enqueued on single HTTP 2.0 connection.
pipeliningLimit1Maximum number of requests pipelined on single HTTP 1.1 connection.
rawBytesHandlerstrueEnable or disable using handlers that process HTTP response raw bytes.
keyManagerTLS key manager for setting up client certificates.
trustManagerTLS trust manager for setting up server certificates.
useHttpCachetrueMake use of HTTP cache on client-side. If multiple authorities are involved, disable the HTTP cache for all of them to achieve the desired outcomes. The default is true except for wrk/wrk2 wrappers where it is set to false.

Shared connections

This number is split between all agents and executor threads evenly; if there are too many agents/executors each will get at least 1 connection.

When a scalar value is used for this property the connection pool has fixed size; Hyperfoil opens all connections when the benchmark starts and should a connection be closed throughout the benchmark, another connection is reopened instead. You can change this behaviour by composing the property of these sub-properties:

PropertyDescription
coreNumber of connections that will be opened when the benchmark starts. Number of connections in the pool should never drop below this value (another connection will be opened instead).
maxMaximum number of connections in the pool.
bufferHyperfoil will try to keep at least active + buffer connections in the pool where active is the number of currently used connection (those with at least 1 in-flight request)
keepAliveTimeWhen a connection is not used for more than this value (in milliseconds) it will be closed. Non-positive value means that the connection is never closed because of being idle.

Example:

http:
  host: http://example.com
  sharedConnections:
    core: 10
    buffer: 10
    max: 10
    keepAliveTime: 30000

Connection strategies

This property describes the connection pooling model, you can choose from the options below:

StrategyDescription
SHARED_POOLConnections are created in a pool and then borrowed by the session. When the request is complete the connection is returned to the shared pool.
SESSION_POOLSConnections are created in a shared pool. When the request is completed it is not returned to the shared pool but to a session-local pool. Subsequent requests by this session first try to acquire the connection from this local pool. When the session completes all connections from the session-local pool are returned to the shared pool.
OPEN_ON_REQUESTConnections are created before request or borrowed from a session-local pool. When the request is completed the connection is returned to this pool. When the session completes all connections from the session-local pool are closed.
ALWAYS_NEWAlways create the connection before the request and close it when it is complete. No pooling of connections.

KeyManager configuration

All files are loaded when the benchmark is constructed, e.g. on the machine running CLI. You don’t need to upload any files to controller or agent machines.

PropertyDefaultDescription
storeTypeJKSImplementation of the store.
storeFilePath to a file with the store.
passwordPassword for accessing the store file.
aliasKeystore alias.
certFilePath to a file with the client certificate.
keyFilePath to a file with client’s private key.

TrustManager configuration

All files are loaded when the benchmark is constructed, e.g. on the machine running CLI. You don’t need to upload any files to controller or agent machines.

PropertyDefaultDescription
storeTypeJKSImplementation of the store.
storeFilePath to a file with the store.
passwordPassword for accessing the store file.
certFilePath to a file with the server certificate.