Strobesstrobes
Platform
Solutions
Resources
Customers
Company
Pricing
Book a Demo
Strobesstrobes

Strobes connects every exposure signal to autonomous action, so security teams fix what matters, prove what works, and stop chasing noise.

Book a DemoTalk to an expert
ISO 27001SOC 2CREST
  • Platform
  • Platform Overview
  • Agentic Exposure Management
  • AI Agents
  • Integrations
  • API & Developers
  • Workflows & Automation
  • Analytics & Reporting
  • Solutions
  • Exposure Assessment (EAP)
  • Attack Surface Management
  • Application Security Posture
  • Risk-Based Vulnerability Management
  • Adversarial Exposure Validation (AEV)
  • AI Pentesting
  • Pentesting as a Service
  • CTEM Framework
  • By Industry
  • Financial Institutions
  • Technology
  • Retail
  • Healthcare
  • Manufacturing
  • By Roles
  • CISOs
  • Security Directors
  • Cloud Security Leaders
  • App Sec Leaders
  • Resources
  • Blog
  • Customer Stories
  • eBooks
  • Datasheets
  • Videos & Demos
  • Exposure Management Academy
  • CTEM Maturity Assessment
  • Pentest Health Check
  • Security Tool ROI Calculator
  • Company
  • About Strobes
  • Meet the Team
  • Trust & Security
  • Contact Us
  • Careers
  • Become a Partner
  • Technology Partner
  • Partner Deal Registration
  • Press Release

Weekly insight for security leaders

CTEM research, agentic AI trends, and what's actually moving the needle.

© 2026 Strobes Security Inc. All rights reserved.

Privacy PolicyTerms of ServiceCookie PolicyAccessibilitySitemap
Back to Blog
Cut RDS Costs by 50% with Aurora Serverless V2 Idle Connection Fix
engineering

Cut RDS Costs by 50% with Aurora Serverless V2 Idle Connection Fix

SwakhilOctober 25, 20244 min read

Table of Contents

  • Problem Overview
  • Initial Troubleshooting
  • Root Cause Analysis
  • Resolution
    • Example 1:
    • Example 2:

Authors

S
Swakhil

Share

Table of Contents

  • Problem Overview
  • Initial Troubleshooting
  • Root Cause Analysis
  • Resolution
    • Example 1:
    • Example 2:

Authors

S
Swakhil

Share

In a recent migration from a standard RDS DB instance to Aurora RDS PostgreSQL Serverless V2, we encountered an unexpected issue a significant and unexplained increase in Aurora Serverless V2 connections.

This anomaly led to spikes in resource utilization, specifically memory, and caused a noticeable rise in operational costs. After a thorough investigation, we identified RDS Proxy as the root cause.

This blog details our troubleshooting process, the steps we took to investigate the issue, and how we ultimately resolved it.

Problem Overview

Shortly after migrating to Aurora RDS PostgreSQL Serverless V2, we observed memory utilization spikes that were not aligned with our application’s transaction load, query execution, or routine maintenance operations like autovacuum. Despite database optimizations, the issue persisted, and our RDS costs continued to escalate, prompting us to investigate a potential link to excessive Aurora Serverless V2 connections.

Initial Troubleshooting

  • RDS Proxy Logs: We reviewed the logs generated by RDS Proxy to understand the connection patterns.
  • Database Maximum Connections: We examined the maximum connection settings on the database to ensure they were within expected limits.
  • RDS Proxy Connection Pool Settings: We looked into how RDS Proxy was managing its connection pool, particularly the maximum connections allowed and how idle connections were being handled.

Our database thought it was at a never-ending party, with connections multiplying like confetti. Time to turn down the music and clean up this digital disco.

Root Cause Analysis

The investigation revealed that RDS Proxy was at the heart of the issue. We found that RDS Proxy was maintaining a large number of idle connections, which were being reused inefficiently. These connections were only timing out after the default 24-hour period, which led to excessive resource consumption.

Aurora Serverless V2 Connections

Resolution

We identified that the issue stemmed from the

MaxIdleConnectionsPercent

parameter in AWS RDS Proxy. This parameter wasn’t readily accessible through the console, so we used the AWS CLI to make the necessary adjustments.

Here’s how we tweaked the parameters according to our workloads

First, we listed out the rds proxy configuration using the below aws cli command:

aws rds describe-db-proxy-target-groups --db-proxy-name dsr-forward --region ap-southeast-1

Output:

