-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- AWS: Read 1B for every 4096B, 8192B, 16384B, 32768B, for exactly 1024 bytes - Azure: Read 1B for every 4096B, 8192B for exactly 1024 bytes - GCR: Read 1B for every 40kB, 48kB, 56kB for exactly 1024 bytes
- Loading branch information
Showing
13 changed files
with
594 additions
and
111 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"Provider": "aws", | ||
"Runtime": "python3.9", | ||
"SubExperiments": [ | ||
{ | ||
"Title": "aws-chunk-16-kbytes", | ||
"Function": "hellopy-read-per-16384-bytes", | ||
"Handler": "main.lambda_handler", | ||
"PackageType": "Zip", | ||
"PackagePattern": "main.py", | ||
"Bursts": 500, | ||
"BurstSizes": [ | ||
1 | ||
], | ||
"IATSeconds": 600, | ||
"DesiredServiceTimes": [ | ||
"0ms" | ||
], | ||
"Parallelism": 50, | ||
"FunctionImageSizeMB": 100 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"Provider": "aws", | ||
"Runtime": "python3.9", | ||
"SubExperiments": [ | ||
{ | ||
"Title": "aws-chunk-16-kbytes", | ||
"Function": "hellopy-read-per-16384-bytes", | ||
"Handler": "main.lambda_handler", | ||
"PackageType": "Zip", | ||
"PackagePattern": "main.py", | ||
"Bursts": 500, | ||
"BurstSizes": [ | ||
1 | ||
], | ||
"IATSeconds": 600, | ||
"DesiredServiceTimes": [ | ||
"0ms" | ||
], | ||
"Parallelism": 50, | ||
"FunctionImageSizeMB": 100 | ||
} | ||
] | ||
} |
46 changes: 46 additions & 0 deletions
46
src/setup/deployment/raw-code/serverless/aws/hellopy-read-per-4096-bytes/main.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import json | ||
import os | ||
import time | ||
import random | ||
|
||
|
||
def lambda_handler(request, context): | ||
incr_limit = 0 | ||
|
||
if 'queryStringParameters' in request and 'IncrementLimit' in request['queryStringParameters']: | ||
incr_limit = int(request['queryStringParameters'].get('IncrementLimit', 0)) | ||
elif 'body' in request and json.loads(request['body'])['IncrementLimit']: | ||
incr_limit = int(json.loads(request['body'])['IncrementLimit']) | ||
|
||
simulate_work(incr_limit) | ||
read_filler_file('./filler.file') | ||
|
||
json_region = os.environ.get('AWS_REGION', 'Unknown') | ||
|
||
response = { | ||
"statusCode": 200, | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"body": json.dumps({ | ||
"Region ": json_region, | ||
"RequestID": context.aws_request_id, | ||
"TimestampChain": [str(time.time_ns())] | ||
}, indent=4) | ||
} | ||
|
||
return response | ||
|
||
|
||
def simulate_work(increment): | ||
# MAXNUM = 6103705 | ||
num = 0 | ||
while num < increment: | ||
num += 1 | ||
|
||
|
||
def read_filler_file(path: str) -> None: | ||
with open(path, 'rb') as f: | ||
for i in range(1024): | ||
f.seek(i * 4096) | ||
f.read(1) |
46 changes: 46 additions & 0 deletions
46
src/setup/deployment/raw-code/serverless/aws/hellopy-read-per-8192-bytes/main.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import json | ||
import os | ||
import time | ||
import random | ||
|
||
|
||
def lambda_handler(request, context): | ||
incr_limit = 0 | ||
|
||
if 'queryStringParameters' in request and 'IncrementLimit' in request['queryStringParameters']: | ||
incr_limit = int(request['queryStringParameters'].get('IncrementLimit', 0)) | ||
elif 'body' in request and json.loads(request['body'])['IncrementLimit']: | ||
incr_limit = int(json.loads(request['body'])['IncrementLimit']) | ||
|
||
simulate_work(incr_limit) | ||
read_filler_file('./filler.file') | ||
|
||
json_region = os.environ.get('AWS_REGION', 'Unknown') | ||
|
||
response = { | ||
"statusCode": 200, | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"body": json.dumps({ | ||
"Region ": json_region, | ||
"RequestID": context.aws_request_id, | ||
"TimestampChain": [str(time.time_ns())] | ||
}, indent=4) | ||
} | ||
|
||
return response | ||
|
||
|
||
def simulate_work(increment): | ||
# MAXNUM = 6103705 | ||
num = 0 | ||
while num < increment: | ||
num += 1 | ||
|
||
|
||
def read_filler_file(path: str) -> None: | ||
with open(path, 'rb') as f: | ||
for i in range(1024): | ||
f.seek(i * 8192) | ||
f.read(1) |
48 changes: 48 additions & 0 deletions
48
src/setup/deployment/raw-code/serverless/azure/hellopy-read-per-4096-bytes/main.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import json | ||
import os | ||
import time | ||
import random | ||
|
||
import azure.functions as func | ||
|
||
|
||
def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse: | ||
incr_limit = int(req.params.get('IncrementLimit')) if req.params.get('IncrementLimit') else None | ||
if not incr_limit: | ||
try: | ||
req_body = req.get_json() | ||
except ValueError: | ||
incr_limit = 0 | ||
pass | ||
else: | ||
incr_limit = int(req_body.get('IncrementLimit')) if req_body.get('IncrementLimit') else 0 | ||
else: | ||
incr_limit = 0 | ||
|
||
simulate_work(incr_limit) | ||
read_filler_file(f"{context.function_directory}/../filler.file") | ||
|
||
return func.HttpResponse( | ||
body=json.dumps({ | ||
"RequestID": context.invocation_id, | ||
"TimestampChain": [str(time.time_ns())] | ||
}, indent=4), | ||
status_code=200, | ||
headers={ | ||
"Content-Type": "application/json" | ||
} | ||
) | ||
|
||
|
||
def simulate_work(increment): | ||
# MAXNUM = 6103705 | ||
num = 0 | ||
while num < increment: | ||
num += 1 | ||
|
||
|
||
def read_filler_file(path: str) -> None: | ||
with open(path, 'rb') as f: | ||
for i in range(1024): | ||
f.seek(i * 4096) | ||
f.read(1) |
48 changes: 48 additions & 0 deletions
48
src/setup/deployment/raw-code/serverless/azure/hellopy-read-per-8192-bytes/main.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import json | ||
import os | ||
import time | ||
import random | ||
|
||
import azure.functions as func | ||
|
||
|
||
def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse: | ||
incr_limit = int(req.params.get('IncrementLimit')) if req.params.get('IncrementLimit') else None | ||
if not incr_limit: | ||
try: | ||
req_body = req.get_json() | ||
except ValueError: | ||
incr_limit = 0 | ||
pass | ||
else: | ||
incr_limit = int(req_body.get('IncrementLimit')) if req_body.get('IncrementLimit') else 0 | ||
else: | ||
incr_limit = 0 | ||
|
||
simulate_work(incr_limit) | ||
read_filler_file(f"{context.function_directory}/../filler.file") | ||
|
||
return func.HttpResponse( | ||
body=json.dumps({ | ||
"RequestID": context.invocation_id, | ||
"TimestampChain": [str(time.time_ns())] | ||
}, indent=4), | ||
status_code=200, | ||
headers={ | ||
"Content-Type": "application/json" | ||
} | ||
) | ||
|
||
|
||
def simulate_work(increment): | ||
# MAXNUM = 6103705 | ||
num = 0 | ||
while num < increment: | ||
num += 1 | ||
|
||
|
||
def read_filler_file(path: str) -> None: | ||
with open(path, 'rb') as f: | ||
for i in range(1024): | ||
f.seek(i * 8192) | ||
f.read(1) |
8 changes: 8 additions & 0 deletions
8
src/setup/deployment/raw-code/serverless/gcr/hellopy-read-per-40960-bytes/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM python:3.7-alpine | ||
|
||
RUN pip install Flask gunicorn | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 app:app |
46 changes: 46 additions & 0 deletions
46
src/setup/deployment/raw-code/serverless/gcr/hellopy-read-per-40960-bytes/app.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import json | ||
import os | ||
import time | ||
from flask import Flask, request | ||
|
||
app = Flask(__name__) | ||
|
||
|
||
@app.route('/') | ||
def hello_world(): | ||
incr_limit = 0 | ||
if request.args and 'incrementLimit' in request.args: | ||
incr_limit = request.args.get('incrementLimit') | ||
|
||
simulate_work(incr_limit) | ||
read_filler_file("./filler.file") | ||
|
||
response = { | ||
"statusCode": 200, | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"body": { | ||
"RequestID": "gcr-does-not-specify", | ||
"TimestampChain": [str(time.time_ns())], | ||
} | ||
} | ||
|
||
return json.dumps(response, indent=4) | ||
|
||
|
||
def simulate_work(incr): | ||
num = 0 | ||
while num < incr: | ||
num += 1 | ||
|
||
|
||
def read_filler_file(path: str) -> None: | ||
with open(path, 'rb') as f: | ||
for i in range(1024): | ||
f.seek(i * 40960) | ||
f.read(1) | ||
|
||
|
||
if __name__ == "__main__": | ||
app.run(debug=True, host='0.0.0.0', port=int(os.environ.get('PORT', 8080))) |
8 changes: 8 additions & 0 deletions
8
src/setup/deployment/raw-code/serverless/gcr/hellopy-read-per-57344-bytes/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM python:3.7-alpine | ||
|
||
RUN pip install Flask gunicorn | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 app:app |
46 changes: 46 additions & 0 deletions
46
src/setup/deployment/raw-code/serverless/gcr/hellopy-read-per-57344-bytes/app.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import json | ||
import os | ||
import time | ||
from flask import Flask, request | ||
|
||
app = Flask(__name__) | ||
|
||
|
||
@app.route('/') | ||
def hello_world(): | ||
incr_limit = 0 | ||
if request.args and 'incrementLimit' in request.args: | ||
incr_limit = request.args.get('incrementLimit') | ||
|
||
simulate_work(incr_limit) | ||
read_filler_file("./filler.file") | ||
|
||
response = { | ||
"statusCode": 200, | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"body": { | ||
"RequestID": "gcr-does-not-specify", | ||
"TimestampChain": [str(time.time_ns())], | ||
} | ||
} | ||
|
||
return json.dumps(response, indent=4) | ||
|
||
|
||
def simulate_work(incr): | ||
num = 0 | ||
while num < incr: | ||
num += 1 | ||
|
||
|
||
def read_filler_file(path: str) -> None: | ||
with open(path, 'rb') as f: | ||
for i in range(1024): | ||
f.seek(i * 57344) | ||
f.read(1) | ||
|
||
|
||
if __name__ == "__main__": | ||
app.run(debug=True, host='0.0.0.0', port=int(os.environ.get('PORT', 8080))) |