Skip to content

Commit ad583ec

Browse files
committed
Benchmark bug fix
1 parent 67b91a6 commit ad583ec

File tree

7 files changed

+35
-10
lines changed

7 files changed

+35
-10
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,7 @@
5858
/sock/sock-init
5959
/testing/test-cluster
6060
/my-cluster
61+
62+
# Unknown
63+
output
64+
used_time

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ GO = $(abspath ./hack/go.sh)
5656
GO_PATH = hack/go
5757
WORKER_DIR = $(GO_PATH)/src/github.com/open-lambda/open-lambda/worker
5858
ADMIN_DIR = $(GO_PATH)/src/github.com/open-lambda/open-lambda/worker/admin
59-
BENCHMARK_DIR = $(GO_PATH)/src/github.com/open-lambda/s19-lambda/benchmark/benchmark
59+
BENCHMARK_DIR = $(GO_PATH)/src/github.com/open-lambda/s19-lambda/benchmark
6060

6161
LAMBDA_DIR = $(abspath ./lambda)
6262
PIPBENCH_DIR = $(abspath ./pipbench)
@@ -81,8 +81,8 @@ bin/admin: $(WORKER_GO_FILES)
8181
cp $(GO_PATH)/bin/admin ./bin
8282

8383
bin/benchmark: $(BENCHMARK_GO_FILES)
84-
cd $(BENCHMARK_DIR) && $(GO) install
85-
cp $(GO_PATH)/bin/benchmark ./bin
84+
cd $(BENCHMARK_DIR) && $(GO) install
85+
cp $(GO_PATH)/bin/benchmark ./bin
8686

8787

8888
.PHONY: test-all test-sock-all test-docker-all test-cluster

benchmark/benchmark_prepare.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# $2 OpenLambda path
44
# $3 machines list
55

6-
ARR=( "$@" )
6+
ARR=("$@")
77

88
num_dumps=${ARR[0]}
99
echo "number of lambda dumps: $num_dumps"

benchmark/config.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"host": "localhost",
3+
"port": 8079,
4+
"olPath": "/mnt/lambda_scheduler/s19-lambda",
5+
"registryMachines": [
6+
"c220g2-011027.wisc.cloudlab.us",
7+
"c220g2-011025.wisc.cloudlab.us",
8+
"c220g2-011026.wisc.cloudlab.us"
9+
10+
],
11+
"cmds": [
12+
{
13+
"cmd": "{'cmds':[['cpu', 10000], ['mem', 10000000, 0.5]]}",
14+
"numThreads": 20,
15+
"totalCmds": 400
16+
}
17+
]
18+
}
File renamed without changes.

benchmark/main.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type PerfMetrics struct{
5252

5353

5454
var LAMBDA_BASE = "lambda-"
55-
var BENCHMARK_PREPARE_SCRIPT = "benchmark_prepare.sh"
55+
var BENCHMARK_PREPARE_SCRIPT = "/mnt/lambda_scheduler/s19-lambda/benchmark/benchmark_prepare.sh"
5656

5757
// WorkerPools consists a list of WorkerPool, one WorkerPool for each
5858
// Command in the corresponding config file.
@@ -72,12 +72,12 @@ func startBenchmark(ctx *cli.Context) error {
7272
}
7373

7474
cmdLineOut, err := prepBenchmark(*benchmarkConfig)
75+
fmt.Printf("%s", cmdLineOut)
7576
if err != nil {
76-
fmt.Println("Failed to execute run_benchmark.sh")
77+
fmt.Println("Failed to execute prepare_benchmark.sh")
7778
log.Fatalln(err)
7879
return err
7980
}
80-
log.Printf("%s", cmdLineOut)
8181

8282
genWorkload(*benchmarkConfig)
8383

@@ -107,7 +107,8 @@ func prepBenchmark(config BenchmarkConfig) ([]byte, error) {
107107
params := append(scriptName, numCommands...)
108108
params = append(params, olPath...)
109109
params = append(params, registryMachines...)
110-
return exec.Command("/bin/sh", params...).Output()
110+
//fmt.Println(exec.Command("/bin/sh", "ls").Output())
111+
return exec.Command("/bin/bash", params...).CombinedOutput()
111112
}
112113

113114
// Generate synthetic workload based on benchmark config
@@ -132,7 +133,7 @@ func genWorkload(config BenchmarkConfig) {
132133
for i := 0; i < numCommands; i++ {
133134
// Create Job template
134135
job := &Job{}
135-
job.url = url
136+
job.url = url + "/" + LAMBDA_BASE + strconv.Itoa(i)
136137
job.cmds = config.Cmds[i].Cmd
137138
job.lambda = LAMBDA_BASE + string(i)
138139
addLambdaRequests(WorkerPools[i], job)
@@ -187,6 +188,7 @@ func singleLambdaRequest(job Job) int64 {
187188
_, err := http.Post(job.url, "text/plain", bytes.NewBufferString(job.cmds))
188189
if err != nil {
189190
log.Fatalln(err)
191+
fmt.Println(err)
190192
}
191193
end_time := time.Now().UnixNano()
192194
return end_time - start_time
@@ -230,4 +232,4 @@ OPTIONS:
230232
if err != nil {
231233
log.Fatal(err)
232234
}
233-
}
235+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/mnt/lambda_scheduler/s19-lambda/benchmark

0 commit comments

Comments
 (0)