benchmarking
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
benchmarking [2014/09/20 02:40] – admin | benchmarking [2022/10/29 16:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Benchmarking ====== | ====== Benchmarking ====== | ||
===== Benchmark website ===== | ===== Benchmark website ===== | ||
+ | ==== Benchmark with ab tool ==== | ||
+ | ab tool will be installed when we install webserver apache | ||
+ | === Syntax and basic options === | ||
+ | * Syntax:< | ||
+ | ab [options] [http[s]:// | ||
+ | </ | ||
+ | * Basic options: | ||
+ | * -n requests | ||
+ | * -c concurrency | ||
+ | |||
+ | === examples === | ||
+ | * run benchmark website shop.babies.vn with 100 requests and 4 concurrency multiple requests:< | ||
+ | ab -n 100 -c 4 http:// | ||
+ | </ | ||
+ | This is ApacheBench, | ||
+ | Copyright 1996 Adam Twiss, Zeus Technology Ltd, http:// | ||
+ | Licensed to The Apache Software Foundation, http:// | ||
+ | |||
+ | Benchmarking shop.babies.vn (be patient).....done | ||
+ | |||
+ | |||
+ | Server Software: | ||
+ | Server Hostname: | ||
+ | Server Port: 80 | ||
+ | |||
+ | Document Path: / | ||
+ | Document Length: | ||
+ | |||
+ | Concurrency Level: | ||
+ | Time taken for tests: | ||
+ | Complete requests: | ||
+ | Failed requests: | ||
+ | | ||
+ | Write errors: | ||
+ | Non-2xx responses: | ||
+ | Total transferred: | ||
+ | HTML transferred: | ||
+ | Requests per second: | ||
+ | Time per request: | ||
+ | Time per request: | ||
+ | Transfer rate: 127.16 [Kbytes/ | ||
+ | |||
+ | Connection Times (ms) | ||
+ | min mean[+/-sd] median | ||
+ | Connect: | ||
+ | Processing: | ||
+ | Waiting: | ||
+ | Total: | ||
+ | |||
+ | Percentage of the requests served within a certain time (ms) | ||
+ | 50% 2397 | ||
+ | 66% 2485 | ||
+ | 75% 2639 | ||
+ | 80% 2664 | ||
+ | 90% 2925 | ||
+ | 95% 3002 | ||
+ | 98% 3834 | ||
+ | 99% 3861 | ||
+ | | ||
+ | </ | ||
+ | ===== Benchmark with sysbench(CPU, | ||
+ | ==== Download and Install ==== | ||
+ | Download:< | ||
+ | wget http:// | ||
+ | </ | ||
+ | Install:< | ||
+ | yum install libtool | ||
+ | cd sysbench | ||
+ | ./ | ||
+ | ./configure | ||
+ | make & make install | ||
+ | </ | ||
+ | ==== Syntax and Basic Options ==== | ||
+ | * Syntax:< | ||
+ | sysbench [general-options]... --test=< | ||
+ | </ | ||
+ | * Basic Options: | ||
+ | ==== CPU Benchmark ==== | ||
+ | run script below:< | ||
+ | sysbench --test=cpu --cpu-max-prime=20000 run | ||
+ | </ | ||
+ | Running the test with following options: | ||
+ | Number of threads: 1 | ||
+ | Random number generator seed is 0 and will be ignored | ||
+ | |||
+ | |||
+ | Doing CPU performance benchmark | ||
+ | |||
+ | Threads started! | ||
+ | Done. | ||
+ | |||
+ | Maximum prime number checked in CPU test: 20000 | ||
+ | |||
+ | |||
+ | Test execution summary: | ||
+ | total time: 38.5596s | ||
+ | total number of events: | ||
+ | total time taken by event execution: 38.5538 | ||
+ | per-request statistics: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Threads fairness: | ||
+ | events (avg/ | ||
+ | execution time (avg/ | ||
+ | </ | ||
+ | total time: 38.5596s | ||
+ | </ | ||
+ | ==== File IO Benchmark ==== | ||
+ | - Step1: Prepare:< | ||
+ | sysbench --test=fileio --file-total-size=5G prepare | ||
+ | </ | ||
+ | - Step2: Run benchmark< | ||
+ | sysbench --test=fileio --file-total-size=5G --file-test-mode=rndrw --init-rng=on --max-time=300 --max-requests=0 run | ||
+ | </ | ||
+ | sysbench 0.4.12.5: | ||
+ | |||
+ | Running the test with following options: | ||
+ | Number of threads: 1 | ||
+ | Initializing random number generator from timer. | ||
+ | |||
+ | Random number generator seed is 0 and will be ignored | ||
+ | |||
+ | |||
+ | Extra file open flags: 0 | ||
+ | 128 files, 40Mb each | ||
+ | 5Gb total file size | ||
+ | Block size 16Kb | ||
+ | Number of random requests for random IO: 0 | ||
+ | Read/Write ratio for combined random IO test: 1.50 | ||
+ | Periodic FSYNC enabled, calling fsync() each 100 requests. | ||
+ | Calling fsync() at the end of test, Enabled. | ||
+ | Using synchronous I/O mode | ||
+ | Doing random r/w test | ||
+ | Threads started! | ||
+ | Time limit exceeded, exiting... | ||
+ | Done. | ||
+ | |||
+ | Operations performed: | ||
+ | Read 10.698Gb | ||
+ | | ||
+ | |||
+ | Test execution summary: | ||
+ | total time: 300.0011s | ||
+ | total number of events: | ||
+ | total time taken by event execution: 134.9176 | ||
+ | per-request statistics: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Threads fairness: | ||
+ | events (avg/ | ||
+ | execution time (avg/ | ||
+ | </ | ||
+ | Read 10.698Gb | ||
+ | </ | ||
+ | - Step3: Cleanup< | ||
+ | sysbench --test=fileio --file-total-size=5G cleanup | ||
+ | </ | ||
+ | ==== MySQL Server Benchmark ==== | ||
+ | - Step1: To measure MySQL performance, | ||
+ | sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=root --mysql-password=yourrootsqlpassword prepare | ||
+ | </ | ||
+ | - Step2: Afterwards, you can run the MySQL benchmark as follows:< | ||
+ | sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=root --mysql-password=yourrootsqlpassword --max-time=60 --oltp-read-only=on --max-requests=0 --num-threads=8 run | ||
+ | </ | ||
+ | - Step3: To clean up the system afterwards (i.e., remove the test table), run:< | ||
+ | sysbench --test=oltp --mysql-db=test --mysql-user=root --mysql-password=yourrootsqlpassword cleanup | ||
+ | </ | ||
+ | ===== Benchmark with graphing software ===== | ||
+ | ==== Better Cacti Templates ==== | ||
+ | Download: wget https:// | ||
+ | ===== Benchmark network speed ===== | ||
+ | ==== using speedtest ==== | ||
+ | - Step1: install speedtest on linux:< | ||
+ | pip install speedtest-cli | ||
+ | </ | ||
+ | - Step2: Run test< | ||
+ | speedtest | ||
+ | </ | ||
+ | ==== network monitor with iptraf ==== | ||
+ | refer: http:// | ||
+ | * Install <code bash> | ||
+ | yum install iptraf | ||
+ | </ | ||
+ | * Run normal< | ||
+ | iptraf | ||
+ | </ | ||
+ | * Monitor Traffic on eth0:< | ||
+ | iptraf -s eth0 | ||
+ | </ | ||
+ | ===== Benchmark File System Read Write Performance ===== | ||
+ | refer: http:// | ||
+ | ==== Using dd command ==== | ||
+ | * Benchmarck the speed with which **data was cached to RAM memory, not to the disk**< | ||
+ | dd if=/ | ||
+ | </ | ||
+ | 100+0 records in | ||
+ | 100+0 records out | ||
+ | 104857600 bytes (105 MB) copied, 0.102163 s, 1.0 GB/s | ||
+ | </ | ||
+ | * Ask dd command to report the speed only **after the data is synced with the disk**< | ||
+ | dd if=/ | ||
+ | </ | ||
+ | 100+0 records in | ||
+ | 100+0 records out | ||
+ | 104857600 bytes (105 MB) copied, 1.12073 s, 93.6 MB/s | ||
+ | </ | ||
+ | ==== Using hdparm ==== | ||
+ | <code bash> | ||
+ | hdparm -tT /dev/sdb1 | ||
+ | </ | ||
+ | /dev/sdb1: | ||
+ | | ||
+ | | ||
+ | </ |
benchmarking.1411180807.txt.gz · Last modified: 2022/10/29 16:15 (external edit)