Skip to content

5. Driver list

BlaCkinkGJ edited this page Oct 26, 2020 · 5 revisions

Table of Contents

  1. tr-driver: Driver based on trace-replay and cgroup
  2. docker-driver: Driver based on trace-replay and docker
  3. app-driver: Driver which benchmarks the linux application.

tr-driver

Introduction

This driver is the most basic driver of this project which based on trace-replay.

Input Format

{
   "driver": "trace-replay",
   "setting": {
     "trace_replay_path": ".\/build\/debug\/trace-replay",
     "device": "sdb",
     "nr_tasks": 6,
     "time": 5,
     "q_depth": 32,
     "nr_thread": 5,
     "prefix_cgroup_name": "tester.trace.",
     "scheduler": "none",
     "task_option": [
       {
         "cgroup_id": "cgroup-1",
         "weight": 100,
         "trace_data_path": ".\/sample\/sample1.dat"
       },
       {
         "cgroup_id": "cgroup-2",
         "weight": 250,
         "trace_data_path": ".\/sample\/sample2.dat"
       },
       {
         "cgroup_id": "cgroup-3",
         "weight": 500,
         "trace_data_path": ".\/sample\/sample1.dat"
       },
       {
         "cgroup_id": "cgroup-4",
         "weight": 1000,
         "trace_data_path": "rand_read",
         "wss": 128,
         "utilization": 10,
         "iosize": 4
       },
       {
         "cgroup_id": "cgroup-5",
         "weight": 2000,
         "trace_data_path": "rand_mixed",
         "wss": 128,
         "utilization": 10,
         "iosize": 4
       },
       {
         "cgroup_id": "cgroup-6",
         "weight": 4000,
         "trace_data_path": "seq_mixed",
         "wss": 128,
         "utilization": 10,
         "iosize": 4
       }
     ]
   }
 }

Output Format

Interval Output Format

{
   "meta": {
     "pid": 18388,
     "time": 5,
     "q_depth": 32,
     "nr_thread": 5,
     "weight": 4000,
     "mqid": 6193157,
     "shmid": 6193157,
     "semid": 6193157,
     "trace_repeat": 1,
     "wss": 128,
     "utilization": 10,
     "iosize": 4,
     "prefix_cgroup_name": "tester.trace.",
     "scheduler": "none",
     "cgroup_id": "cgroup-6",
     "trace_data_path": "seq_mixed",
     "device": 18388
   },
   "data": {
     "type": 0,
     "time": 5.001258,
     "remaining": -0.0012579999999999814,
     "remaining_percentage": 0,
     "avg_bw": 2.5634175441458931,
     "cur_bw": 1.6441498072447192,
     "lat": 0.2297204061547837,
     "time_diff": 7893262.0857071355
   }
 }

Total Output Format

{
   "meta": {
     "pid": 18384,
     "time": 5,
     "q_depth": 32,
     "nr_thread": 5,
     "weight": 2000,
     "mqid": 6160388,
     "shmid": 6160388,
     "semid": 6160388,
     "trace_repeat": 1,
     "wss": 128,
     "utilization": 10,
     "iosize": 4,
     "prefix_cgroup_name": "tester.trace.",
     "scheduler": "none",
     "cgroup_id": "cgroup-5",
     "trace_data_path": "rand_mixed",
     "device": 18384
   },
   "data": {
     "config": {
       "qdepth": 32,
       "timeout": 5,
       "nr_trace": 1,
       "nr_thread": 5,
       "per_thread": 5,
       "result_file": "none_18364_2000_cgroup-5.txt",
       "traces": [
         {
           "start_partition": 0,
           "total_size": 9.765625,
           "start_page": 0,
           "total_pages": 2560000
         }
       ]
     },
     "results": {
       "per_trace": [
         {
           "name": "rand_mixed",
           "issynthetic": 1,
           "synthetic": {
             "working_set_size": 128,
             "utilization": 10,
             "touched_working_set_size": 12,
             "io_size": 4
           },
           "stats": {
             "exec_time": 5.4088611999999996,
             "avg_lat": 0.46379560911528162,
             "avg_lat_var": 0.032199434001685616,
             "lat_min": 0.26804699999999998,
             "lat_max": 1.5264090000000001,
             "iops": 344.80455885982065,
             "total_bw": 1.3468928080461744,
             "read_bw": 0.67597408489609612,
             "write_bw": 0.67091872315007828,
             "total_traffic": 7.28515625,
             "read_traffic": 3.65625,
             "write_traffic": 3.62890625,
             "read_ratio": 0.49812332439678286,
             "total_avg_req_size": 4,
             "read_avg_req_size": 2.0075067024128685,
             "write_avg_req_size": 1.9924932975871315
           },
           "trace_reset_count": 1
         }
       ],
       "aggr_result": {
         "exec_time": 6.4283320000000002,
         "avg_lat": 0.46379560911528162,
         "avg_lat_var": 0.032199434001685616,
         "lat_min": 0.26804699999999998,
         "lat_max": 1.5264090000000001,
         "iops": 290.12191654071381,
         "total_bw": 1.1332887364871633,
         "read_bw": 0.56877118356674794,
         "write_bw": 0.56451755292041539,
         "total_traffic": 7.28515625,
         "read_traffic": 3.65625,
         "write_traffic": 3.62890625,
         "read_ratio": 1.0075349838536061,
         "total_avg_req_size": 4,
         "read_avg_req_size": 2.0075067024128685,
         "write_avg_req_size": 1.9924932975871315
       }
     }
   }
 }

docker-driver

Introduction

This driver needs to install the docker. After installing, You execute this to like tr-driver.

Input Format

 {
   "driver": "docker",
   "setting": {
     "trace_replay_path": ".\/build\/debug\/trace-replay",
     "device": "sdb",
     "nr_tasks": 6,
     "time": 5,
     "q_depth": 32,
     "nr_thread": 5,
     "prefix_cgroup_name": "tester.trace.",
     "scheduler": "none",
     "task_option": [
       {
         "cgroup_id": "cgroup-1",
         "weight": 100,
         "trace_data_path": ".\/sample\/sample1.dat"
       },
       {
         "cgroup_id": "cgroup-2",
         "weight": 250,
         "trace_data_path": ".\/sample\/sample2.dat"
       },
       {
         "cgroup_id": "cgroup-3",
         "weight": 500,
         "trace_data_path": ".\/sample\/sample1.dat"
       },
       {
         "cgroup_id": "cgroup-4",
         "weight": 1000,
         "trace_data_path": "rand_read",
         "wss": 128,
         "utilization": 10,
         "iosize": 4
       },
       {
         "cgroup_id": "cgroup-5",
         "weight": 2000,
         "trace_data_path": "rand_mixed",
         "wss": 128,
         "utilization": 10,
         "iosize": 4
       },
       {
         "cgroup_id": "cgroup-6",
         "weight": 4000,
         "trace_data_path": "seq_mixed",
         "wss": 128,
         "utilization": 10,
         "iosize": 4
       }
     ]
   }
 }

Output Format

Interval Output Format

{
   "meta": {
     "pid": 1,
     "time": 5,
     "q_depth": 32,
     "nr_thread": 5,
     "weight": 100,
     "mqid": 5832704,
     "shmid": 5832704,
     "semid": 5832704,
     "trace_repeat": 1,
     "wss": 0,
     "utilization": 0,
     "iosize": 0,
     "prefix_cgroup_name": "tester.trace.",
     "scheduler": "none",
     "cgroup_id": "cgroup-1",
     "trace_data_path": ".\/sample\/sample1.dat",
     "device": 1
   },
   "data": {
     "type": 0,
     "time": 1.2999999999999999e-05,
     "remaining": 4.999987,
     "remaining_percentage": 0,
     "avg_bw": 0,
     "cur_bw": 0,
     "lat": 0,
     "time_diff": 1598152980.7672668
   }
 }

Total Output Format

