Compare commits

...

7 Commits
tree ... main

2
.gitignore vendored

@ -56,6 +56,8 @@ runtime/tests/tmp/
runtime/tests/**/*.csv runtime/tests/**/*.csv
runtime/tests/**/*.txt runtime/tests/**/*.txt
runtime/tests/**/*.xlsx runtime/tests/**/*.xlsx
runtime/tests/test_data/
runtime/tests/**/*.log
# Swap Files # Swap Files
*.swp *.swp

@ -20,7 +20,6 @@
#define MODULE_DEFAULT_REQUEST_RESPONSE_SIZE (PAGE_SIZE) #define MODULE_DEFAULT_REQUEST_RESPONSE_SIZE (PAGE_SIZE)
#define MODULE_MAX_ARGUMENT_COUNT 16 #define MODULE_MAX_ARGUMENT_COUNT 16
#define MODULE_MAX_ARGUMENT_SIZE 64 #define MODULE_MAX_ARGUMENT_SIZE 64
#define MODULE_MAX_NAME_LENGTH 32 #define MODULE_MAX_NAME_LENGTH 32
@ -79,15 +78,7 @@ struct module {
/* Entry Function to invoke serverless function */ /* Entry Function to invoke serverless function */
mod_main_fn_t main; mod_main_fn_t main;
struct module *next_module; /* the next module in the chain */
//struct module *next_module; /* the next module in the chain */
/* the left and right children module in the tree */
struct module *left_module;
struct module *right_module;
/* parent module or not?*/
bool is_parent;
}; };
/************************* /*************************

@ -225,8 +225,7 @@ sandbox_mem_print_perf(struct sandbox *sandbox)
uint64_t blocked_us = sandbox->blocked_duration / runtime_processor_speed_MHz; uint64_t blocked_us = sandbox->blocked_duration / runtime_processor_speed_MHz;
uint64_t returned_us = sandbox->returned_duration / runtime_processor_speed_MHz; uint64_t returned_us = sandbox->returned_duration / runtime_processor_speed_MHz;
//if (sandbox->module->next_module == NULL) { if (sandbox->module->next_module == NULL) {
if(sandbox->module->is_parent) {
uint64_t total_time = (sandbox->completion_timestamp - sandbox->request_arrival_timestamp) / runtime_processor_speed_MHz; uint64_t total_time = (sandbox->completion_timestamp - sandbox->request_arrival_timestamp) / runtime_processor_speed_MHz;
bool miss_deadline = sandbox->completion_timestamp > sandbox->absolute_deadline ? true : false; bool miss_deadline = sandbox->completion_timestamp > sandbox->absolute_deadline ? true : false;
uint64_t delayed_us = (sandbox->completion_timestamp - sandbox->absolute_deadline) uint64_t delayed_us = (sandbox->completion_timestamp - sandbox->absolute_deadline)

@ -19,8 +19,7 @@
const int JSON_MAX_ELEMENT_COUNT = 16; const int JSON_MAX_ELEMENT_COUNT = 16;
const int JSON_MAX_ELEMENT_SIZE = 1024; const int JSON_MAX_ELEMENT_SIZE = 1024;
DEQUE_PROTOTYPE(Treequeue,struct module *)
static struct deque_Treequeue *tree_queue;
/************************* /*************************
* Private Static Inline * * Private Static Inline *
************************/ ************************/
@ -375,29 +374,7 @@ module_new_from_json(char *file_name)
int module_count = 0; int module_count = 0;
char *request_headers = NULL; char *request_headers = NULL;
char *reponse_headers = NULL; char *reponse_headers = NULL;
/* struct module *tail_module = NULL; struct module *tail_module = NULL;
deque_init_Treequeue(tree_queue, total_tokens);
assert(tokens[0].type == JSMN_OBJECT);
while (deque_is_empty_Treequeue(tree_queue))
{
Node *current = dequeue(&queue);
if (is_parent) {
current->left = getNextNode();
enqueue(&queue, current->left);
}
if (is_parent) {
current->right = getNextNode();
enqueue(&queue, current->right);
}
}
}*/
struct module **nodes = malloc(JSON_MAX_ELEMENT_COUNT * sizeof(struct module*));
if (nodes == NULL) {
fprintf(stderr, "Memory allocation failed for nodes array\n");
}
for (int i = 0; i < total_tokens; i++) { for (int i = 0; i < total_tokens; i++) {
assert(tokens[i].type == JSMN_OBJECT); assert(tokens[i].type == JSMN_OBJECT);
@ -477,18 +454,7 @@ module_new_from_json(char *file_name)
} else { } else {
panic("Expected active key to be a JSON boolean, was %s\n", val); panic("Expected active key to be a JSON boolean, was %s\n", val);
} }
}else if(strcmp(key,"is_parent") == 0) } else if (strcmp(key, "tail-module") == 0) {
{
assert(tokens[i + j + 1].type == JSMN_PRIMITIVE);
if (val[0] == 't') {
is_tail_module = true;
} else if (val[0] == 'f') {
is_tail_module = false;
} else {
panic("Expected is-parent key to be a JSON boolean, was %s\n", val);
}
}
/*else if (strcmp(key, "tail-module") == 0) {
assert(tokens[i + j + 1].type == JSMN_PRIMITIVE); assert(tokens[i + j + 1].type == JSMN_PRIMITIVE);
if (val[0] == 't') { if (val[0] == 't') {
is_tail_module = true; is_tail_module = true;
@ -497,7 +463,7 @@ module_new_from_json(char *file_name)
} else { } else {
panic("Expected tail_module key to be a JSON boolean, was %s\n", val); panic("Expected tail_module key to be a JSON boolean, was %s\n", val);
} }
}*/else if (strcmp(key, "relative-deadline-us") == 0) { } else if (strcmp(key, "relative-deadline-us") == 0) {
int64_t buffer = strtoll(val, NULL, 10); int64_t buffer = strtoll(val, NULL, 10);
if (buffer < 0 || buffer > (int64_t)RUNTIME_RELATIVE_DEADLINE_US_MAX) if (buffer < 0 || buffer > (int64_t)RUNTIME_RELATIVE_DEADLINE_US_MAX)
panic("Relative-deadline-us must be between 0 and %ld, was %ld\n", panic("Relative-deadline-us must be between 0 and %ld, was %ld\n",
@ -602,16 +568,15 @@ module_new_from_json(char *file_name)
if (module == NULL) goto module_new_err; if (module == NULL) goto module_new_err;
assert(module); assert(module);
if(is_tail_module) module->is_parent = true;
nodes[i] = module; if (tail_module != NULL) { tail_module->next_module = module; }
// if (tail_module != NULL) { tail_module->next_module = module; } tail_module = module;
// tail_module = module; tail_module->next_module = NULL;
// tail_module->next_module = NULL;
/* if this is the tail module, reset tail_module to NULL to build another new chain */
// /* if this is the tail module, reset tail_module to NULL to build another new chain */ if (is_tail_module) {
// if (is_tail_module) { tail_module = NULL;
// tail_module = NULL; }
// }
module_set_http_info(module, request_count, request_headers, request_content_type, module_set_http_info(module, request_count, request_headers, request_content_type,
response_count, reponse_headers, response_content_type); response_count, reponse_headers, response_content_type);
@ -623,13 +588,6 @@ module_new_from_json(char *file_name)
} }
if (module_count == 0) panic("%s contained no active modules\n", file_name); if (module_count == 0) panic("%s contained no active modules\n", file_name);
for (int i = 0; i <= module_count; i++) {
int left_index = 2 * i + 1;
int right_index = 2 * i + 2;
if (left_index <= module_count) nodes[i]->left_module = nodes[left_index];
if (right_index <= module_count) nodes[i]->right_module = nodes[right_index];
}
free(nodes);
#ifdef LOG_MODULE_LOADING #ifdef LOG_MODULE_LOADING
debuglog("Loaded %d module%s!\n", module_count, module_count > 1 ? "s" : ""); debuglog("Loaded %d module%s!\n", module_count, module_count > 1 ? "s" : "");
#endif #endif

@ -2,16 +2,18 @@ include Makefile.inc
#TESTS=fibonacci fibonacci2 fibonacci3 big_fibonacci C-Image-Manip empty work work1k work10k work100k work1m forever filesys sockserver sockclient empty #TESTS=fibonacci fibonacci2 fibonacci3 big_fibonacci C-Image-Manip empty work work1k work10k work100k work1m forever filesys sockserver sockclient empty
TESTS=fibonacci big_fibonacci C-Image-Manip empty work work1k work10k work100k work1m forever filesys sockserver sockclient empty TESTS=fibonacci big_fibonacci C-Image-Manip empty work work1k work10k work100k work1m forever filesys sockserver sockclient empty
TESTS2=noop
TESTSRT=$(TESTS:%=%_rt) TESTSRT=$(TESTS:%=%_rt)
TESTSRT2=$(TESTS2:%=%_rt)
.PHONY: all clean rttests tinyekf cifar10 gocr sod .PHONY: all clean rttests tinyekf cifar10 gocr sod add
all: rttests tinyekf cifar10 gocr sod all: rttests tinyekf cifar10 gocr sod
@echo "Test Compilation done!" @echo "Test Compilation done!"
rttests: $(TESTSRT) rttests: $(TESTSRT)
add: $(TESTSRT2)
clean: clean:
@echo "Cleaning Test Applications" @echo "Cleaning Test Applications"

@ -0,0 +1,22 @@
import os
def calculate_average(filename):
with open(filename, "r") as file:
values = file.readlines()
values = [int(value.strip()) for value in values]
average = sum(values) / len(values) if values else 0
return average
def main():
noop_functions = ["noop1", "noop2", "noop3", "noop4", "noop5"]
for noop in noop_functions:
filename = f"{noop}.txt"
if os.path.exists(filename):
average = calculate_average(filename)
print(f"Average for {filename}: {average}")
else:
print(f"{filename} does not exist.")
if __name__ == "__main__":
main()

@ -0,0 +1,26 @@
import sys
def process_file(input_file, noop_functions):
data = {noop: [] for noop in noop_functions}
with open(input_file, "r") as infile:
for line in infile:
for noop in noop_functions:
if noop in line:
value = line.split(",")[6]
data[noop].append(value)
for noop, values in data.items():
with open(f"{noop}.txt", "w") as outfile:
outfile.write("\n".join(values))
if __name__ == "__main__":
noop_functions = ["noop1", "noop2", "noop3", "noop4", "noop5"]
argv = sys.argv[1:]
if len(argv) < 1:
print("usage:", sys.argv[0], "file_dir percentage")
sys.exit()
input_file = argv[0]
process_file(input_file, noop_functions)

@ -16,17 +16,20 @@ server_log="noop_"$chain_len".log"
log="noop"$chain_len"-"$repeat_t".txt" log="noop"$chain_len"-"$repeat_t".txt"
start_script="start-noop"$chain_len".sh" start_script="start-noop"$chain_len".sh"
echo $start_script echo $start_script
path="/users/xiaosuGW/sledge-serverless-framework/runtime/tests" path="/home/weihao/sledge/sledge_tree/runtime/tests"
chmod 400 $path/id_rsa
ssh -o stricthostkeychecking=no -i $path/id_rsa xiaosuGW@10.10.1.1 "$path/$start_script $server_log >/dev/null 2>&1 &"
hey -c 1 -z 60s -disable-keepalive -m GET -d 29 "http://10.10.1.1:10000" > $log 2>&1 & $path/$start_script $server_log >/dev/null 2>&1 &
echo "hey test"
hey -c 1 -z 60s -disable-keepalive -m GET "http://127.0.0.1:10000" > $log 2>&1 &
pid1=$! pid1=$!
wait -f $pid1 wait -f $pid1
printf "[OK]\n" printf "[OK]\n"
ssh -o stricthostkeychecking=no -i $path/id_rsa xiaosuGW@10.10.1.1 "$path/kill_sledge.sh" $path/kill_sledge.sh

@ -0,0 +1,8 @@
## 本地回环 E2E时间测试 三轮测试平均
| 函数个数 | noop1 | noop3 | noop5 |
| ------------------------------ | ------------- | ------------- | ------------- |
| 三轮测试数据?E2E时间ms | 0.4、0.4、0.4 | 0.5、0.5、05. | 0.7、0.7、0.7 |
| 平均E2E时间(ms) | 0.4 | 0.5 | 0.7 |
| 三轮测试数据?初始化时间us | 9 | 115 | 220 |
| 平均初始化时间us | 8.9、8.8、9.1 | 115、115、114 | 223、217、221 |

@ -2,5 +2,5 @@
pid=`ps -ef|grep "sledgert"|grep -v grep |awk '{print $2}'` pid=`ps -ef|grep "sledgert"|grep -v grep |awk '{print $2}'`
echo $pid echo $pid
sudo kill -2 $pid kill -2 $pid

@ -0,0 +1,14 @@
#include <stdio.h>
// 定义一个完全无操作的noop函数
void noop() {
// 此函数完全不执行任何操作
}
int main() {
// 仅调用noop函数
noop();
// main函数也不进行任何输出
return 0;
}

@ -36,7 +36,7 @@ def get_values(key, value, miss_deadline_rate, total_latency, running_times, pre
before_dot = file_name.split(".")[0] before_dot = file_name.split(".")[0]
joint_f_name = before_dot + "_total_time.txt" joint_f_name = before_dot + "_total_time.txt"
cmd='python3 ~/sledge-serverless-framework/runtime/tests/meet_deadline_percentage.py %s 50' % file_name cmd='python3 /home/weihao/sledge/sledge_tree/runtime/tests/meet_deadline_percentage.py %s 50' % file_name
rt=os.popen(cmd).read().strip() rt=os.popen(cmd).read().strip()
cmd2='mv total_time.txt %s' % joint_f_name cmd2='mv total_time.txt %s' % joint_f_name
os.popen(cmd2) os.popen(cmd2)

File diff suppressed because one or more lines are too long

@ -73,7 +73,7 @@
"\n", "\n",
"colors=list(mcolors.TABLEAU_COLORS.keys()) \n", "colors=list(mcolors.TABLEAU_COLORS.keys()) \n",
"\n", "\n",
"with open('G:\\\\test_data\\\\rate.txt', 'r') as f:\n", "with open('G:\\\\test_data\\\\'rate.txt, 'r') as f:\n",
" min_seg = 512\n", " min_seg = 512\n",
" for line in f.readlines():\n", " for line in f.readlines():\n",
" line = line.strip()\n", " line = line.strip()\n",
@ -2703,7 +2703,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.6.4" "version": "3.12.3"
} }
}, },
"nbformat": 4, "nbformat": 4,

