• 1 رای - 5 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
سنجش دقیق سرعت اینترنت
#1
سلام علیکم،
از دوستان کسی هست بدونه چه جوری میشه سرعت هرچه دقیقتره اتصال به اینترنت رو با استفاده از php به دست آورد؟اگرهم اسکریپتشو داشته باشین،ممنون میشم بذارید برای استفاده.
این رو هم بگم چند مورد پیدا کردم که هیچکدوم دقیق نبودن.
------------------------
یه جورایی اگه بشه مراحل آپلود و دانلود رو( با یه حجم مشخص) شبیه سازی کرد و زمان شروع و پایان رو بدست آورد و بعدش حجم ارسالی یا دریافتی رو بر زمان مصرف شده تقسیم کرد به نظرم بشه سرعت نسبی رو بدست آورد.
ولی آیا حتما باید ارسال و دریافتی توسط کاربر انجام بشه؟
آیا راه دیگه ای نداره؟،چون کاربر توقع داره با زدن یه دکمه سرعت خودش رو بدونه نه که فایلی دریافت کنه یا ارسال.
یه چندتا اسکریپت پیدا کردم ولی هیچکدوم مثل سایت speedtest.ir
کار نمیکنه یا اصلا درست جواب نمیده،مثل این نمونه ساده:
کد پی‌اچ‌پی:
<?php
$kb
=512;
echo 
"streaming $kb Kb...<!-";
flush();
$time explode(" ",microtime());
$start $time[0] + $time[1];
for(
$x=0;$x<$kb;$x++){
echo 
str_pad(''1024'.');
flush();
}
$time explode(" ",microtime());
$finish $time[0] + $time[1];
$deltat $finish $start;
echo 
"-> Test finished in $deltat seconds. Your speed is "round($kb $deltat3)."Kb/s";
?>
دوستان لطفا کمک کنند،یه چیزی میخوام هول و هوش سایت speedtest.ir
  پاسخ
تشکر شده توسط :
#2
سلام علیکم،
گرچه کسی جواب نداد!! Smile
کد خوبی پیدا کردم،میذارم دوستان هم استفاده کنن:
http://speedtest.net/mini.php
واین
http://www.auditmypc.com/broadband-speed-test.asp
هردو رو فایلهای فلش همراهی میکنه که به کار جذابیت میده.
در ضمن با زبان سمت کلاینت مثل جاوااسکریپت هم میشه همچین کدی رو نوشت.
این رو هم برا کسایی میذارم که میخوان نحوه ی کار هرچه دقیقتر این کار رو -حالا به هر زبانی-متوجه شن،فکر کنم واضح باشه و نیازی به ترجمه نداره
(http://us.mcafee.com/root/speedometer/test_0150.asp):

Frequently Asked Questions
What is Internet connection speed?

Internet connection speed refers to the data transfer rate from the Internet to your computer. Basically that means the amount of time it takes your computer to download a given amount of data. Internet connection speeds are usually measured in Kbps (kilobits per second, or thousands of bits per second) or KBps (kilobytes per second). Nowadays with the technological improvements in data transfer speeds, Internet connection speeds can also be measured in Mbps (megabits per second, or millions of bits per second) or MBps (megabytes per second). For example, if you had a 28.8K (28,800 bps) modem, then it would take at least 4 - 5 minutes to download a 1MB file. If you had digital subscriber line (DSL), the same 1MB file would take approximately 10 - 20 seconds.
How did you calculate my Internet connection speed?

Your Internet connection speed was calculated with 1 or 2 tests, depending on how fast your computer received the first file.
We performed the first test by sending a 150KB file to your computer and recording the amount of time it took for your computer to receive it.

If it took your computer 1.0 seconds or longer to receive the file, then the first test calculation provided your final result.

If it took your computer 1.0 seconds or longer to receive the file, then the first test calculation provided your final result.

If your computer took less than 1.0 seconds to receive the file, then we performed the second test. Based on the first test calculation, you were redirected to another Web page with either 600KB, 1.5MB or 3.0MB of data. The time it took for your computer to download that Web page was then recorded.
Amount of Data/ Time to Download = Your Internet
Connection Speed


Why were 2 tests performed?

The second test was performed because sending larger amounts of data to your computer would provide more accurate results for your Internet connection speed test.
If I refresh the page or recalculate the test, will my results improve?

Not necessarily. The Web pages are not cached by your browser. So each time you refresh or recalculate the test, all files are reloaded as if you were taking the test for the first time.
Why do the results vary each time?

The Internet is a global network, basically a vast grouping of computers transferring data to one another. Connection speeds will vary depending on many conditions such as the time of day and the amount of congestion on the Internet in general. When you request a Web page from a server on the Internet, both the request and the resulting page travel over a series of links that help comprise the Internet. Points between links are often referred to as "hops." So depending on the number of people connecting to our servers, the number of "hops" taken to get to our site, the quality of the connections between each hop to this site and various other factors, your Internet connection speed will always vary.
I have a 56K modem. Why is my result lower than 56.6 Kbps?

Your 56K modem has the ability to transfer up to 56.6 Kbps or 56,600 bps. But that doesn't mean that you can connect to the Internet at that speed. There are many factors involved, including the quality of your telephone line, the quality your telephone company's switches, and FCC regulations.

یا زهـــرا س

اللهم صل علی محمد و آل محمد و عجل فرجهم

افلاطون را گفتند چرا هرگز غمگین نمیشوی؟
گفت :دل برآنچه نمی ماند،نمی بندم.
  پاسخ
تشکر شده توسط : sayeneshin


پرش به انجمن:


کاربران در حال بازدید این موضوع: 1 مهمان