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

Improved cost model #63

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions python/frontend/cirrus.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,28 @@

class CostModel:
def __init__(self,
vm_type,
num_vms,
s3_space_mb,
num_workers,
num_exps, # number of experiments
vm_type, # vm type of experiments
num_vms_per_exp, # num. of vms per experiment
s3_space_mb, # size of S3 space used
num_workers_per_exp, # num. of lambda workers per exp
worker_size):

self.num_exps = num_exps
self.vm_type = vm_type
self.num_vms = num_vms
self.num_vms_per_exp = num_vms_per_exp
self.s3_space_mb = s3_space_mb
self.num_workers = num_workers
self.num_workers_per_exp = num_workers_per_exp
self.worker_size = worker_size

print "Cost Model"
def get_total_cost(self, num_secs):
return num_exps * get_cost_per_exp(num_secs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you mean

self.num_exps

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and self.get_cost_per_exp


# compute cos ($) of running worload
# with given number of vms of specific type,
# with lambdas of specific size
# and s3 storage of specific size
def get_cost(self, num_secs):
def get_cost_per_exp(self, num_secs):
# cost of smallest lambda (128MB) per hour
lambda_cost_base_h = 0.007488
total_lambda_cost_h = (self.worker_size / 128.0 * lambda_cost_base_h) \
Expand Down Expand Up @@ -239,6 +242,7 @@ def tail(file):

start_time = time.time()
cost_model = CostModel(
1,
'm5.large',
self.n_ps,
0,
Expand Down