Skip to content

Commit

Permalink
Loadtesting updates (#587)
Browse files Browse the repository at this point in the history
* Updated api gateway to allow limited access without api key
  • Loading branch information
vivid-cpreston authored Jan 27, 2023
1 parent 74bdd79 commit 523ef31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
CLIENT_MEMORY: 4096
SERVER_CPU_UNITS: 2048
SERVER_MEMORY: 4096
DB_INSTANCE_TYPE: 'db.t3.micro'
DB_INSTANCE_TYPE: 'db.t3.medium'
INSTANCE_COUNT: 2

LOGGING_LEVEL: INFO
Expand Down
10 changes: 9 additions & 1 deletion docker/default.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
limit_req_zone $binary_remote_addr zone=wfnewslimit:10m rate=10000r/s;

limit_req_zone $binary_remote_addr zone=wfnewsnotoken:10m rate=50r/s;

server {
listen 8080;
Expand All @@ -15,9 +15,17 @@ server {
return 204;
}

location @slowdown {
limit_req zone=wfnewsnotoken burst=50 nodelay;

proxy_pass https://wfnews-server.{LICENSE_PLATE}-{TARGET_ENV}.nimbus.cloud.gov.bc.ca;
}

location / {
limit_req zone=wfnewslimit burst=10000 nodelay;
auth_request /_validate_apikey;

error_page 403 = @slowdown;

proxy_pass https://wfnews-server.{LICENSE_PLATE}-{TARGET_ENV}.nimbus.cloud.gov.bc.ca;
}
Expand Down

0 comments on commit 523ef31

Please sign in to comment.