Baidu consulted some information, combined with some of its own experience, and adopted the following solution:
Copy the code The code is as follows:
$idlist='';
for($i=1;$i<= 20;$i++){
if($i==1){
$idlist=mt_rand(3,25216);
}
else{
$idlist=$idlist.','.mt_rand(3,25216);
}
}
$query="select * from table where id in ($idlist) LIMIT 0,10";
The above introduces the solution to CPU 100% caused by cpu 100 php randomly recording mysql rand, including the content of cpu 100. I hope it will be helpful to friends who are interested in PHP tutorials.