下午各位大佬
我目前正在使用 InnoDB 作为数据库引擎对 Master-Master 复制设置进行压力测试。
我们正在使用这个简单的脚本来测试我们从远程服务器在 Linux CLI 中运行的脚本。
<?php
while(true) {
try {
$conn = mysql_connect('10.0.10.210', 'test', 'test');
if ($conn) {
mysql_select_db('testdb');
$random = rand(0, 1000);
$res = mysql_query("INSERT INTO test VALUES(0, 'test', $random)");
if ($res) {
echo "\n inserted " . microtime();
} else {
echo "\n not inserted " . microtime();
}
mysql_close($conn);
} else {
echo "\n can not connect";
}
} catch (Exception $ex) {
echo "\n can not insert" . microtime();
}
} …
Run Code Online (Sandbox Code Playgroud)