Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Serverless Artillery 40 requests without cache /users/{userId}/tasks/{task_id} (NO PR) #341

Open
RayWu222 opened this issue Mar 22, 2021 · 3 comments
Assignees
Labels
task New task, feature or request team2 Issues for Practicum Team 2
Milestone

Comments

@RayWu222
Copy link
Contributor

No description provided.

@RayWu222 RayWu222 self-assigned this Mar 22, 2021
@RayWu222 RayWu222 added task New task, feature or request team2 Issues for Practicum Team 2 labels Mar 22, 2021
@RayWu222 RayWu222 added this to the Sprint 06 milestone Mar 22, 2021
@RayWu222
Copy link
Contributor Author

RayWu222 commented Mar 23, 2021

Date Activity Time
03/20/2021 Research on Serverless Artillery and Serverless 5 hours
03/21/2021 Work on Serverkess Artillery without cache for /users/{userid}/tasks/{task_id} 5 hours
03/22/2021 Running test, troubleshooting, and documenting result 5 hours

@RayWu222
Copy link
Contributor Author

RayWu222 commented Mar 23, 2021

Steps to turn off cache:

  1. Go to Azure Portal
  2. Go to the resource group
  3. Go to Function
  4. Go to Configuration under Settings
  5. Click on CACHE_TOGGLE and set it to false, and press ok. Then press save

Running Serverless Artillery

Prerequisites

1. Node JS

You can install Node JS from https://nodejs.org/en/download/ or with your operating system’s package manager.

2. Serverless Framework CLI

To install globally use the following command.
npm install -g serverless@1.38.0

you need to install serverless@1.38.0 to be compatible with serverless-artillery

3. Installing serverless-artillery

npm install -g serverless-artillery

To check that the installation succeeded, run:
slsart --version

1. Setup AWS credentials

Create an AWS user, grab your credentials from a script, tool, and add them to the environment.

  • In Linux
$ export AWS_ACCESS_KEY_ID=<access-key-id>
$ export AWS_SECRET_ACCESS_KEY=<secret-access-key>
$ export AWS_SESSION_TOKEN=<session-token>
  • In windows
$ set AWS_ACCESS_KEY_ID=<access-key-id>
$ set AWS_SECRET_ACCESS_KEY=<secret-access-key>
$ set AWS_SESSION_TOKEN=<session-token>

2. Create custom deployment assets

Create a local copy of the deployment assets for your customization and then deployment to AWS, using the following command.
slsart configure

add region information to the serverless.yml file, for example region=us-west-2

3. Deploy

Go to the folder in your local directory containing script.yml file
In the command line, run slsart deploy --stage <your-unique-stage-name>
You can go to your AWS account console > CloudFormation, and see AWS stack - created there depending on the customizations explained in the steps above.

4. Invoke

run slsart invoke --stage <your-unique-stage-name>
If you go to AWS Lambda console > find the loadGenerator Lambda corresponding to your stack > Monitoring tab > Invocations graph, you will see that the Lambda function was invoked to generate the load. You can also see the logs produced by the Lambda in CloudWatch Logs.

5. Remove

The following command will remove the AWS CloudFormation Stack deployed in step 3.
slsart remove --stage <your-unique-stage-name>

@RayWu222
Copy link
Contributor Author

Screen Shot 2021-03-23 at 10 15 30 AM

Screen Shot 2021-03-23 at 10 15 44 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task New task, feature or request team2 Issues for Practicum Team 2
Projects
None yet
Development

No branches or pull requests

1 participant