Improve sysbemch-oltp scenario

This commit is contained in:
Ilya Shakhat 2016-03-21 18:42:45 +03:00
parent d180b74d0a
commit 85a252859d
3 changed files with 42 additions and 37 deletions

View File

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

View File

@ -7,7 +7,7 @@ This is the report of execution test plan
Results
^^^^^^^
Queries per second depending on threads count:
**Queries per second depending on threads count**
{{'''
title: Queries per second
@ -17,20 +17,19 @@ Queries per second depending on threads count:
y2: read queries per sec
chart: line
pipeline:
- { $match: { task: sysbench_oltp, status: OK }}
- { $group: { _id: { threads: "$threads" },
queries_total_per_sec: { $avg: { $divide: ["$queries_total", "$duration"] }},
queries_read_per_sec: { $avg: { $divide: ["$queries_read", "$duration"] }}
}}
- { $project: { x: "$_id.threads",
y: "$queries_total_per_sec",
y2: "$queries_read_per_sec"
}}
- { $sort: { x: 1 }}
''' | chart
- $match: { task: sysbench_oltp, status: OK }
- $group: { _id: { threads: "$threads" },
queries_total_per_sec: { $avg: { $divide: ["$queries_total", "$duration"] }},
queries_read_per_sec: { $avg: { $divide: ["$queries_read", "$duration"] }}
}
- $project:
x: "$_id.threads"
y: "$queries_total_per_sec"
y2: "$queries_read_per_sec"
''' | chart_and_table
}}
Queries per second and mysqld CPU consumption depending on threads count:
**Queries per second and mysqld CPU consumption depending on threads count**
{{'''
title: Queries and and CPU util per second
@ -40,17 +39,16 @@ Queries per second and mysqld CPU consumption depending on threads count:
y2: mysqld CPU consumption, %
chart: line
pipeline:
- { $match: { task: sysbench_oltp, status: OK }}
- { $group: { _id: { threads: "$threads" },
queries_total_per_sec: { $avg: { $divide: ["$queries_total", "$duration"] }},
mysqld_total: { $avg: "$mysqld_total" }
}}
- { $project: { x: "$_id.threads",
y: "$queries_total_per_sec",
y2: { $multiply: [ "$mysqld_total", 100 ] }
}}
- { $sort: { x: 1 }}
''' | chart
- $match: { task: sysbench_oltp, status: OK }
- $group: { _id: { threads: "$threads" },
queries_total_per_sec: { $avg: { $divide: ["$queries_total", "$duration"] }},
mysqld_total: { $avg: "$mysqld_total" }
}
- $project:
x: "$_id.threads"
y: "$queries_total_per_sec"
y2: { $multiply: [ "$mysqld_total", 100 ] }
''' | chart_and_table
}}
.. references:

View File

@ -4,38 +4,44 @@ description:
This scenario uses sysbench to execute DB test plan.
parameters:
target: List of hosts were omsimulator will be executed
tester_hosts: List of hosts were omsimulator will be executed
mysql_hosts: List of hosts were MySQL runs
setup:
-
hosts: {{ target }}
hosts: {{ tester_hosts }}
tasks:
- name: installing sysbench
apt: name=sysbench
become: yes
- name: installing atop
apt:
name: atop, daemon
become: yes
-
hosts: {{ target }}
hosts: {{ mysql_hosts }}
tasks:
- atop: command=start
- apt: name=atop
become: yes
- apt: name=daemon
become: yes
execution:
-
hosts: {{ target }}
hosts: {{ mysql_hosts }}
tasks:
- atop: command=start
-
hosts: {{ tester_hosts }}
matrix:
threads: [ 10, 20, 30, 40, 50, 60 ]
threads: [ 10, 20, 50, 70, 100, 150, 200, 300 ]
tasks:
- sysbench_oltp:
duration: 10
duration: 60
mysql_host: localhost
mysql_db: sbtest
-
hosts: {{ target }}
hosts: {{ mysql_hosts }}
tasks:
- atop:
command: stop
labels: [ CPU, PRC, PRM ]
labels: [ PRC ]
aggregation:
-