Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ######## Begin of CPU benchmark ########
- # Benchmark for one thread.
- for i in {2500..50000..250}
- do
- echo -n $i >> cpu_1_core.dat
- sysbench --test=cpu --num-threads=1 --cpu-max-prime=$i --verbosity=3 run | grep "total time:" | cut -c39-47 >> cpu_1_core.dat
- done
- # Benchmark for two threads. Parallelism.
- for i in {2500..50000..250}
- do
- echo -n $i >> cpu_2_core.dat
- sysbench --test=cpu --num-threads=2 --cpu-max-prime=$i --verbosity=3 run | grep "total time:" | cut -c39-47 >> cpu_2_core.dat
- done
- # Benchmark for 4 threads. Conmutation between threads and paralellism.
- for i in {2500..50000..250}
- do
- echo -n $i >> cpu_4_core.dat
- sysbench --test=cpu --num-threads=4 --cpu-max-prime=$i --verbosity=3 run | grep "total time:" | cut -c39-47 >> cpu_4_core.dat
- done
- # Benchmark for 8 threads. Conmutation between threads and paralellism.
- for i in {2500..50000..250}
- do
- echo -n $i >> cpu_8_core.dat
- sysbench --test=cpu --num-threads=4 --cpu-max-prime=$i --verbosity=3 run | grep "total time:" | cut -c39-47 >> cpu_8_core.dat
- done
- ######## End of CPU benchmark ########
- ######## Begin of MySQL benchmark ########
- # Benchmark for one thread.
- for i in {1000..10000..500}
- do
- echo -n $i >> sql_1_core.dat
- sysbench --test=oltp --oltp-table-size=100 --oltp-test-mode=complex --oltp-read-only=off --num-threads=4 --max-time=0 --max-requests=$i --mysql-db=dbtest --mysql-user=<user> --mysql-password=<password> run | grep "total time:" | cut -c39-47 >> sql_1_core.dat
- done
- # Benchmark for two threads. Parallelism.
- for i in {1000..10000..500}
- do
- echo -n $i >> sql_2_core.dat
- sysbench --test=oltp --oltp-table-size=100 --oltp-test-mode=complex --oltp-read-only=off --num-threads=4 --max-time=0 --max-requests=$i --mysql-db=dbtest --mysql-user=<user> --mysql-password=<password> run | grep "total time:" | cut -c39-47 >> sql_2_core.dat
- done
- # Benchmark for 4 threads. Conmutation between threads and paralellism.
- for i in {1000..10000..500}
- do
- echo -n $i >> sql_4_core.dat
- sysbench --test=oltp --oltp-table-size=100 --oltp-test-mode=complex --oltp-read-only=off --num-threads=4 --max-time=0 --max-requests=$i --mysql-db=dbtest --mysql-user=<user> --mysql-password=<password> run | grep "total time:" | cut -c39-47 >> sql_4_core.dat
- done
- # Benchmark for 8 threads. Conmutation between threads and paralellism.
- for i in {1000..10000..500}
- do
- echo -n $i >> sql_8_core.dat
- sysbench --test=oltp --oltp-table-size=100 --oltp-test-mode=complex --oltp-read-only=off --num-threads=4 --max-time=0 --max-requests=$i --mysql-db=dbtest --mysql-user=<user> --mysql-password=<password> run | grep "total time:" | cut -c39-47 >> sql_8_core.dat
- done
- ######## End of MySQL benchmark ########
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement