-
Notifications
You must be signed in to change notification settings - Fork 3
/
workshop-plan.txt
83 lines (53 loc) · 3.1 KB
/
workshop-plan.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
0) General Warm up Script for API Gateway before workshop and between the steps
hey -q 1 -z 60m -c 1 -H "X-API-Key: a6ZbcDefQW12BN56WEN7" https://ax4q0xu5ka.execute-api.eu-central-1.amazonaws.com/prod/products/20
hey -q 1 -z 60m -c 1 -H "X-API-Key: a6ZbcDefQW12BN56WEN7" https://ax4q0xu5ka.execute-api.eu-central-1.amazonaws.com/prod/products
hey -q 2 -z 60m -c 2 -H "X-API-Key: a6ZbcDefQW12BN56WEN7" https://ax4q0xu5ka.execute-api.eu-central-1.amazonaws.com/prod/products/20
hey -q 2 -z 60m -c 2 -H "X-API-Key: a6ZbcDefQW12BN56WEN7" https://ax4q0xu5ka.execute-api.eu-central-1.amazonaws.com/prod/products
1) DynamoDb Throttling (getProducts or getProductsById)
hey -q 20 -z 15m -c 20 -H "X-API-Key: a6ZbcDefQW12BN56WEN7" https://ax4q0xu5ka.execute-api.eu-central-1.amazonaws.com/prod/products/1
2) Lambda Timeout and SQS Visibility Timeout createProduct
- apply Lambda smaller Timeout then Thread sleep n the CreateProduct Thread.sleep and then PutProduct via API Gateway Console
Path Id =10
Json Body
[
{
"id": 10,
"name": "Calender A5",
"price": 35.99
}
]
3) ApiGateway 401 (getProducts by Id 200)
-Increase DynamoDb read throughput
hey -q 1 -z 10m -c 5 -H "X-API-Key: a6ZbcDefQW12BN56WEN7" https://ax4q0xu5ka.execute-api.eu-central-1.amazonaws.com/prod/products/200
4) Lambda Throttling (getProducts or getProductsById)
-Increase DynamoDb read throughput to 10
- Decrease Lambda Reserve Concurrency to 1 or 2
hey -q 5 -z 10m -c 5 -H "X-API-Key: a6ZbcDefQW12BN56WEN7" https://ax4q0xu5ka.execute-api.eu-central-1.amazonaws.com/prod/products/200
5) Lambda Error with DeleteProduct
- apply 128 MB memory to DeleteProduct Lambda
hey -q 2 -z 20m -c 2 -m DELETE -H "X-API-Key: a6ZbcDefQW12BN56WEN7" -H "Content-Type: application/json;charset=utf-8" https://ax4q0xu5ka.execute-api.eu-central-1.amazonaws.com/prod/products/11
6) ApiGateway Throttling 429, (getProducts or getProductsById)
apply Small Quotas per Day (100 or so) to ApiGateway
hey -q 2 -z 15m -c 2 -H "X-API-Key: a6ZbcDefQW12BN56WEN7" https://ax4q0xu5ka.execute-api.eu-central-1.amazonaws.com/prod/products/1
Bonus
7) Lambda Latency (add Thread.sleep) (getProducts or getProductsById)
- add Thread.sleep (10 and 20 secs) to getProducts or getProductsById functions and redeploy application via SAML
- increase Api Gateway Quotas
hey -q 2 -z 60m -c 2 -H "X-API-Key: a6ZbcDefQW12BN56WEN7" https://ax4q0xu5ka.execute-api.eu-central-1.amazonaws.com/prod/products/1
8) Lambda function has concurrency spillover for DeleteProduct
hey -q 1 -z 30m -c 9 -m DELETE -H "X-API-Key: a6ZbcDefQW12BN56WEN7" -H "Content-Type: application/json;charset=utf-8" https://ax4q0xu5ka.execute-api.eu-central-1.amazonaws.com/prod/products/11
9) Step Functions
Json for error reproducing
{
"products_id": "5"
}
or
{
"product_id": "1FR"
}
correct one is
{
"productsId": "5"
}
10) DynamoDb Streams update product with Lambda error
hey -q 5 -z 10m -c 5 -m PUT -d '{"id": 1, "name": "Print 10x13", "price": 0.15}' -H "X-API-Key: a6ZbcDefQW12BN56WEN7" -H "Content-Type: application/json;charset=utf-8" https://ax4q0xu5ka.execute-api.eu-central-1.amazonaws.com/prod/products/