PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I would like to test my visitor’s amount of bandwidth and current connection speed…
Well I’m not quiet sure how to do it, I even don’t know that PHP can do this, but in another hand I definitely can not use user side scripts…
PS: I got one idea but I still don’t know how to use it: I could use SYSTEM command then CMD (I’m running 2003 Web server) then PING $user_ip (or something else that can give me the user speed / bandwidth information), but even than I’ll have a problem retrieving speed value from system return argument…
Real speed.
Try uploading or downloading some data file's from and to client pc.
These data file's have an exact size.(you can use seperate data file for txt and bin content)
Count the acctual time.
Calculate "time" "content" "size".
167 Kilobyte per second = 1336 Kilo bit per second .. then comes some overhead, and possibly some compression included, so that does not sound to far off for a T1, if it is somewhat slower its likely the route inbetween and/or the webserver/noc activity/connection/burst-allowance etc..
I have never done any bandwidth testing code, but I would question how easy it is to do just from PHP or any webserver scripting language may be tricky, as all output will often be buffered and thrown out in a chunk, and even if you turn buffering off I assume that the webserver or networking layers has mechanisms that will allow the script to end before the transfer was actually finished..
not to mentiont hat there's stuff done on his lan. in a t1 you will never reach max speed becasue the network people have things set to be checked for your safety, not to mention however many you are sharing it with. between all that 167Kb/sec is good
same way they did it in asp i imagine. they send a few files and time it and then calculate on the round trip.
just remember that there's always overhead.
even though a 56k modem CAN transfer up to 56k, upstream has a 33.3 limit (federal setting) and when you take into account what will always be there, a reasonable maximum is 30k/sec. add in other traffic and you're looking at 20k/sec or lower as an expected average
if you want to know more and live near boston, harvard has a great course on it: Communication Protocols and Internet Architecture
i'm sure other schools have similar courses. look at the write up to that at http://www.harvard.edu and find something comparable at a college near you if you really wanna understand.
… Harvard would never accept me… (Unfortunately) … even if I really want to study some courses there…
Now back to PHP and now asp, as far as I remembered PHP could force user to download file but the I need to get the statistic ( I’m not sute thet PHP is generating this statistics for uploads, so we will then download same file from user [ 50k for example]. Well we don’t want to do so many jobs for user so we want to up load file automatically… And how can I do that?
And I just came up with another Idea! --- Macromedia Flash 5 or MX, client side action script, all preloders are showing real speed (at least I think so…) but how can I transmit data from *.swf to *.PHP
if you do like me and go summer school i don't think they'll care about anything but if you can pay the $$ for the tuition.
i wanted to lighten the workload for my sr year, so summer after jr year i took courses via harvard's summer school since i wanted to know a bit more about the nitty gritty since all the brandeis courses are programming THEORY. i wanted something that's not theory....so i took some courses at harvard