Browse Source

Improve sysbemch-oltp scenario

Ilya Shakhat 3 years ago
parent
commit
85a252859d

+ 1
- 0
performa/modules/sysbench_oltp.py View File

@@ -45,6 +45,7 @@ def parse_sysbench_oltp(raw):
45 45
 def main():
46 46
     module = AnsibleModule(
47 47
         argument_spec=dict(
48
+            mode=dict(default='run'),
48 49
             threads=dict(type='int', default=10),
49 50
             duration=dict(type='int', default=10),
50 51
             mysql_host=dict(default='localhost'),

+ 22
- 24
performa/scenarios/db/sysbench.rst View File

@@ -7,7 +7,7 @@ This is the report of execution test plan
7 7
 Results
8 8
 ^^^^^^^
9 9
 
10
-Queries per second depending on threads count:
10
+**Queries per second depending on threads count**
11 11
 
12 12
 {{'''
13 13
     title: Queries per second
@@ -17,20 +17,19 @@ Queries per second depending on threads count:
17 17
       y2: read queries per sec
18 18
     chart: line
19 19
     pipeline:
20
-    - { $match: { task: sysbench_oltp, status: OK }}
21
-    - { $group: { _id: { threads: "$threads" },
22
-                  queries_total_per_sec: { $avg: { $divide: ["$queries_total", "$duration"] }},
23
-                  queries_read_per_sec: { $avg: { $divide: ["$queries_read", "$duration"] }}
24
-                }}
25
-    - { $project: { x: "$_id.threads",
26
-                    y: "$queries_total_per_sec",
27
-                    y2: "$queries_read_per_sec"
28
-                  }}
29
-    - { $sort: { x: 1 }}
30
-''' | chart
20
+    - $match: { task: sysbench_oltp, status: OK }
21
+    - $group: { _id: { threads: "$threads" },
22
+                queries_total_per_sec: { $avg: { $divide: ["$queries_total", "$duration"] }},
23
+                queries_read_per_sec: { $avg: { $divide: ["$queries_read", "$duration"] }}
24
+              }
25
+    - $project:
26
+        x: "$_id.threads"
27
+        y: "$queries_total_per_sec"
28
+        y2: "$queries_read_per_sec"
29
+''' | chart_and_table
31 30
 }}
32 31
 
33
-Queries per second and mysqld CPU consumption depending on threads count:
32
+**Queries per second and mysqld CPU consumption depending on threads count**
34 33
 
35 34
 {{'''
36 35
     title: Queries and and CPU util per second
@@ -40,17 +39,16 @@ Queries per second and mysqld CPU consumption depending on threads count:
40 39
       y2: mysqld CPU consumption, %
41 40
     chart: line
42 41
     pipeline:
43
-    - { $match: { task: sysbench_oltp, status: OK }}
44
-    - { $group: { _id: { threads: "$threads" },
45
-                  queries_total_per_sec: { $avg: { $divide: ["$queries_total", "$duration"] }},
46
-                  mysqld_total: { $avg: "$mysqld_total" }
47
-                }}
48
-    - { $project: { x: "$_id.threads",
49
-                    y: "$queries_total_per_sec",
50
-                    y2: { $multiply: [ "$mysqld_total", 100 ] }
51
-                  }}
52
-    - { $sort: { x: 1 }}
53
-''' | chart
42
+    - $match: { task: sysbench_oltp, status: OK }
43
+    - $group: { _id: { threads: "$threads" },
44
+                queries_total_per_sec: { $avg: { $divide: ["$queries_total", "$duration"] }},
45
+                mysqld_total: { $avg: "$mysqld_total" }
46
+              }
47
+    - $project:
48
+        x: "$_id.threads"
49
+        y: "$queries_total_per_sec"
50
+        y2: { $multiply: [ "$mysqld_total", 100 ] }
51
+''' | chart_and_table
54 52
 }}
55 53
 
56 54
 .. references:

+ 19
- 13
performa/scenarios/db/sysbench.yaml View File

@@ -4,38 +4,44 @@ description:
4 4
   This scenario uses sysbench to execute DB test plan.
5 5
 
6 6
 parameters:
7
-  target: List of hosts were omsimulator will be executed
7
+  tester_hosts: List of hosts were omsimulator will be executed
8
+  mysql_hosts: List of hosts were MySQL runs
8 9
 
9 10
 setup:
10 11
   -
11
-    hosts: {{ target }}
12
+    hosts: {{ tester_hosts }}
12 13
     tasks:
13 14
     - name: installing sysbench
14 15
       apt: name=sysbench
15 16
       become: yes
16
-    - name: installing atop
17
-      apt:
18
-        name: atop, daemon
19
-      become: yes
20 17
   -
21
-    hosts: {{ target }}
18
+    hosts: {{ mysql_hosts }}
22 19
     tasks:
23
-    - atop: command=start
20
+    - apt: name=atop
21
+      become: yes
22
+    - apt: name=daemon
23
+      become: yes
24 24
 
25 25
 execution:
26 26
   -
27
-    hosts: {{ target }}
27
+    hosts: {{ mysql_hosts }}
28
+    tasks:
29
+    - atop: command=start
30
+  -
31
+    hosts: {{ tester_hosts }}
28 32
     matrix:
29
-      threads: [ 10, 20, 30, 40, 50, 60 ]
33
+      threads: [ 10, 20, 50, 70, 100, 150, 200, 300 ]
30 34
     tasks:
31 35
     - sysbench_oltp:
32
-        duration: 10
36
+        duration: 60
37
+        mysql_host: localhost
38
+        mysql_db: sbtest
33 39
   -
34
-    hosts: {{ target }}
40
+    hosts: {{ mysql_hosts }}
35 41
     tasks:
36 42
     - atop:
37 43
         command: stop
38
-        labels: [ CPU, PRC, PRM ]
44
+        labels: [ PRC ]
39 45
 
40 46
 aggregation:
41 47
   -

Loading…
Cancel
Save