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(): def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
mode=dict(default='run'),
threads=dict(type='int', default=10), threads=dict(type='int', default=10),
duration=dict(type='int', default=10), duration=dict(type='int', default=10),
mysql_host=dict(default='localhost'), mysql_host=dict(default='localhost'),

View File

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

View File

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