The content of this section:
A sample shell script code to test the concurrency of the database.
Example:
#!/bin/bash#********************************# #并发后台运行fun # # forWanggy -- on- -# #note: www.jquerycn.cn # #fun_num Fun functions Background Run # #sql_num each function SQL Run Count #********************************# #数据库变量设置dbhost=192.168.1.182Dbbase=Rechargedbuser=Infosmsdbpass=Infosmsfun () {#函数并发次数fun_num=5#函数内sql执行次数sql_num= + for((j=1; j<= $fun _num;j++)); Do{random_num=' echo $RANDOM ' echo"The first $j function" for((i=1; i<= $call _num;i++)); DoMySQL-h$dbhost-u$dbuser-p$dbpass-d$dbbase <<getrecode >>Fun_$j.log Call Fun_accountbycustid (2,0,Ten. $random _num) Getrecode Echo"section $j functions $i times"Echo"section $j functions $i times">>Call.log done Echo"The execution of the $J function is complete ..."}&Done Wait}main () {fun}mainexit0
Shell script for testing database concurrency pressure