{ 
"TargetGroups": [ { "DBProxyName": "dsr-forward", "TargetGroupName": "default", "TargetGroupArn": "arn:aws:rds:ap-southeast-1:863547483732:target-group:prx-tg-0a926g7b3ddyg8j0f", "IsDefault": true, "Status": "available", "ConnectionPoolConfig": { "MaxConnectionsPercent": 100, "MaxIdleConnectionsPercent": 50, "ConnectionBorrowTimeout": 120, "SessionPinningFilters": [] }, "CreatedDate": "2021-10-25T12:07:51.836000+00:00", "UpdatedDate": "2023-06-24T09:02:25.222000+00:00" 
} ] }

AWS CLI Reference – Here

Here’s what each parameter generally means:

MaxConnectionsPercent: The maximum size of the connection pool for each target in a target group. The value is expressed as a percentage of the

max_connections

With a high value, the proxy leaves a high percentage of idle database connections open. A low value causes the proxy to close more idle connections and return them to the database.If you specify this parameter, then you must also include a value for

MaxConnectionsPercent

The default value is half of the value of

MaxConnectionsPercent

Example 1:

You have a database that can handle up to 500 connections at a time. To find out how many of those connections can be idle (not in use) at any given time, you use a percentage.

Here’s how you calculate it:

Formula:

MaxIdleConnections = (MaxIdleConnectionsPercent / 100) × MaxConnections

Input:

MaxIdleConnectionsPercent: 50%

So, if your database allows 500 connections in total, and you set the

MaxIdleConnectionsPercent

to 50%, then the number of idle connections allowed would be:

Max Idle Connections = (50 / 100) × 500 = 250

This means out of 500 connections, 250 can be idle.

Example 2:

You have a database that allows 2000 connections at a time and

MaxIdleConnectionsPercent

is 10%.

Now, using the formula:

Max Idle Connections = (10 / 100) × 2000 = 200

This means out of 2000 connections, 200 can be idle.

Adjusting our workloads

We fine-tuned the

MaxConnectionsPercent

and

MaxIdleConnectionsPercent

parameters in AWS RDS Proxy to better suit our needs.

Here’s how we updated them:

Input:

aws rds modify-db-proxy-target-group \
--target-group-name default \
--db-proxy-name dsr-forward \
--region ap-southeast-1 \
--connection-pool-config MaxConnectionsPercent=50,MaxIdleConnectionsPercent=10

Output:

{ 
  "DBProxyTargetGroup": { 
    "DBProxyName": "dsr-forward",
    "TargetGroupName": "default",
    "TargetGroupArn": "arn:aws:rds:ap-southeast-1:863547483732:target-group:prx-tg-0a926g7b3ddyg8j0f",
    "IsDefault": true, 
    "Status": "available",
    "ConnectionPoolConfig": { 
      "MaxConnectionsPercent": 50,
      "MaxIdleConnectionsPercent": 10,
      "ConnectionBorrowTimeout": 120,
      "SessionPinningFilters": []
   },
   "CreatedDate": "2021-10-25T12:07:51.836000+00:00",
   "UpdatedDate": "2023-09-14T10:37:09.421000+00:00"
  }
}

By setting this parameter to a minimal value, we restored balance to our database environment, and everything began running smoothly once again. Additionally, we saw RDS Serverless costs decrease by 50% due to significantly lower ACU consumption, as there were fewer active connections.

Aurora Serverless V2

And so, our database party came to an end, leaving us with a valuable lesson: keep an eye on those resources, or you might find yourself footing the bill for a tech-tacular blowout.

Our journey dealing with high connections in Aurora Serverless V2 was both challenging and rewarding. We learned the crucial importance of meticulous monitoring and analysis, and the value of keeping up with the latest features and parameters. By sharing our experience, we aim to help other engineers avoid similar pitfalls and optimize their Aurora Serverless deployments.

Want to see how you can optimize your cloud infrastructure like we did? Book a demo with our team today.

Tags
Aurora Serverless V2

Stop chasing vulnerabilities Start reducing exposure

See how Strobes AI agents validate and fix your most critical exposures automatically.

Book a Demo
Continue Reading

Related Posts

How to Write an Effective AI Agent Skill Four-Layer Architecture
engineeringOffensive Security

How to Write an Effective AI Agent Skill: The Four-Layer Architecture

Most teams building AI agents get the ratio wrong: 90% code, 10% methodology. Here is the four-layer architecture Strobes uses to build skills that run complete security assessments autonomously.

Mar 31, 20267 min
AI Harness for Offensive Security - Strobes blog cover showing multi-agent architecture concept
Offensive SecurityPenetration Testing

Building an AI Harness for Offensive Security: What It Takes to Turn LLMs Into Reliable Pentest and Validation Operators

The model is 20% of the problem. Here is the engineering story behind the orchestration, tooling, middleware, and infrastructure that turns a capable LLM into a reliable penetration testing operator.

Mar 22, 202614 min