In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Sysbench is a modular, cross-platform, multi-threaded benchmark tool, which is mainly used to evaluate and test the database load under different system parameters.
At present, the sysbench code is hosted on launchpad, the project address: https://launchpad.net/sysbench (the original official website http://sysbench.sourceforge.net is no longer available), and the source code is managed by bazaar.
First, download the source package
Install the epel package to install the bzr client:
Rpm-Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
Then you can start installing the bzr client:
Yum install bzr
After that, you can start downloading the tpcc-mysql source code using the bzr client.
Cd / tmpbzr branch lp:sysbench
Convenient download address for MySQL Chinese website:
Http://imysql.com/wp-content/uploads/2014/09/sysbench-0.4.12-1.1.tgz
Sysbench supports the following test modes:
1. CPU operation performance 2, disk IO performance 3, scheduler performance 4, memory allocation and transfer speed 5, POSIX thread performance 6, database performance (OLTP benchmark test) currently sysbench mainly supports mysql,drizzle,pgsql,oracle and other databases.
II. Compilation and installation
Compiling is very simple. You can refer to the README documentation. The simple steps are as follows:
Cd / tmp/sysbench-0.4.12-1.1./autogen.sh./configure-- with-mysql-includes=/usr/local/mysql/include-- with-mysql-libs=/usr/local/mysql/lib & & make# if make does not report an error, it will generate a binary command line tool sysbenchls-l sysbench-rwxr-xr-x 1 root root 3293186 Sep 21 16:24 sysbench in the sysbench directory
III. Preparation before OLTP test
Initialize the test library environment (a total of 10 test tables, each with 100000 records, populated with randomly generated data):
Cd / tmp/sysbench-0.4.12-1.1/sysbenchmysqladmin create sbtest./sysbench-mysql-host=1.2.3.4-mysql-port=3317-mysql-user=tpcc-mysql-password=tpcc\-test=tests/db/oltp.lua-oltp_tables_count=10-oltp-table-size=100000-rand-init=on prepare
The explanation of these parameters:
-- test=tests/db/oltp.lua means calling the tests/db/oltp.lua script to test the oltp schema-- oltp_tables_count=10 indicates that 10 test tables will be generated-- oltp-table-size=100000 indicates that each test table is populated with 100000 data-- rand-init=on indicates that each test table is populated with random data.
If you are on the local machine, you can also use-mysql-socket to specify the socket file to connect. When loading test data, it depends on the amount of data, if the process is relatively long, you need to wait a little patiently.
In the real test scenario, it is recommended to have no less than 10 data tables and no less than 5 million rows of data in a single table. Of course, it depends on the hardware configuration of the server. If you are equipped with a high IOPS device such as SSD or PCIE SSD, it is recommended that you have at least 100 million rows of data in a single table.
4. Conduct OLTP test
Based on the above initialization data parameters, add a few more parameters, and you can begin the test:
. / sysbench-- mysql-host=1.2.3.4. -- mysql-port=3306-- mysql-user=tpcc\-- mysql-password=tpcc-- test=tests/db/oltp.lua-- oltp_tables_count=10\-- oltp-table-size=10000000-- num-threads=8-- oltp-read-only=off\-- report-interval=10-- rand-type=uniform-- max-time=3600\-- max-requests=0-- percentile=99 run > >. / log/sysbench_oltpX_8_20140921.log
A few options to explain a little bit.
-- num-threads=8 indicates initiating 8 concurrent connections-- oltp-read-only=off indicates no read-only test, that is, mixed read-write mode testing-- report-interval=10 indicates that a test progress report is output every 10 seconds-- rand-type=uniform indicates that the random type is in fixed mode. Several other optional random modes: uniform (fixed), gaussian (Gaussian), special (specific), pareto (Pareto)-- max-time=120 indicates a maximum execution time of 120 seconds-- max-requests=0 indicates that the total number of requests is 0, because the total execution time has been defined above, so the total number of requests can be set to 0 You can also only set the total number of requests without setting the maximum execution time-percentile=99 means setting the sampling ratio. The default is 95%, that is, 1% of long requests are discarded and the maximum value is taken in the remaining 99%.
That is, to simulate the concurrent OLTP test on 10 tables, each table has 10 million rows, and the continuous pressure test time is 1 hour.
In real test scenarios, it is recommended that the continuous stress test time is not less than 30 minutes, otherwise the test data may not be of reference significance.
Fifth, interpretation of test results:
The test results are interpreted as follows:
Sysbench 0.5: multi-threaded system evaluation benchmarkRunning the test with following options:Number of threads: 8Report intermediate results every 10 second (s) Random number generator seed is 0 and will be ignoredThreads startedmusic-report test results every 10 seconds Tps, read per second, write per second, response time statistics over 99% [10s] threads: 8, tps: 1111.51, reads/s: 15568.42, writes/s: 4446.13, response time: 9.95ms (99%) [20s] threads: 8, tps: 1121.90, reads/s: 15709.62, writes/s: 4487.80, response time: 9.78ms (99%) [30s] threads: 8, tps: 1120.00, reads/s: 15679.10, writes/s: 4480.20 Response time: 9.84ms (99%) [40s] threads: 8, tps: 1114.20, reads/s: 15599.39, writes/s: 4456.30, response time: 9.90ms (99%) [50s] threads: 8, tps: 1114.00, reads/s: 15593.60, writes/s: 4456.70, response time: 9.84ms (99%) [60s] threads: 8, tps: 1119.30, reads/s: 15671.60, writes/s: 4476.50 Response time: 9.99ms OLTP test statistics: queries performed: read: 938224-- Total number of reads write: 268064-Total number of writes other: 134032-- Total number of other operations (SELECT, INSERT, UPDATE, DELETE) For example, COMMIT, etc.) total: 1340320-- Total total transactions: 67016 (1116.83 per sec.)-- Total transactions (transactions per second) deadlocks: 0 (1116.83 per sec.)-- Total deadlocks occurred read/ Write requests: 1206288 (20103.01 per sec.)-- Total number of reads and writes (reads and writes per second) other operations: 134032 (2233.67 per sec.)-- Total number of other operations (other operations per second) General statistics:-- some statistical results total time: 60.0053s- -Total time spent total number of events: 67016-- total number of transactions total time taken by event execution: 479.8171s-- all transactions added up (without considering parallelism) response time:-- response time statistics min: 4.27ms-- minimum time consumption Avg: 7.16ms-- average time consuming max: 13.80ms-- longest time consuming approx. 99 percentile: 9.88ms-average time consumed over 99% Threads fairness: events (avg/stddev): 8377.0000 execution time 44.33 execution time (avg/stddev): 59.9771 plus 0.00
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.