Shell script for testing database concurrency pressure

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.