Some loadtesting improvements to solve common issues (#15360)

This commit is contained in:
Robert Fairburn 2023-11-30 16:36:04 -06:00 committed by GitHub
parent 837602a271
commit b31e45244d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 89 deletions

View File

@ -1 +1,2 @@
.external_modules
.terraform.lock.hcl

View File

@ -1,83 +0,0 @@
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/aws" {
version = "4.32.0"
constraints = ">= 3.30.0, ~> 4.32.0"
hashes = [
"h1:d4aUL6/J+BFhh1/Nh2rgctt+dqf07H9PipRn297hIIo=",
"zh:062c30cd8bcf29f8ee34c2b2509e4e8695c2bcac8b7a8145e1c72e83d4e68b13",
"zh:1503fabaace96a7eea4d73ced36a02a75ec587760850e58162e7eff419dcbb31",
"zh:39a1fa36f8cb999f048bf0000d9dab40b8b0c77df35584fb08aa8bd6c5052dee",
"zh:471a755d43b51cd7be3e386cebc151ad8d548c5dea798343620476887e721882",
"zh:61ed56fab811e62b8286e606d003f7eeb7e940ef99bb49c1d283d91c0b748cc7",
"zh:80607dfe5f7770d136d5c451308b9861084ffad08139de8014e48672ec43ea3f",
"zh:863bf0a6576f7a969a89631525250d947fbb207d3d13e7ca4f74d86bd97cdda3",
"zh:9a8f2e77e4f99dbb618eb8ad17218a4698833754b50d46da5727323a2050a400",
"zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425",
"zh:9b74ff6e638c2a470b3599d57c2081e0095976da0a54b6590884d571f930b53b",
"zh:da4fc553d50ae833d860ec95120e271c29b4cb636917ab5991327362b7486bb7",
"zh:f4b86e7df4e846a38774e8e648b41c5ebaddcefa913cfa1864568086b7735575",
]
}
provider "registry.terraform.io/hashicorp/random" {
version = "3.4.3"
constraints = ">= 2.2.0"
hashes = [
"h1:tL3katm68lX+4lAncjQA9AXL4GR/VM+RPwqYf4D2X8Q=",
"zh:41c53ba47085d8261590990f8633c8906696fa0a3c4b384ff6a7ecbf84339752",
"zh:59d98081c4475f2ad77d881c4412c5129c56214892f490adf11c7e7a5a47de9b",
"zh:686ad1ee40b812b9e016317e7f34c0d63ef837e084dea4a1f578f64a6314ad53",
"zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
"zh:84103eae7251384c0d995f5a257c72b0096605048f757b749b7b62107a5dccb3",
"zh:8ee974b110adb78c7cd18aae82b2729e5124d8f115d484215fd5199451053de5",
"zh:9dd4561e3c847e45de603f17fa0c01ae14cae8c4b7b4e6423c9ef3904b308dda",
"zh:bb07bb3c2c0296beba0beec629ebc6474c70732387477a65966483b5efabdbc6",
"zh:e891339e96c9e5a888727b45b2e1bb3fcbdfe0fd7c5b4396e4695459b38c8cb1",
"zh:ea4739860c24dfeaac6c100b2a2e357106a89d18751f7693f3c31ecf6a996f8d",
"zh:f0c76ac303fd0ab59146c39bc121c5d7d86f878e9a69294e29444d4c653786f8",
"zh:f143a9a5af42b38fed328a161279906759ff39ac428ebcfe55606e05e1518b93",
]
}
provider "registry.terraform.io/kreuzwerker/docker" {
version = "2.16.0"
constraints = "~> 2.16.0"
hashes = [
"h1:FyU8TUgpwfu+O+k+Uu5N58I/JWlEZk2PzQLJMluuaIQ=",
"zh:0ff8aa7884c6dae90e6f245bb9d37898735f89e095ba53413f2f364db4d11a77",
"zh:4101f4c909477f3a8225829b7063e5c5a2e2986a6163e0f113af040b5feab61f",
"zh:59db110d2b6c620cc12a1741d81ed8d1dd7fb0540024428fefbb57e8bebe5b60",
"zh:6e134983f195ea0273ac042f0a2df14158d676a24e8dd140ca0357f3efc3fd61",
"zh:7de1de3cc1eacb2ef2693207f5c5f54fa4814ae8c024b8b3c2a0923c82fd6f14",
"zh:a6659fbc7c45fbb60c7c9bf06724eb6084711f1b79c720ef8512a4367e63cbe5",
"zh:ae97c721431517d8c71f8cede91d734d2f2372a1bfef0c3bba43b54c0f8b1cee",
"zh:b3cbd47d5f0cb522b6dd3561ccd2f491fb6afb577372718e0663d12cfeef30e9",
"zh:b64af7c6ad8870c11677874f6cd13322aa03d2190391a120be17304ca324ea1c",
"zh:c363747bae968af997eaf22193168451523e92b59aee8aee135d3b27db132366",
"zh:c40721250642157b2a72d8db44fa09de0f7635ba4b0e2ebf5527570f3988e62f",
"zh:e97707609e346bf463d539099faa8790f2f453cfbd0b880327b6eae16ca4f213",
"zh:f4a23ce27cb430f91895466b3e2d132c534fa2b58808f6771235d76e696f4972",
"zh:fd634e973eb2b6483a1ce9251801a393d04cb496f8e83ffcf3f0c4cad8c18f4c",
]
}
provider "registry.terraform.io/paultyng/git" {
version = "0.1.0"
constraints = "~> 0.1.0"
hashes = [
"h1:iXff7KQxStHcm3NjhPSu0Ij3lEwJfABbZ+H9MyHGJ0A=",
"zh:0d593ac990f711171875ba5fc838f0087df84ddb1c69154ee630def5984931ea",
"zh:3895c2719f42e93fc993474859b34de87d90e2c47dfb757d435b9b57945195e4",
"zh:3a90ce559a3589628a2d6820a9d76a354763c268b0c173982ff773e022032856",
"zh:42339a6084095e37d0c843907dcabe66989949ea3f0025f6f1f9d8583d7da779",
"zh:435522beccaedf89bc39eed495393194b43156d1730ef45c29faa584552dc355",
"zh:87b4ee4f521283daaa0d63dd7949dc59f700b92e246e4aeb06510c01842a3c8b",
"zh:997aca77ddc1411dd601ea1fa2e455be9531c3e3c0f0917e8f2423ffd4ffb9ba",
"zh:a70e98ce6ef7a8256286ab791bc231777b76c8f038da4b9eccf399d2b22051fb",
"zh:af9301520e8befe3ec6d1125e10cc0724b318590f5680f12032c8bdc3b0c827d",
"zh:d995a3b8eaa5ac61744d49127fbf68b4c32e16d3c67d570edda2af26113b92a5",
"zh:e8b5c7354a02c54efc026d8289ce9d3784f58abd673a78e80bd4fb073dd75101",
]
}