{
   "meta": {
     "pid": 1,
     "time": 5,
     "q_depth": 32,
     "nr_thread": 5,
     "weight": 100,
     "mqid": 5832704,
     "shmid": 5832704,
     "semid": 5832704,
     "trace_repeat": 1,
     "wss": 0,
     "utilization": 0,
     "iosize": 0,
     "prefix_cgroup_name": "tester.trace.",
     "scheduler": "none",
     "cgroup_id": "cgroup-1",
     "trace_data_path": ".\/sample\/sample1.dat",
     "device": 1
   },
   "data": {
     "config": {
       "qdepth": 32,
       "timeout": 5,
       "nr_trace": 1,
       "nr_thread": 5,
       "per_thread": 5,
       "result_file": "none_100_cgroup-1.txt",
       "traces": [
         {
           "start_partition": 0,
           "total_size": 9.765625,
           "start_page": 0,
           "total_pages": 2560000
         }
       ]
     },
     "results": {
       "per_trace": [
         {
           "name": ".\/sample\/sample1.dat",
           "issynthetic": 0,
           "stats": {
             "exec_time": 5.0484195999999999,
             "avg_lat": 0.33121071070988889,
             "avg_lat_var": 0.035619870774297041,
             "lat_min": 0.039625,
             "lat_max": 1.2924059999999999,
             "iops": 482.72532655566113,
             "total_bw": 5.2839865469977969,
             "read_bw": 1.5475139982421431,
             "write_bw": 3.7364725487556543,
             "total_traffic": 26.67578125,
             "read_traffic": 7.8125,
             "write_traffic": 18.86328125,
             "read_ratio": 0.70713135158881246,
             "total_avg_req_size": 11.208863356585967,
             "read_avg_req_size": 3.2827246614690191,
             "write_avg_req_size": 7.926138695116947
           },
           "trace_reset_count": 1
         }
       ],
       "aggr_result": {
         "exec_time": 6.2096270000000002,
         "avg_lat": 0.33121071070988889,
         "avg_lat_var": 0.035619870774297041,
         "lat_min": 0.039625,
         "lat_max": 1.2924059999999999,
         "iops": 392.45513458376809,
         "total_bw": 4.2958749776757923,
         "read_bw": 1.2581270984553501,
         "write_bw": 3.0377478792204426,
         "total_traffic": 26.67578125,
         "read_traffic": 7.8125,
         "write_traffic": 18.86328125,
         "read_ratio": 0.41416442327604058,
         "total_avg_req_size": 11.208863356585967,
         "read_avg_req_size": 3.2827246614690191,
         "write_avg_req_size": 7.926138695116947
       }
     }
   }
 }

app-driver

Dockerfile

The app-driver must have a docker image file which is generated by below Dockerfile to run the program.

FROM debian:10-slim
COPY <IMAGE_DEBIAN_FILE>
RUN apt update
RUN apt install libglu1-mesa qt5-default libcurl3-gnutls libharfbuzz-icu0 -y
RUN dpkg -i <IMAGE_DEBIAN_FILE>
ENTRYPOINT <GUEST_IMAGE_FILE_LOCATION>

Then, you load this Dockerfile and export of it.

Shell program

After you make the docker image. You have to make a shell program for running. The running shell is following.

#!/bin/bash

DOCKER_PROCESS_NAME= # sample
DOCKER_IMAGE_FILE= # sample-latest-image.tar

echo "Working directory: $HOME"

if [[ "$(sudo docker images -q $DOCKER_PROCESS_NAME:latest 2> /dev/null)" == "" ]]; then
	sudo docker load -i $DOCKER_IMAGE_FILE
fi

sudo xhost +

if [[ "$DISPLAY" == "" ]]; then
	export DISPLAY=localhost:11.0
fi

if [ ! "$(docker ps -q -f name=$DOCKER_PROCESS_NAME)" ]; then
	sudo docker run --privileged --rm --name $DOCKER_PROCESS_NAME -v $HOME:/root -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY $DOCKER_PROCESS_NAME
else
	echo "$DOCKER_PROCESS_NAME container is already running."
	exit 1
fi

exit 0

How to run

  • run: You must input the shell program path in the left input box and input the docker process name to the right input box. Then, press this button.
  • record: After you press this button. Recording the input sequence will be activeated. You can stop with esc button.
  • replay: After press this button. Replaying the input sequence which was recorded by record button will be activated. In this sequence, you can see the performance of the program.