php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74286 Extremely slow download speed
Submitted: 2017-03-21 15:32 UTC Modified: 2019-04-07 04:22 UTC
Votes:7
Avg. Score:4.0 ± 1.4
Reproduced:5 of 6 (83.3%)
Same Version:2 (40.0%)
Same OS:4 (80.0%)
From: andrey at kostin dot info Assigned:
Status: No Feedback Package: cURL related
PHP Version: 7.1.3 OS: Debian 8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: andrey at kostin dot info
New email:
PHP Version: OS:

 

 [2017-03-21 15:32 UTC] andrey at kostin dot info
Description:
------------
This is the curl_getinfo when running PHP 5.5.33

Array
(
    [url] => https://domain.com/file.xml
    [content_type] => text/xml
    [http_code] => 200
    [header_size] => 275
    [request_size] => 120
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 36.38618
    [namelookup_time] => 0.124528
    [connect_time] => 0.165643
    [pretransfer_time] => 0.537761
    [size_upload] => 0
    [size_download] => 55369333
    [speed_download] => 1521713
    [speed_upload] => 0
    [download_content_length] => 55369333
    [upload_content_length] => -1
    [starttransfer_time] => 0.619762
    [redirect_time] => 0
    [redirect_url] => 
    [primary_ip] => y.y.y.y
    [certinfo] => Array
        (
        )

    [primary_port] => 443
    [local_ip] => x.x.x.x
    [local_port] => 57308
)

This is the curl_getinfo when running PHP 7.1.3

Array
(
    [url] => https://domain.com/file.xml
    [content_type] => text/xml
    [http_code] => 200
    [header_size] => 275
    [request_size] => 120
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 180.262711
    [namelookup_time] => 0.004188
    [connect_time] => 0.043447
    [pretransfer_time] => 0.254245
    [size_upload] => 0
    [size_download] => 14548717
    [speed_download] => 80708
    [speed_upload] => 0
    [download_content_length] => 55369333
    [upload_content_length] => -1
    [starttransfer_time] => 0.362485
    [redirect_time] => 0
    [redirect_url] => 
    [primary_ip] => y.y.y.y
    [certinfo] => Array
        (
        )

    [primary_port] => 443
    [local_ip] => x.x.x.x
    [local_port] => 51196
)
Array
(
    [errno] => 28
    [error] => Operation timed out after 180262 milliseconds with 14548717 out of 55369333 bytes received
)

Test script:
---------------
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://domain.com/file.xml');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_TIMEOUT, 180);
curl_setopt($curl, CURLOPT_ENCODING, 'gzip, deflate');

$response = curl_exec($curl);

print_r(curl_getinfo($curl));

print_r([
    'errno' => curl_errno($curl),
    'error' => curl_error($curl),
]);


Expected result:
----------------
>1.0 MB/s download speed

Actual result:
--------------
< 100 KB/s speed and timeout error

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-21 22:46 UTC] andrey at kostin dot info
More details: speed of php+curl without gzip is similar to curl with gzip. Look like php+curl+gzip has some problems. CPU core usage jumps to 100% when the download is in progress.
 [2019-03-06 08:24 UTC] hello at dylanskiba dot fr
I have the same issue. 
content_type: image/jpeg | http_code: 200 | total_time: 104.583851 | namelookup_time: 3.2E-5 | connect_time: 0.006864 | pretransfer_time: 0.019155 | size_download: 237630 (237.63 Ko) | speed_download: 2272 (2.27 Ko / s) | starttransfer_time: 0.027646 

Note : it's for download a picture from a server to another server (web server hosted by a professionnal)
 [2019-03-26 17:34 UTC] mike@php.net
-Status: Open +Status: Feedback
 [2019-03-26 17:34 UTC] mike@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 [2019-04-07 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 22:01:30 2024 UTC