Benchmarking our LAMP servers with this php script
I'm not to good at optimizing, so I don't think I'm qualified to touch on that aspect.
So, formatting I guess,
One thing I can say though, is that your code is seriously lacking consistency. Some assignments ($mysqlserver = 'localhost';) you place spaces around operators and use single quotes, on some ($payload=&quot;&quot;;) it's the exact opposite! I suggest you choose a style, or a beautifier for that matter, and apply it to the whole script. It makes reading it, a lot easier. Also, please fix your indentation. Knowing which functions and clauses your closing brackets end is pretty important.
Now the code,
Why $_REQUEST? Are you expecting to receive input from the URL, other pages, and cookies? If so, you may skip this. If not, I suggest you choose between $_GET or $_POST to keep things specific.
How about this:
$n=rand(0,57)+65;
$payload = $payload.chr($n);

It really could be reduced to:
$c = rand(65, 122);
$payload .= chr($c);

I felt a &quot;c&quot; would be better than an &quot;n&quot;, but really, variables should have some sort of context in them. So &quot;$charCode&quot; would be excellent. Hold off on fixing this though!
Now I don't feel qualified to critique the actual I/O code, so I'll leave that up to someone with more knowledge. From what I do know though, I can't see any glaring problems with your database queries that would cause it to be so slow. Hopefully some one with an eye keener than mine can help.

Now this:
$fname = chr(rand(0,57)+65).chr(rand(0,57)+65).chr(rand(0,57)+65).chr(rand(0,57)+65).'.txt'

is very wet. What I mean by that is, we need to DRY it out a bit!
Head back up to the top, and let's make a nifty function:
function rand_char_str($length) {
    $returnString = &quot;&quot;;
    for ($i = 0; $i &lt; $length; $i++) {
        $returnString .= chr(rand(65, 122));
    }
    return $returnString;
}

Great! Now we can replace
for($i=0;$i&lt;108000;$i++) //generate a big string
{
    $n=rand(0,57)+65;
    $payload = $payload.chr($n);
}

with
$payload = rand_char_str(108000);

We can also replace that $fname assignment with
$fname = rand_char_str(4) . &quot;.txt&quot;;


Towards the end there, you have
$stmt = $mysqli-&gt;prepare('select t from temp limit 1');

and then a conditions checking the value of $stmt. You can just place the method call inside the conditional. This one's just nit-picking though!