CURL POST 64KB +返回错误的STARTTRANSFER_TIME

时间:2013-05-07 01:06:20

标签: php curl

$ch = curl_init($url); // Any URL

// If not set curl automatically sends it with value '100-continue' on POSTs 1KB+
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Expect:"]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_exec($ch);

以下是curl_getinfo($ ch) 平均值 结果:
发布数据< = 64KB:

[size_upload]        => 65535 B
[request_size]       => 65998 B
[pretransfer_time]   => 0.232 s
[starttransfer_time] => 1.717 s // ~1,5s uploading
[total_time]         => 1.72 s

发布64KB +

[size_upload]        => 65536 B
[request_size]       => 463 B
[pretransfer_time]   => 0.243018 s  // About the same with the <=64KB request
[starttransfer_time] => 0.243032 s  // Here's the problem: immediate upload
[total_time]         => 1.69 s      // About the same

客户:OSX,PHP5.4
服务器:Linux,PHP5.4,Apache 2.2

0 个答案:

没有答案