简体   繁体   中英

How to practically check whether server can handle many MySQL connections simultaneously

I am new at server-side scripting. On my website, I have MySQL database of users. My website is supposed to host an event where all the users will be logging in and answering some questions. So there will be a lot of MySQL queries submitted, to check whether what they have entered is correct or not. And in the event, the users can submit again and again until the answer is correct.

My question is, instead of going into the specifications of server to estimate the maximum concurrent MySQL connections, is there a way to practically get that? What I mean is, is there some way (some function or algorithm), which will put similar load on the server as number of users submitting queries simultaneously. Sort of like a test run. And in the test run, I should be able to know the maximum concurrent MySQL connections that the server can handle without crashing or slowing down.

I tried to understand mysqlslap , but I find it very difficult to understand. I have also visited this link , but that is on linux server. I am working with phpMyAdmin + MySQL. So is there any easy tutorial for phpMyAdmin somewhere? Or maybe someone can mention what to do shortly. Please consider that I am a newbie at this.

You seem to be asking two different kind of questions; what the maximum number of simultaneous mysql connections is and how you can stress-test your server.

The answer to the first question is easy, there is a mysql setting called max_connections that sets the maximum number of connections and you can check that in phpMyAdmin by going to the Variables tab and searching for max connections .

If you need to change that value you need to look for your config file. That can be for example /etc/my.cnf but that depends on the server and whether you are using MariaDB or MySQL.

When you stress-test your server, mysql will probably not be the problem, but things like memory, etc.

您可以使用查询使用任何SQL工具检查最大连接数:

SHOW VARIABLES LIKE "max_connections";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM