Bug #69938 [NEW]: mysqlnd 50% slower to fetch all results than mysqli
From: turneliusz at gmail dot com
Operating system: Ubuntu
PHP version: 5.6.10
Package: PDO MySQL
Bug Type: Bug
Bug description:mysqlnd 50% slower to fetch all results than mysqli
Description:
------------
I'm just switching to mysqlnd to be able to use
http://php.net/manual/en/book.mysqlnd-ms.php
but I see some serious
performance degradation compared to libmysql. That degradation is not
documented and PHP documentation states that mysqlnd is dropped in
replacement when in fact.
NewRewlic for my application shows more 100ms spend in PHP after
switching to mysqlnd https://db.tt/68r9RfhJ
I've created a benchmark to reproduce to problem, it's quite simple
(ignore the fact I'm creating prepared statement in every iteration;
it's just for testing only):
Orders table contains 91 columns.
$dbh = new PDO("mysql:host=$host; dbname=$dbname;", $user, $pass);
for ($i = 0; $i < 1000; $i++) {
$sth = $dbh->prepare("SELECT * FROM Orders LIMIT 100");
$sth->execute();
$result = $sth->fetchAll(PDO::FETCH_ASSOC);
}
Execution time:
libmysql - 2 seconds
mysqlnd - 3 seconds (50% more)
--
Edit bug report at https://bugs.php.net/bug.php?id=69938&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69938&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69938&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69938&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69938&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69938&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69938&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69938&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69938&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69938&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69938&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69938&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69938&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69938&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69938&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69938&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69938&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69938&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69938&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69938&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69938&r=mysqlcfg
Thread (3 messages)
- turneliusz at gmail dot com