PHP Script to find Network Speed/Bandwidth

Hi,

I am looking for a php script to detect the network speed/bandwidth.

I will need it to know that if there is enough network speed/bandwidth to stream a video file or not.

I Google alot but cannot find it.

Kindly help.

Thanks.

usmangt

PHP cannot do this trick on it’s own and needs some Javascript making an AJAX call running on the client side to tell the server that the page has loaded.

http://www.dynamicdrive.com/forums/archive/index.php/t-2198.html
http://stackoverflow.com/questions/3943016/php-speed-test-for-user-connection-speed-without-echo-in-current-page
http://ditio.net/2008/08/06/detect-connection-speed-with-javascript/

PHP can record the starting time and then start outputting random data for say 10 seconds. The amount of traffic transferred in that 10 seconds can be used to detect link speed. It works because TCP has to send acknowledgements for each of its packets before it can continue (with a small error window called the TCP window).