1. I decided to simulate the scenario of using file_put_contents() to simultaneously write to a file at the same path in the test environment, and then observe whether reading the file content would return empty.
require.php
<?php
$i = rand();
$path = 'return.php';
$contents = [
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j'
];
if (file_exists($path)) {
$read = file_get_contents($path);
if (empty($read)) {
file_put_contents('empty-' . rand() . '.php', $read, LOCK_EX);
}
}
$code = '<?php';
$code .= "\n\n";
$contents = array_merge($contents, [$i]);
$code .= 'return ' . var_export($contents, true) . ';';
file_put_contents($path, $code, LOCK_EX);
?>2. Since this is only for temporary use, I selected Pay-As-You-Go Resource Pack as the product type and Trial Edition as the resource pack type, allowing up to 1,000 virtual users to be simulated simultaneously. See Figure 1.

3. I created a test scenario, selecting Concurrent Mode (Virtual User Mode) as the stress mode, Manual Speed Control as the ramp-up mode, a maximum concurrency of 10, and a total stress testing duration of 2 minutes, with an estimated consumption of 1000 VUM. See Figure 2.

4. For the API test, I selected the scenario just created under Performance Testing PTS / Stress Testing. See Figure 3.

5. Viewing Performance Testing PTS / Report Details, the total number of requests is 49,000. See Figure 4.

6. Checking the program execution results, I confirmed that over 20,000 files were generated, specifically: return.php, and a large number of files starting with empty-. See Figure 5.

