litellm/litellm-rust/loadtest/terraform/aws/db.tf
Nate Armstrong d93353bcb6
feat(gateway): load-test kit, Docker build knobs and TCP_NODELAY for the customer proxy (#46806)
Adds litellm-rust/loadtest: a mock LLM (OpenAI chat, Anthropic messages, Bedrock invoke with
event-stream framing) that takes its timing from the prompt, an open-loop load generator with
workloads covering 10k to 1M token contexts, 6 minute non-streaming calls and 30 minute streams,
a config and virtual key generator, a summarizer and a /proc sampler, plus Terraform for an AWS
rig with load generators, gateway and mocks on separate machines

The gateway sets TCP_NODELAY on accepted sockets, removing a ~40 ms stall per streamed response,
and its Docker build takes LTO and CODEGEN_UNITS build args for faster iteration builds
2026-10-16 12:42:59 -07:00

33 lines
1.1 KiB
HCL

resource "random_password" "db" {
count = var.create_postgres ? 1 : 0
length = 32
special = false
}
resource "aws_db_subnet_group" "keys" {
count = var.create_postgres ? 1 : 0
name = var.name
subnet_ids = [aws_subnet.main.id, aws_subnet.db_secondary.id]
}
resource "aws_db_instance" "keys" {
count = var.create_postgres ? 1 : 0
identifier = var.name
engine = "postgres"
engine_version = "16"
instance_class = var.postgres_instance_class
allocated_storage = 50
storage_type = "gp3"
db_name = "litellm"
username = "litellm"
password = random_password.db[0].result
db_subnet_group_name = aws_db_subnet_group.keys[0].name
vpc_security_group_ids = [aws_security_group.rig.id]
availability_zone = local.az
skip_final_snapshot = true
apply_immediately = true
}
locals {
database_url = var.create_postgres ? "postgresql://litellm:${random_password.db[0].result}@${aws_db_instance.keys[0].address}:5432/litellm" : ""
}