Andy's Blog » » PhotonVPS 网络有问题

PhotonVPS 网络有问题

今天写了个天涯读帖器,才发现 PhotonVPS 的网络问题比较严重,也就是说采集不好使。

我写了个 PHP 小程序测试了一下,果然很不稳定
以下是程序代码:

<?php
// curl test
$url = 'http://www.tianya.cn';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, '');
curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_ENCODING, '');
$result = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
echo '<xmp>';
print_r($info);
echo '</xmp>';
?>

以下是运行结果,注意看加粗部份的时间:

Array
(
[url] => http://www.tianya.cn
[content_type] => text/html
[http_code] => 200
[header_size] => 373
[request_size] => 95
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 35.026383
[namelookup_time] => 0.001021
[connect_time] => 4.442823
[pretransfer_time] => 4.442883

[size_upload] => 0
[size_download] => 4007
[speed_download] => 114
[speed_upload] => 0
[download_content_length] => 10506
[upload_content_length] => 0
[starttransfer_time] => 7.736726
[redirect_time] => 0
)

Array
(
[url] => http://www.tianya.cn
[content_type] => text/html
[http_code] => 200
[header_size] => 377
[request_size] => 95
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 5.2869
[namelookup_time] => 4.121574
[connect_time] => 4.414595
[pretransfer_time] => 4.414645

[size_upload] => 0
[size_download] => 10506
[speed_download] => 1987
[speed_upload] => 0
[download_content_length] => 10506
[upload_content_length] => 0
[starttransfer_time] => 4.706222
[redirect_time] => 0
)

再多看几次测试结果:

Array
(
[url] => http://www.tianya.cn
[content_type] => text/html
[http_code] => 200
[header_size] => 377
[request_size] => 95
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 30.809833
[namelookup_time] => 0.226889
[connect_time] => 0.519052
[pretransfer_time] => 0.519101
[size_upload] => 0
[size_download] => 1083
[speed_download] => 35
[speed_upload] => 0
[download_content_length] => 10506
[upload_content_length] => 0
[starttransfer_time] => 9.809024
[redirect_time] => 0
)

Array
(
[url] => http://www.tianya.cn
[content_type] => text/html
[http_code] => 200
[header_size] => 377
[request_size] => 95
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 2.039035
[namelookup_time] => 0.002072
[connect_time] => 0.294255
[pretransfer_time] => 0.294303
[size_upload] => 0
[size_download] => 10506
[speed_download] => 5152
[speed_upload] => 0
[download_content_length] => 10506
[upload_content_length] => 0
[starttransfer_time] => 0.587081
[redirect_time] => 0
)

近2个月的使用总体还算满意,但这个问题太重要了。
我实在找不出问题在哪,发了ticket,希望能有好结果,否则不得不搬了。
测试几次中,很多次都是超时无法完成,total_time 都达到了 CURLOPT_TIMEOUT
我估计是网络太不稳定造成的,但为何外部访问又稳定,实在不解。

Incoming search terms:

Tags: photonvps

本文地址: http://www.21andy.com/new/20100324/1785.html

1 评论 to “PHP开源CMS之MODx”

  1. ff 于 2010-03-25 13:19:38 发表:

    何必呢,用winmtr就清楚了