-
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.
Reading 1B for every 2048B, 4096B, 8192B
- Loading branch information
Showing
11 changed files
with
169 additions
and
215 deletions.
There are no files selected for viewing
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
23 changes: 23 additions & 0 deletions
23
experiments/image-size/cold-image-size-100-gcr-read-per-2048-bytes.json
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": "gcr", | ||
"Runtime": "python3.9", | ||
"SubExperiments": [ | ||
{ | ||
"Title": "cold-image-size-100-gcr-read-per-2048-bytes", | ||
"Function": "hellopy-read-per-2048-bytes", | ||
"Handler": "Dockerfile", | ||
"PackageType": "Container", | ||
"PackagePattern": "lambda_function.py", | ||
"Bursts": 500, | ||
"BurstSizes": [ | ||
1 | ||
], | ||
"IATSeconds": 900, | ||
"DesiredServiceTimes": [ | ||
"0ms" | ||
], | ||
"Parallelism": 50, | ||
"FunctionImageSizeMB": 100 | ||
} | ||
] | ||
} |
23 changes: 23 additions & 0 deletions
23
experiments/image-size/cold-image-size-100-gcr-read-per-8192-bytes.json
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": "gcr", | ||
"Runtime": "python3.9", | ||
"SubExperiments": [ | ||
{ | ||
"Title": "cold-image-size-100-gcr-read-per-8192-bytes", | ||
"Function": "hellopy-read-per-8192-bytes", | ||
"Handler": "Dockerfile", | ||
"PackageType": "Container", | ||
"PackagePattern": "lambda_function.py", | ||
"Bursts": 500, | ||
"BurstSizes": [ | ||
1 | ||
], | ||
"IATSeconds": 900, | ||
"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
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
src/setup/deployment/raw-code/serverless/gcr/hellopy-read-per-2048-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-2048-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 * 2048) | ||
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-8192-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 |
Oops, something went wrong.