cURL / Mailing Lists / curl-users / Single Mail

curl-users

CURL command doesn't close network connection immediately?

From: XU Ziming B <Ziming.b.Xu_at_alcatel-lucent.com>
Date: Mon, 29 Dec 2014 08:34:29 +0000

Hi,
                Here is my test scenario:

OS: Wind River Linux 5
Arch: ARM
CURL: 7.24.0
Switch: Marvell/Broadcom(both tested separately)

                CURL command is used in a shell script to download RPM packages from server, the script will create forty processes,
each of them will download hundreds of RPM packages in loop(NOT put hundreds of RPMs in single curl command, every RPM
is downloaded with a separated curl command, totally about 300 RPMs, after all are downloaded, start to download 300 RPMs again).
The forty processes run simultaneously, so there are no more than forty curl processes at any time, and network
connections expected is also no more than forty.
Here is the problem:
netstat command shows that network connections to server increase with the passage of time, most with state
"TIME_WAIT", they can grow up to 600 hundreds at most on my device(network connections to server with state
"ESTABLISHED" is no more than 40 indeed), it takes too much server network connections and local available
ports, expected total network connections to server is no more than 40.

If stopping 40 processes, all network connections to server will decrease to 0 very soon. There are no other network
access between device and server.

Curl command used:
                curl -f -L --sslv3 --cert /../cert/cert.pem --key /../cert/pkey.pem --insecure --write-out %{http_code} --retry 3 -o xx.tmp
--silent --output /dev/null https://server:port/path/xx.rpm 2>/../xx.log

By the way, downloading 300 RPMs(all packages that consist of system on device) again and again(in loop) should be the same
thing as downloading one RPM in loop.

------------------------
Best Regards
Ziming Xu
<Ziming.b.Xu_at_alcatel-lucent.com>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-12-29