Bug #74971 [NEW]: (HY000/2002): Resource temporarily unavailable
| From: | spam2 at rhsoft dot net | Date: | Sat, 22 Jul 2017 14:10:57 +0000 |
| Subject: | Bug #74971 [NEW]: (HY000/2002): Resource temporarily unavailable | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-210192@lists.php.net to get a copy of this message | ||
From: spam2 at rhsoft dot net
Operating system: Linux
PHP version: 7.0.21
Package: MySQLi related
Bug Type: Bug
Bug description:(HY000/2002): Resource temporarily unavailable
Description:
------------
mysqlnd/mysqli scales badly on unix-socket under load
that can only be rproduced on fast machines and with http-keep-alive
because otherwise the connection overhead mask the issue and which
extremely optimized code
but originally i have seen the issue on our production cms with exactly
the benchmark below - the reproducer just makes it easier beause it's
even more lightweight than the core-cms code
__________________________________
my.cnf (MariaDB 10.2)
max_connections = 300
thread_handling = pool-of-threads
thread_pool_idle_timeout = 900
__________________________________
<?php declare(strict_types=1);
require __DIR__ . '/php/serverconf.inc.php';
$conn = mysqli_init();
mysqli_options($conn, MYSQLI_OPT_INT_AND_FLOAT_NATIVE, true);
if(mysqli_real_connect($conn, 'localhost', $sql_user, $sql_pwd, $sql_db,
3600, '', 0) === true)
{
echo 'OK';
}
else
{
echo 'FAILED';
}
__________________________________
ab -c 250 -n 1000000 -k http://corecms/connect-bench.php
__________________________________
[22-Jul-2017 15:57:49 Europe/Vienna] PHP Warning: mysqli_real_connect()
[<a
href='http://at.php.net/manual/de/function.mysqli-real-connect.php'>function.mysqli-real-connect.php</a>]:
(HY000/2002): Resource temporarily unavailable in
/mnt/data/www/corecms.rhsoft.net/connect-bench.php on line 5
[22-Jul-2017 15:57:49 Europe/Vienna] PHP Warning: mysqli_real_connect()
[<a
href='http://at.php.net/manual/de/function.mysqli-real-connect.php'>function.mysqli-real-connect.php</a>]:
(HY000/2002): Resource temporarily unavailable in
/mnt/data/www/corecms.rhsoft.net/connect-bench.php on line 5
[22-Jul-2017 15:57:50 Europe/Vienna] PHP Warning: mysqli_real_connect()
[<a
href='http://at.php.net/manual/de/function.mysqli-real-connect.php'>function.mysqli-real-connect.php</a>]:
(HY000/2002): Resource temporarily unavailable in
/mnt/data/www/corecms.rhsoft.net/connect-bench.php on line 5
__________________________________
MariaDB guys state that this is a client issue (while that is likely
true i don't believe in timeouts given the 11696 requests/second)
Am 17.07.2017 um 15:02 schrieb Vladislav Vaintroub:
> You are getting HY000/2002, the range starting with 2000 (ending iirc
3000) is the error originating on client. If I was to guess it is a
client-side connection timeout
--
Edit bug report at https://bugs.php.net/bug.php?id=74971&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74971&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74971&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74971&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74971&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74971&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74971&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74971&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74971&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74971&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74971&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74971&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74971&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74971&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74971&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74971&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74971&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74971&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74971&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74971&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74971&r=mysqlcfg