{"id":16584939,"url":"https://github.com/mikaelvesavuori/aws-performance-testing-starter","last_synced_at":"2025-06-25T19:33:27.760Z","repository":{"id":237419569,"uuid":"726863927","full_name":"mikaelvesavuori/aws-performance-testing-starter","owner":"mikaelvesavuori","description":"This is a basic starting point for conducting performance testing on AWS.","archived":false,"fork":false,"pushed_at":"2023-12-03T16:18:19.000Z","size":6,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T05:51:09.536Z","etag":null,"topics":["aws","aws-testing","k6","load-testing","performance-testing","testing"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikaelvesavuori.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-03T16:17:41.000Z","updated_at":"2025-01-14T07:59:18.000Z","dependencies_parsed_at":"2024-05-01T16:12:57.611Z","dependency_job_id":"eaf39e39-97a9-4f22-a2ea-eef9fab44b7b","html_url":"https://github.com/mikaelvesavuori/aws-performance-testing-starter","commit_stats":null,"previous_names":["mikaelvesavuori/aws-performance-testing-starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mikaelvesavuori/aws-performance-testing-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Faws-performance-testing-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Faws-performance-testing-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Faws-performance-testing-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Faws-performance-testing-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikaelvesavuori","download_url":"https://codeload.github.com/mikaelvesavuori/aws-performance-testing-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Faws-performance-testing-starter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261941041,"owners_count":23233671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-testing","k6","load-testing","performance-testing","testing"],"created_at":"2024-10-11T22:46:16.410Z","updated_at":"2025-06-25T19:33:27.702Z","avatar_url":"https://github.com/mikaelvesavuori.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS performance testing starter: EC2, Fargate, Lambda\n\nThis is a basic starting point for conducting performance testing on AWS, for the compute services EC2, Fargate, and Lambda. The provided application is a small \"Hello world\" application written in Node (running on Fastify).\n\nTests are conducted using [k6](https://k6.io). They come configured for 500 virtual users, hitting an endpoint for 30 seconds. The test also checks to ensure that \u003e99% of all hits are successes and that the p95 duration is under 200ms.\n\nFor the Lambda solution, there is full deployment automation in place using [Serverless Framework](https://www.serverless.com). For EC2 and Fargate, there are steps and scripts provided for provisioning the infrastructure and building and pushing the container image that will be used.\n\n## Prerequisites\n\n- Recent [Node.js](https://nodejs.org/en/) (ideally 18+) installed.\n- Amazon Web Services (AWS) account with sufficient permissions so that you can deploy the necessary infrastructure.\n- For the Lambda part, ideally some experience with [Serverless Framework](https://www.serverless.com) as that's what we will use to deploy the service and infrastructure.\n\n## Installation\n\nClone, fork, or download the repo as you normally would. Run `npm install`.\n\n## Configuration\n\nMake sure to check these files out and change them if their use applies to your use case.\n\n- `scripts/push.sh`\n- `scripts/ssh.sh`\n- `serverless.yml`\n\nOnce you have deployed some testing application(s), update the endpoints in `scripts/test.js`.\n\n## Commands\n\n- `npm run setup`: Install [k6](https://k6.io) and [Podman](https://podman.io) (assumes Mac)\n- `npm test`: Run the k6 load test\n- `npm start`: Run the Lambda application locally\n- `npm start:server`: Run the containerized application locally\n- `npm run build`: Package Lambda stack with Serverless Framework\n- `npm run build:image`: Use Podman to build the image\n- `npm run push`: Use Podman to build and push image to AWS ECR\n- `npm run deploy`: Deploy Lambda stack to AWS with Serverless Framework\n- `npm run teardown`: Remove Lambda stack from AWS\n\n## Setup\n\n### EC2\n\nThere is no automation provided beyond the scripts. Instead, follow the web console wizard and the below general steps.\n\n_Note that the described setup is not strictly equal to, for example, the Lambda setup unless you add (for example) HTTPS._\n\nBasic instructions:\n\n- Use Arm architecture\n- Use the Amazon Linux AMI\n- Use the `t4g.micro` (or other configuration)\n- Use open inbound HTTPS traffic for the test traffic\n- Allow SSH traffic from your IP so you can connect to the instance\n- Add port 8080 (or whatever you are using) to the open/allowed ports in the security group\n- Download the key pair so you can connect to the instance\n- Connect to the instance; get the connection information in the EC2 instance view and update `scripts/ssh.sh` - run that script\n- Inside the instance, copy paste the contents of `scripts/ec2-setup.sh`, it should end with the server being in a running state\n- Find the public DNS address for the instance in the EC2 console\n- You can now curl it, similar to `curl ec2-{RANDOM}.{REGION}.compute.amazonaws.com:8080`\n\n### Fargate\n\nThere is no automation provided beyond the scripts. Instead, follow the web console wizard and the below general steps.\n\nYou may want to [follow this guide if you want a guided tour](https://www.youtube.com/watch?v=WsvuIxaCQGg) of the overall steps.\n\n_Note that the described setup is not strictly equal to, for example, the Lambda setup unless you add (for example) HTTPS._\n\nBasic instructions:\n\n- Create a task definition\n  - Use Arm architecture\n  - Set the configuration as desired\n  - Point it to your ECR image\n  - No need to fiddle with roles or other things if you don't want to\n- Create a cluster\n  - Point to the task definition\n- Create a service in the cluster\n  - Most of this should be simple\n  - Add load balancers if desired\n  - Add service scaling if desired\n- Start the task\n  - Once it has started, click the task to get the public IP\n\n## Lambda\n\nSimply run `npm run deploy` (after having installed dependencies and being logged in through the CLI environment).\n\nYou'll get an endpoint you can use.\n\nThere are some configuration options in the `serverless.yml` if you want to set it up in other ways than the provided one.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikaelvesavuori%2Faws-performance-testing-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikaelvesavuori%2Faws-performance-testing-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikaelvesavuori%2Faws-performance-testing-starter/lists"}