@ -1 +1 @@
sudo chsh -s /bin/bash xiaosuGW sudo chsh -s /bin/bash hai

@ -0,0 +1,32 @@
#!/bin/bash
function usage {
echo "$0 [perf output file, chain_function_perf.log or single_function_perf.log or opt_function_perf.log]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
output=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
export SLEDGE_CPU_SPEED=2500
export SLEDGE_SCHEDULER=FIFO
#export SLEDGE_SIGALRM_HANDLER=BROADCAST
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
export SLEDGE_NWORKERS=16
#export SLEDGE_SCHEDULER=EDF
export SLEDGE_SANDBOX_PERF_LOG=$path/$output
echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_noop1.json

@ -0,0 +1,32 @@
#!/bin/bash
function usage {
echo "$0 [perf output file, chain_function_perf.log or single_function_perf.log or opt_function_perf.log]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
output=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
export SLEDGE_CPU_SPEED=2500
export SLEDGE_SCHEDULER=FIFO
#export SLEDGE_SIGALRM_HANDLER=BROADCAST
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
export SLEDGE_NWORKERS=16
#export SLEDGE_SCHEDULER=EDF
export SLEDGE_SANDBOX_PERF_LOG=$path/$output
echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_noop3.json

@ -0,0 +1,32 @@
#!/bin/bash
function usage {
echo "$0 [perf output file, chain_function_perf.log or single_function_perf.log or opt_function_perf.log]"
exit 1
}
if [ $# != 1 ] ; then
usage
exit 1;
fi
output=$1
declare project_path="$(
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
export SLEDGE_CPU_SPEED=2500
export SLEDGE_SCHEDULER=FIFO
#export SLEDGE_SIGALRM_HANDLER=BROADCAST
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
export SLEDGE_NWORKERS=16
#export SLEDGE_SCHEDULER=EDF
export SLEDGE_SANDBOX_PERF_LOG=$path/$output
echo $SLEDGE_SANDBOX_PERF_LOG
cd $project_path/runtime/bin
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_noop5.json

@ -20,11 +20,11 @@ declare project_path="$(
echo $project_path echo $project_path
path=`pwd` path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true #export SLEDGE_DISABLE_PREEMPTION=true
export SLEDGE_CPU_SPEED=2400 export SLEDGE_CPU_SPEED=2500
export SLEDGE_SCHEDULER=SRSF export SLEDGE_SCHEDULER=SRSF
export SLEDGE_SIGALRM_HANDLER=BROADCAST #export SLEDGE_SIGALRM_HANDLER=BROADCAST
#export SLEDGE_SIGALRM_HANDLER=TRIAGED export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_NWORKERS=1 export SLEDGE_NWORKERS=32
#export SLEDGE_SCHEDULER=EDF #export SLEDGE_SCHEDULER=EDF
export SLEDGE_SANDBOX_PERF_LOG=$path/$output export SLEDGE_SANDBOX_PERF_LOG=$path/$output
echo $SLEDGE_SANDBOX_PERF_LOG echo $SLEDGE_SANDBOX_PERF_LOG

@ -0,0 +1,130 @@
#!/bin/bash
function usage {
echo "$0 [cpu-log]"
exit 1
}
chmod 400 ./id_rsa
path="/home/weihao/sledge/sledge_tree/runtime/tests"
#test single 5k c5 50% max RPS (500)
f1="5k_single_50.txt"
server_log_file="execution_single_5k_50.log"
$path/start.sh $server_log_file >/dev/null 2>&1 &
echo "sledge is running"
./test_8c.sh $f1 120 50 5k.jpg 10006 2>&1 &
pid1=$!
wait -f $pid1
$path/kill_sledge.sh
#test single 5k c5 60% max RPS
f1="5k_single_60.txt"
server_log_file="execution_single_5k_60.log"
$path/start.sh $server_log_file >/dev/null 2>&1 &
echo "sledge is running"
./test_rps.sh $f1 120 60 5k.jpg 10006 2>&1 &
pid1=$!
wait -f $pid1
$path/kill_sledge.sh
#test single 5k c5 70% max RPS
f1="5k_single_70.txt"
server_log_file="execution_single_5k_70.log"
$path/start.sh $server_log_file >/dev/null 2>&1 &
echo "sledge is running"
./test_rps.sh $f1 120 70 5k.jpg 10006 2>&1 &
pid1=$!
wait -f $pid1
$path/kill_sledge.sh
#test single 5k c5 80% max RPS
f1="5k_single_80.txt"
server_log_file="execution_single_5k_80.log"
$path/start.sh $server_log_file >/dev/null 2>&1 &
echo "sledge is running"
./test_rps.sh $f1 120 80 5k.jpg 10006 2>&1 &
pid1=$!
wait -f $pid1
$path/kill_sledge.sh
#test single 5k c5 90% max RPS
f1="5k_single_90.txt"
server_log_file="execution_single_5k_90.log"
$path/start.sh $server_log_file >/dev/null 2>&1 &
echo "sledge is running"
./test_rps.sh $f1 120 90 5k.jpg 10006 2>&1 &
pid1=$!
wait -f $pid1
$path/kill_sledge.sh
#test single 5k c5 99% max RPS
f1="5k_single_99.txt"
server_log_file="execution_single_5k_99.log"
$path/start.sh $server_log_file >/dev/null 2>&1 &
echo "sledge is running"
./test_rps.sh $f1 120 100 5k.jpg 10006 2>&1 &
pid1=$!
wait -f $pid1
$path/kill_sledge.sh
#test single 105k c5 50% max RPS (135)
f1="105k_single_50.txt"
server_log_file="execution_single_105k_50.log"
$path/start.sh $server_log_file >/dev/null 2>&1 &
echo "sledge is running"
./test_8c.sh $f1 120 13 5k.jpg 10000 2>&1 &
pid2=$!
wait -f $pid2
$path/kill_sledge.sh
#test single 105k c5 60% max RPS
f1="105k_single_60.txt"
server_log_file="execution_single_105k_60.log"
$path/start.sh $server_log_file >/dev/null 2>&1 &
echo "sledge is running"
./test_8c.sh $f1 120 16 5k.jpg 10000 2>&1 &
pid2=$!
wait -f $pid2
$path/kill_sledge.sh
#test single 105k c5 70% max RPS
f1="105k_single_70.txt"
server_log_file="execution_single_105k_70.log"
$path/start.sh $server_log_file >/dev/null 2>&1 &
echo "sledge is running"
./test_8c.sh $f1 120 19 5k.jpg 10000 2>&1 &
pid2=$!
wait -f $pid2
$path/kill_sledge.sh
#test single 105k c5 80% max RPS
f1="105k_single_80.txt"
server_log_file="execution_single_105k_80.log"
$path/start.sh $server_log_file >/dev/null 2>&1 &
echo "sledge is running"
./test_8c.sh $f1 120 22 5k.jpg 10000 2>&1 &
pid2=$!
wait -f $pid2
$path/kill_sledge.sh
#test single 105k c5 90% max RPS
f1="105k_single_90.txt"
server_log_file="execution_single_105k_90.log"
$path/start.sh $server_log_file >/dev/null 2>&1 &
echo "sledge is running"
./test_8c.sh $f1 120 25 5k.jpg 10000 2>&1 &
pid2=$!
wait -f $pid2
$path/kill_sledge.sh
#test single 105k c5 99% max RPS
f1="105k_single_99.txt"
server_log_file="execution_single_105k_99.log"
$path/start.sh $server_log_file >/dev/null 2>&1 &
echo "sledge is running"
./test_8c.sh $f1 120 27 5k.jpg 10000 2>&1 &
pid2=$!
wait -f $pid2
$path/kill_sledge.sh

@ -15,7 +15,9 @@ concurrency=$3
image=$4 image=$4
port=$5 port=$5
echo "hey -disable-compression -disable-keepalive -disable-redirects -c 5 -q $concurrency -z $duration\s -t 0 -m GET -D "$image" "http://10.16.109.192:$port" > $output"
#hey -disable-compression -disable-keepalive -disable-redirects -c 1 -q $rps -z $duration\s -cpus 1 -t 0 -m GET -D "$image" "http://10.10.1.1:$port" #hey -disable-compression -disable-keepalive -disable-redirects -c 1 -q $rps -z $duration\s -cpus 1 -t 0 -m GET -D "$image" "http://10.10.1.1:$port"
#hey -disable-compression -disable-keepalive -disable-redirects -c $concurrency -z 20s -t 0 -m GET -D "$image" "http://10.10.1.1:$port" #hey -disable-compression -disable-keepalive -disable-redirects -c $concurrency -z 20s -t 0 -m GET -D "$image" "http://10.10.1.1:$port"
hey -disable-compression -disable-keepalive -disable-redirects -c $concurrency -z $duration\s -t 0 -m GET -D "$image" "http://10.10.1.1:$port" > $output hey -disable-compression -disable-keepalive -disable-redirects -c 5 -q $concurrency -z $duration\s -t 0 -m GET -D "$image" "http://10.16.109.192:$port" > $output

@ -0,0 +1,63 @@
#!/bin/bash
function usage {
echo "$0 [aad step] [first_rps] [max_rps]"
exit 1
}
if [ $# != 3 ] ; then
usage
exit 1;
fi
step=$1
current_rps=$2
max_rps=$3
chmod 400 ./id_rsa
path="/home/weihao/sledge/sledge_tree/runtime/tests"
last_actual_rps=0
first_run=true
while [ $current_rps -le $max_rps ]
do
echo "Testing with RPS: $current_rps"
server_log_file="test_max_rps.log"
f1="105k_"$current_rps".txt"
f2="305k_"$current_rps".txt"
f3="5k_"$current_rps".txt"
f4="40k_"$current_rps".txt"
$path/start.sh $server_log_file >/dev/null 2>&1 &
echo "sledge is running"
./test_rps.sh $f1 30 $current_rps 5k.jpg 10000 2>&1 &
pid1=$!
wait -f $pid1
# read hey ouput max rps
actual_rps=$(grep "Requests/sec" "$f1" | awk '{print $2}')
# read loadtest max rps
# actual_rps=$(grep "Requests per second" "$f1" | awk '{print $4}')
echo "Actual RPS achieved: $actual_rps"
if [ "$first_run" = false ]; then
if (( $(echo "$actual_rps <= $last_actual_rps" | bc -l) )); then
echo "Actual RPS did not increase, stopping test."
break
fi
fi
last_actual_rps=$actual_rps
# ±ê¼ÇµÚÒ»´ÎÔËÐÐÒÑÍê³É
first_run=false
current_rps=$((current_rps + step))
$path/kill_sledge.sh
echo "sledge has been stopped"
done
echo "Max RPS testing completed."

@ -0,0 +1,368 @@
{
"active": true,
"name": "resize1",
"path": "resize_wasm.so",
"port": 10000,
"relative-deadline-us": 78574,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/jpeg",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
"active": true,
"name": "png2bmp1",
"path": "C-Image-Manip_wasm.so",
"port": 10001,
"relative-deadline-us": 78574,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/png",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 4096000,
"http-resp-content-type": "image/bmp"
},
{
"active": true,
"name": "cifar10_1",
"path": "cifar10_wasm.so",
"port": 10002,
"relative-deadline-us": 78574,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/bmp",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain",
"tail-module": true
},
{
"active": true,
"name": "resize2",
"path": "resize_wasm.so",
"port": 10003,
"relative-deadline-us": 192762,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/jpeg",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
"active": true,
"name": "png2bmp2",
"path": "C-Image-Manip_wasm.so",
"port": 10004,
"relative-deadline-us": 192762,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/png",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 4096000,
"http-resp-content-type": "image/bmp"
},
{
"active": true,
"name": "cifar10_2",
"path": "cifar10_wasm.so",
"port": 10005,
"relative-deadline-us": 192762,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/bmp",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain",
"tail-module": true
},
{
"active": true,
"name": "resize3",
"path": "resize_wasm.so",
"port": 10006,
"relative-deadline-us": 16346,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/jpeg",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
"active": true,
"name": "png2bmp3",
"path": "C-Image-Manip_wasm.so",
"port": 10007,
"relative-deadline-us": 16346,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/png",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 4096000,
"http-resp-content-type": "image/bmp"
},
{
"active": true,
"name": "cifar10_3",
"path": "cifar10_wasm.so",
"port": 10008,
"relative-deadline-us": 16346,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/bmp",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain",
"tail-module": true
},
{
"active": true,
"name": "resize4",
"path": "resize_wasm.so",
"port": 10009,
"relative-deadline-us": 47824,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/jpeg",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
"active": true,
"name": "png2bmp4",
"path": "C-Image-Manip_wasm.so",
"port": 10010,
"relative-deadline-us": 47824,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/png",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 4096000,
"http-resp-content-type": "image/bmp"
},
{
"active": true,
"name": "cifar10_4",
"path": "cifar10_wasm.so",
"port": 10011,
"relative-deadline-us": 47824,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/bmp",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain",
"tail-module": true
},
{
"active": true,
"name": "resize5",
"path": "resize_wasm.so",
"port": 10012,
"relative-deadline-us": 392870,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/jpeg",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
"active": true,
"name": "png2bmp5",
"path": "C-Image-Manip_wasm.so",
"port": 10013,
"relative-deadline-us": 392870,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/png",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 4096000,
"http-resp-content-type": "image/bmp"
},
{
"active": true,
"name": "cifar10_5",
"path": "cifar10_wasm.so",
"port": 10014,
"relative-deadline-us": 392870,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/bmp",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain",
"tail-module": true
},
{
"active": true,
"name": "resize6",
"path": "resize_wasm.so",
"port": 10015,
"relative-deadline-us": 963810,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/jpeg",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
"active": true,
"name": "png2bmp6",
"path": "C-Image-Manip_wasm.so",
"port": 10016,
"relative-deadline-us": 963810,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/png",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 4096000,
"http-resp-content-type": "image/bmp"
},
{
"active": true,
"name": "cifar10_6",
"path": "cifar10_wasm.so",
"port": 10017,
"relative-deadline-us": 963810,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/bmp",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain",
"tail-module": true
},
{
"active": true,
"name": "resize7",
"path": "resize_wasm.so",
"port": 10018,
"relative-deadline-us": 81730,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/jpeg",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
"active": true,
"name": "png2bmp7",
"path": "C-Image-Manip_wasm.so",
"port": 10019,
"relative-deadline-us": 81730,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/png",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 4096000,
"http-resp-content-type": "image/bmp"
},
{
"active": true,
"name": "cifar10_7",
"path": "cifar10_wasm.so",
"port": 10020,
"relative-deadline-us": 81730,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/bmp",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain",
"tail-module": true
},
{
"active": true,
"name": "resize8",
"path": "resize_wasm.so",
"port": 10021,
"relative-deadline-us": 239120,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/jpeg",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
"active": true,
"name": "png2bmp8",
"path": "C-Image-Manip_wasm.so",
"port": 10022,
"relative-deadline-us": 239120,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/png",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 4096000,
"http-resp-content-type": "image/bmp"
},
{
"active": true,
"name": "cifar10_8",
"path": "cifar10_wasm.so",
"port": 10023,
"relative-deadline-us": 239120,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/bmp",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain",
"tail-module": true
},

@ -0,0 +1,15 @@
{
"active": true,
"name": "noop1",
"path": "noop_wasm.so",
"port": 10000,
"relative-deadline-us": 0,
"argsize": 0,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 0,
"http-resp-headers": [],
"http-resp-size": 0,
"http-resp-content-type": "text/plain",
"tail-module": true
}

@ -0,0 +1,43 @@
{
"active": true,
"name": "noop1",
"path": "noop_wasm.so",
"port": 10000,
"relative-deadline-us": 0,
"argsize": 0,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 0,
"http-resp-headers": [],
"http-resp-size": 0,
"http-resp-content-type": "text/plain",
},
{
"active": true,
"name": "noop2",
"path": "noop_wasm.so",
"port": 10001,
"relative-deadline-us": 0,
"argsize": 0,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 0,
"http-resp-headers": [],
"http-resp-size": 0,
"http-resp-content-type": "text/plain",
},
{
"active": true,
"name": "noop3",
"path": "noop_wasm.so",
"port": 10002,
"relative-deadline-us": 0,
"argsize": 0,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 0,
"http-resp-headers": [],
"http-resp-size": 0,
"http-resp-content-type": "text/plain",
"tail-module": true
}

@ -0,0 +1,71 @@
{
"active": true,
"name": "noop1",
"path": "noop_wasm.so",
"port": 10000,
"relative-deadline-us": 0,
"argsize": 0,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 0,
"http-resp-headers": [],
"http-resp-size": 0,
"http-resp-content-type": "text/plain",
},
{
"active": true,
"name": "noop2",
"path": "noop_wasm.so",
"port": 10001,
"relative-deadline-us": 0,
"argsize": 0,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 0,
"http-resp-headers": [],
"http-resp-size": 0,
"http-resp-content-type": "text/plain",
},
{
"active": true,
"name": "noop3",
"path": "noop_wasm.so",
"port": 10002,
"relative-deadline-us": 0,
"argsize": 0,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 0,
"http-resp-headers": [],
"http-resp-size": 0,
"http-resp-content-type": "text/plain",
},
{
"active": true,
"name": "noop4",
"path": "noop_wasm.so",
"port": 10003,
"relative-deadline-us": 0,
"argsize": 0,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 0,
"http-resp-headers": [],
"http-resp-size": 0,
"http-resp-content-type": "text/plain",
},
{
"active": true,
"name": "noop5",
"path": "noop_wasm.so",
"port": 10004,
"relative-deadline-us": 0,
"argsize": 0,
"http-req-headers": [],
"http-req-content-type": "text/plain",
"http-req-size": 0,
"http-resp-headers": [],
"http-resp-size": 0,
"http-resp-content-type": "text/plain",
"tail-module": true
}

@ -14,6 +14,9 @@ rps=$3
image=$4 image=$4
port=$5 port=$5
#hey -disable-compression -disable-keepalive -disable-redirects -c 1 -q $rps -z $duration\s -cpus 1 -t 0 -m GET -D "$image" "http://10.10.1.1:$port" echo "hey test"
hey -disable-compression -disable-keepalive -disable-redirects -c 8 -q 50 -z $duration\s -t 0 -m GET -D "$image" "http://10.10.1.1:$port" > $output
hey -disable-compression -disable-keepalive -disable-redirects -c 5 -q $rps -z $duration\s -t 0 -m GET -D "$image" "http://10.16.109.192:$port" > $output
#loadtest -c 5 --rps $rps -t $duration --method GET --data @$image "http://10.16.109.192:$port" > $output
#hey -disable-compression -disable-keepalive -disable-redirects -c 8 -q 50 -z $duration\s -t 0 -m GET -D "$image" "http://10.10.1.1:$port" > $output

@ -1,36 +0,0 @@
127.0.0.1:10002${ "module" : "bitcount", "args" : [ "bitcount1" , "16777216" ] }
127.0.0.1:10002${ "module" : "bitcount", "args" : [ "bitcount2" , "16777216" ] }
;127.0.0.1:10004${ "module" : "basic_math", "args" : [ "basic_math1" ] }
;127.0.0.1:10004${ "module" : "basic_math", "args" : [ "basic_math2" ] }
;127.0.0.1:10006${ "module" : "binarytrees", "args" : [ "binarytrees1", "16" ] }
;127.0.0.1:10006${ "module" : "binarytrees", "args" : [ "binarytrees2", "16" ] }
;127.0.0.1:10008${ "module" : "crc", "args" : [ "crc1", "crc/large.pcm" ] }
;127.0.0.1:10008${ "module" : "crc", "args" : [ "crc2", "crc/large.pcm" ] }
;127.0.0.1:10010${ "module" : "dijkstra", "args" : [ "dijkstra1", "dijkstra/input.dat" ] }
;127.0.0.1:10010${ "module" : "dijkstra", "args" : [ "dijkstra2", "dijkstra/input.dat" ] }
;127.0.0.1:10012${ "module" : "forever", "args" : [ "forever01" ] }
;127.0.0.1:10012${ "module" : "forever", "args" : [ "forever02" ] }
;127.0.0.1:10014${ "module" : "fornever", "args" : [ "fornever01", "10" ] }
;127.0.0.1:10014${ "module" : "fornever", "args" : [ "fornever02", "20" ] }
;127.0.0.1:10014${ "module" : "fornever", "args" : [ "fornever03", "30" ] }
;127.0.0.1:10014${ "module" : "fornever", "args" : [ "fornever04", "40" ] }
;127.0.0.1:10016${ "module" : "fft", "args" : [ "fft1" , "8", "32768" ] }
;127.0.0.1:10016${ "module" : "fft", "args" : [ "fft2" , "8", "32768" ] }
;127.0.0.1:10018${ "module" : "function_pointers", "args" : [ "function_pointers1" ] }
;127.0.0.1:10018${ "module" : "function_pointers", "args" : [ "function_pointers2" ] }
;127.0.0.1:10020${ "module" : "gsm", "args" : [ "gsm1" , "-fps" , "-c", "gsm/large.au" ] }
;127.0.0.1:10020${ "module" : "gsm", "args" : [ "gsm2" , "-fps" , "-c", "gsm/large.au" ] }
;127.0.0.1:10022${ "module" : "libjpeg", "args" : [ "libjpeg1" ] }
;127.0.0.1:10022${ "module" : "libjpeg", "args" : [ "libjpeg2" ] }
;127.0.0.1:10024${ "module" : "mandelbrot", "args" : [ "mandelbrot1", "5000" ] }
;127.0.0.1:10024${ "module" : "mandelbrot", "args" : [ "mandelbrot2", "5000" ] }
;127.0.0.1:10026${ "module" : "matrix_multiply", "args" : [ "matrix_multiply1" ] }
;127.0.0.1:10026${ "module" : "matrix_multiply", "args" : [ "matrix_multiply2" ] }
;127.0.0.1:10028${ "module" : "patricia", "args" : [ "patricia1" , "large.udp" ] }
;127.0.0.1:10030${ "module" : "sqlite", "args" : [ "sqlite1" ] }
;127.0.0.1:10030${ "module" : "sqlite", "args" : [ "sqlite2" ] }
127.0.0.1:10032${ "module" : "stringsearch", "args" : [ "strsearch1" ] }
127.0.0.1:10032${ "module" : "stringsearch", "args" : [ "strsearch2" ] }
;127.0.0.1:10034${ "module" : "filesys", "args" : [ "filesys1", "fs_in.txt", "fs_out.txt" ] }
;127.0.0.1:10036${ "module" : "sockserver", "args" : [ "sockserv1", "20000" ] }
;127.0.0.1:10038${ "module" : "sockclient", "args" : [ "sockcli1", "localhost", "20000" ] }
Loading…
Cancel
Save