View File

@ -12,7 +12,7 @@ resource "aws_ecs_service" "fleet" {
launch_type = "FARGATE"
cluster = aws_ecs_cluster.fleet.id
task_definition = aws_ecs_task_definition.backend.arn
desired_count = 10
desired_count = var.fleet_containers
deployment_minimum_healthy_percent = 100
deployment_maximum_percent = 200
health_check_grace_period_seconds = 30
@ -142,7 +142,7 @@ resource "aws_ecs_task_definition" "backend" {
},
{
name = "FLEET_MYSQL_MAX_OPEN_CONNS"
value = "5"
value = "10"
},
{
name = "FLEET_MYSQL_READ_REPLICA_USERNAME"
@ -158,7 +158,7 @@ resource "aws_ecs_task_definition" "backend" {
},
{
name = "FLEET_MYSQL_READ_REPLICA_MAX_OPEN_CONNS"
value = "5"
value = "10"
},
{
name = "FLEET_REDIS_ADDRESS"
@ -284,8 +284,8 @@ resource "aws_ecs_task_definition" "migration" {
}
resource "aws_appautoscaling_target" "ecs_target" {
max_capacity = 10
min_capacity = 10
max_capacity = var.fleet_containers
min_capacity = var.fleet_containers
resource_id = "service/${aws_ecs_cluster.fleet.name}/${aws_ecs_service.fleet.name}"
scalable_dimension = "ecs:service:DesiredCount"
service_namespace = "ecs"

View File

@ -4,6 +4,7 @@ set -e
VERSION="0.1.0"
PLUGIN_PATH="${HOME}/.terraform.d/plugins/registry.terraform.io/paultyng/git/${VERSION}/darwin_arm64"
TERRAFORMRC="${HOME}/.terraformrc"
pushd /tmp
git clone git@github.com:paultyng/terraform-provider-git.git
@ -16,3 +17,18 @@ mv terraform-provider-git ${PLUGIN_PATH}
cd ..
rm -rf /tmp/terraform-provider-git
popd
if [ -f "${TERRAFORMRC}" ]; then
echo "Moving ${TERRAFORMRC} to ${TERRAFORMRC}.old before replacing"
mv "${TERRAFORMRC}" "${TERRAFORMRC}.old"
fi
cat <<-EOF > "${HOME}/.terraformrc"
provider_installation {
filesystem_mirror {
path = "/Users/$(whoami)/.terraform.d/plugins"
}
direct {
exclude = ["registry.terraform.io/paultyng/*"]
}
}
EOF

View File

@ -20,6 +20,12 @@ variable "loadtest_containers" {
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