From c71d64c59e8394f8c98dca6037a34e0ac11f2dc4 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Tue, 11 Sep 2018 08:52:38 +0200 Subject: [PATCH] Set chunk size to 64 KB Still, this is an arbitrary choice. But as send_long_data() is designed to send out data to the network immediately, it is probably a good thing performance-wise to have a little bit bigger chunks (think TCP windows or offloading). And, on the other hand, 64 KB of memory in PHP should not hurt that much. --- lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php index 8846aaae43d..c3b83c5bcfb 100644 --- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php +++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php @@ -257,7 +257,7 @@ private function _processLongData() if (is_resource($value) && get_resource_type($value) === 'stream') { $stream = $value; while (! feof($stream)) { - $chunk = fread($stream, 8192); + $chunk = fread($stream, 64 * 1024); if ($chunk === false) { throw new MysqliException("Failed processing the stream resource for parameter offset ${paramNr}."); }