Deploying 128-Core AWS Infrastructure
This chapter details the transition from a local development environment (a single Mac Studio) to a high-performance, enterprise-grade cloud infrastructure on Amazon Web Services (AWS). To stress-test an application at a scale of 1 million requests per second, we decouple traffic generation, application hosting, and database operations into dedicated, ultra-high-throughput instances.
1. The Need for Decoupled Cloud Infrastructure
When testing high-throughput applications locally, running both the load generator (e.g., Autocannon) and the target application on the same machine creates a severe resource bottleneck. Both processes compete for the same CPU cycles, memory bandwidth, and local network loopback interface.
To achieve true performance benchmarks, we must transition to AWS and isolate these workloads across dedicated, high-performance virtual machines.
Real-Life Analogy
Think of this setup like a high-speed automotive crash test. If you try to build the test wall (the server) and drive the crash vehicle (the load generator) inside a tiny, enclosed backyard (a single local machine), both will get choked by dust and space constraints before reaching top speed.
To get accurate data, you must move to a massive, open proving ground (AWS), placing the crash wall at one end and letting the vehicle accelerate from miles away over a dedicated, high-speed track (the AWS internal network).
2. Architectural Overview
The benchmarking architecture consists of three core components deployed within the same AWS Region (US East - Ohio) to minimize network latency:
[ Power Tester ] (C8i.32xlarge)
|
| Generates HTTP Traffic (Autocannon)
v
[ Power Server ] (C8i.32xlarge running Node.js/PM2)
|
| Reads/Writes Data
v
[ Aurora/RDS Database ] (db.m5.16xlarge Postgres)
3. Provisioning the Compute Layer (EC2)
To handle massive traffic volumes, we deploy two identical, top-tier compute instances using Amazon Elastic Compute Cloud (EC2).
Choosing the Instance Type: c8i.32xlarge
The c8i.32xlarge instance is a compute-optimized powerhouse featuring Intel Xeon Scalable processors.
Step-by-Step EC2 Deployment Workflow
-
Select a Pre-configured Amazon Machine Image (AMI): Rather than configuring the operating system, runtime environments, and dependencies from scratch, we boot the instances using custom AMIs.
- Server AMI: Pre-loaded with Node.js, PM2 (Process Manager 2), and optimized system bash scripts.
- Tester AMI: Pre-loaded with Autocannon for high-performance load generation.
-
Configure Networking & Security Groups:
- Rule Strategy: For rapid testing, we apply an
allow-allsecurity group configuration that opens all ports. -
Warning: Opening all ports is a critical security risk and must never be done in production environments. It is used here strictly within a temporary, short-lived sandbox environment.
- Rule Strategy: For rapid testing, we apply an
-
Optimize Storage Throughput (EBS):
- Volume Type: GP3 (General Purpose SSD).
- Size: 500 GB.
- IOPS (Input/Output Operations Per Second): Provisioned up to 30,000 IOPS with enhanced throughput to prevent disk I/O bottlenecks during logging and state writes.
4. Provisioning the Database Layer (RDS/Aurora)
Database operations (reads and writes) are often the primary bottleneck under heavy application load. To prevent the database from collapsing during testing, we deploy a high-tier managed PostgreSQL instance.
Database Instance Specifications: db.m5.16xlarge
- Compute Power: 64 CPU Cores.
- Memory: 256 GB RAM.
- Storage Engine: Amazon Aurora / RDS PostgreSQL.
- Deployment Strategy: Single Availability Zone (Single-AZ) to eliminate synchronous multi-AZ replication latency during raw performance benchmarking.
- Storage Configuration: GP3 storage with 3,000 IOPS.
- Cost: ~5,000 / Month).
5. Cost Management & Financial Warnings in AWS
Scaling up enterprise-grade infrastructure on AWS is highly expensive. The combined cost of this benchmarking environment is approximately 20,000 per month if left running continuously.
Production Best Practices for Cost Control
- Immediate Teardown: Terminate or stop all EC2 and RDS instances immediately after completing a test run.
- Automation Scripts: Use AWS CLI, Terraform, or CloudFormation to spin up and tear down the infrastructure programmatically, preventing human error (e.g., forgetting to stop an instance over the weekend).
- Billing Alarms: Configure AWS Budgets and CloudWatch billing alarms to send immediate email or SMS alerts if spending exceeds a set threshold (e.g., $50).
6. Accessing and Verifying the Infrastructure
Once the instances transition to the running state in the AWS Console, we establish secure SSH connections to monitor and orchestrate the test.
SSH Connection Workflow
Using a custom terminal setup with four split tabs, we connect to both machines simultaneously to monitor system resources in real time.
# Terminal Tab 1 & 2: Connect to the Power Server
ss power-server-public-dns.amazonaws.com
# Terminal Tab 3 & 4: Connect to the Power Tester
ss power-tester-public-dns.amazonaws.com
Note:
ssis a custom local bash helper function configured to execute the standard SSH command with pre-loaded identity keys:ssh -i "your-key.pem" ubuntu@your-aws-instance-dns
Verifying the Environment
Once logged in, verify that the cloned codebase, Node.js runtime, and process managers are active:
# On the Power Server: Check PM2 status
pm2 status
# On the Power Tester: Verify Autocannon installation
autocannon --version
Summary and Key Takeaways
- Decoupled Architecture is Mandatory: Never run load generators and target servers on the same machine for high-throughput testing; resource contention will skew the results.
- Compute Power: The
c8i.32xlargeinstance provides 128 CPU cores, 256 GB RAM, and a 50 Gbps network pipe, making it roughly 10 times more powerful than a standard local workstation. - Database Scaling: A massive
db.m5.16xlargedatabase instance with 64 cores and 256 GB RAM is used to handle high-volume database reads and writes. - Network Proximity: Deploying all resources within a single region (e.g., US East - Ohio) and a single Availability Zone minimizes network round-trip time (RTT).
- Extreme Cost Awareness: High-performance AWS resources are billed by the second. A 20,000 monthly bill if not terminated immediately after testing.
- AMIs Save Time: Using pre-configured Amazon Machine Images (AMIs) avoids manual installation steps, allowing you to launch fully configured environments in minutes.