Files
fleet/infrastructure/loadtesting/terraform/variables.tf
T
Victor Lyuboslavsky 426de4e5a8 Loadtest: make MySQL max open conns tunable (#44802) (#48472)
Replace the hardcoded FLEET_MYSQL_MAX_OPEN_CONNS=10 in the loadtest
terraform (both the root ecs.tf stack and the infra/ stack) with a
mysql_max_open_conns variable, applied to both the writer and
read-replica pools.

Also document per-tier connection pool sizing in the AWS reference
architecture: 20 for R-class instances (25k+ hosts), 10 for the smaller
T-class instances (5k/10k hosts) whose low default max_connections
(~90/135) leaves little headroom.

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #44802



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added a configurable setting for MySQL connection limits in the load
testing environment.
* Connection settings now use a shared input value instead of fixed
defaults, making it easier to tune database load behavior across
container types.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-04 06:48:22 +01:00

51 lines
1.7 KiB
Terraform

variable "tag" {
description = "The tag to deploy. This would be the same as the branch name"
}
variable "git_branch" {
description = "The git branch to use to build loadtest containers. Only needed if docker tag doesn't match the git branch"
type = string
default = null
}
variable "fleet_config" {
description = "The configuration to use for fleet itself, gets translated as environment variables"
type = map(string)
default = {}
}
variable "loadtest_containers" {
description = "The number of containers to loadtest with"
type = number
default = 0
}
variable "fleet_containers" {
description = "The number of containers running Fleet"
type = number
default = 10
}
variable "db_instance_type" {
description = "The type of the loadtesting db instances. Default is db.r6g.4xlarge."
type = string
default = "db.r6g.4xlarge"
}
variable "mysql_max_open_conns" {
description = "Max open MySQL connections per Fleet container, applied to both the writer and read-replica pools. A single Aurora instance sees roughly fleet_containers * mysql_max_open_conns, up to 2x that on one instance during a failover or with no read replicas (when reader traffic falls back to the writer)."
type = number
default = 10
validation {
condition = var.mysql_max_open_conns > 0
error_message = "var.mysql_max_open_conns must be greater than 0 (0 means unlimited in database/sql, which can exhaust Aurora max_connections)."
}
}
variable "redis_instance_type" {
description = "the redis instance type to use in loadtesting. default is cache.m6g.large"
type = string
default = "cache.m6g.large"
}