我正在使用 cURL 在我的网站和合作伙伴的网站之间传输数据。
请求很长(约 18 秒),但信息量很小(约 207 字节)。
这是我生成请求的代码:
// Send the subscription
$resource = curl_init($url);
curl_setopt($resource, CURLOPT_RETURNTRANSFER, true);
curl_setopt($resource, CURLOPT_POST, count($postFields));
curl_setopt($resource, CURLOPT_POSTFIELDS, $postString);
$result = curl_exec($resource);
这是 curlinfo 调试的结果:
17.418212 total_time : Total transaction time in seconds for last transfer
0.064612 namelookup_time : Time in seconds until name resolving was complete
0.437222 connect_time : Time in seconds it took to establish the connection
0.946509 pretransfer_time : Time in seconds from start until just before file transfer begins
17.418172 starttransfer_time : Time in seconds until the first byte is about to be transferred
0 redirect_count : Number of redirects
0 redirect_time : Time in seconds of all redirection steps before final transaction was started
207 size_upload : Total number of bytes uploaded
11 speed_upload : Average upload speed
130 size_download : Total number of bytes downloaded
7 speed_download : Average download speed
在 curlinfo 文档:http : //curl.haxx.se/libcurl/c/curl_easy_getinfo.html 上,据说 size_upload 和 speed_upload 分别以字节和字节/秒为单位。
10 字节/秒不是很快,是吗?我在哪里可以找到其他调试信息,我可以做些什么来提高这个速度?
附加信息:发送和接收数据的服务器都具有良好的带宽,并且都在同一个城市