Advertisement
Guest User

Untitled

a guest
Dec 17th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ######## Begin of CPU benchmark ########
  4.  
  5. # Benchmark for one thread.
  6.  
  7. for i in {2500..50000..250}
  8. do
  9. echo -n $i >> cpu_1_core.dat
  10. sysbench --test=cpu --num-threads=1 --cpu-max-prime=$i --verbosity=3 run | grep "total time:" | cut -c39-47 >> cpu_1_core.dat
  11. done
  12.  
  13. # Benchmark for two threads. Parallelism.
  14.  
  15. for i in {2500..50000..250}
  16. do
  17. echo -n $i >> cpu_2_core.dat
  18. sysbench --test=cpu --num-threads=2 --cpu-max-prime=$i --verbosity=3 run | grep "total time:" | cut -c39-47 >> cpu_2_core.dat
  19. done
  20.  
  21. # Benchmark for 4 threads. Conmutation between threads and paralellism.
  22.  
  23. for i in {2500..50000..250}
  24. do
  25. echo -n $i >> cpu_4_core.dat
  26. sysbench --test=cpu --num-threads=4 --cpu-max-prime=$i --verbosity=3 run | grep "total time:" | cut -c39-47 >> cpu_4_core.dat
  27. done
  28.  
  29. # Benchmark for 8 threads. Conmutation between threads and paralellism.
  30.  
  31. for i in {2500..50000..250}
  32. do
  33. echo -n $i >> cpu_8_core.dat
  34. sysbench --test=cpu --num-threads=4 --cpu-max-prime=$i --verbosity=3 run | grep "total time:" | cut -c39-47 >> cpu_8_core.dat
  35. done
  36.  
  37. ######## End of CPU benchmark ########
  38.  
  39.  
  40. ######## Begin of MySQL benchmark ########
  41.  
  42. # Benchmark for one thread.
  43.  
  44. for i in {1000..10000..500}
  45. do
  46. echo -n $i >> sql_1_core.dat
  47. 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
  48. done
  49.  
  50. # Benchmark for two threads. Parallelism.
  51.  
  52. for i in {1000..10000..500}
  53. do
  54. echo -n $i >> sql_2_core.dat
  55. 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
  56. done
  57.  
  58. # Benchmark for 4 threads. Conmutation between threads and paralellism.
  59.  
  60. for i in {1000..10000..500}
  61. do
  62. echo -n $i >> sql_4_core.dat
  63. 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
  64. done
  65.  
  66. # Benchmark for 8 threads. Conmutation between threads and paralellism.
  67.  
  68. for i in {1000..10000..500}
  69. do
  70. echo -n $i >> sql_8_core.dat
  71. 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
  72. done
  73.  
  74. ######## End of MySQL benchmark ########
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement