Bug #80830 [NEW]: Running out of local ports when using curl
| From: | external dot maik dot dieterich at bosch dot com | Date: | Thu, 04 Mar 2021 14:27:36 +0000 |
| Subject: | Bug #80830 [NEW]: Running out of local ports when using curl | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-232556@lists.php.net to get a copy of this message | ||
From: external dot maik dot dieterich at bosch dot com
Operating system: Windows Server 2019
PHP version: 7.4.15
Package: Network related
Bug Type: Bug
Bug description:Running out of local ports when using curl
Description:
------------
We are having an application which runs in Apache and gets files via an
API. These files are stored on a storage over a rest API. For
transferring the files to the storage we are using PHP with curl.
Php opens a local port to local port connection when a curl handle is
initialized with a connection to an external server.
This local connection stays in TIME_WAIT after the external connection
and the curl handle is closed.
When open connections with curl from command line without PHP these
local port local port connections are not opened.
Test script:
---------------
for($i = 0; $i < 5000; $i++)
{
$ch = curl_init("your url");
$response = curl_exec($ch);
curl_close($ch);
}
Expected result:
----------------
No connections in TIME_WAIT.
Actual result:
--------------
Many connections in TIME_WAIT.
--
Edit bug report at https://bugs.php.net/bug.php?id=80830&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80830&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80830&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80830&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80830&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80830&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80830&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80830&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80830&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80830&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80830&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80830&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80830&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80830&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80830&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80830&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80830&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80830&r=mysqlcfg