Skip to content

Commit

Permalink
Set chunk size to 64 KB
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mpdude committed Sep 11, 2018
1 parent 0cd703f commit c71d64c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}.");
}
Expand Down

0 comments on commit c71d64c

Please sign in to comment.