measure speed from server?

hello all -

can anybody think of a way for a server to determine the internet speed for an individual connection?

i know i can visit speedtest.net from the clients side, but i was wondering if there is some slick way to do this when somebody first tries to pull up one of my webpages.

in other words, say somebody makes a request for one of my webpages on my server. i would like some way to determine the line speed. i sure didn't see anything at all in HTTP_USER_AGENT.

or am i dreaming again?
 

Quags

Administrator
Staff member
You can use wget for download speeds:

wget http://mirror.trouble-free.net/latest_kernel_20
--2013-04-27 07:23:44-- http://mirror.trouble-free.net/latest_kernel_20
Resolving mirror.trouble-free.net... 66.45.230.130
Connecting to mirror.trouble-free.net|66.45.230.130|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 91415315 (87M) [application/octet-stream]
Saving to: "latest_kernel_20"

100%[======================================>] 91,415,315 10.9M/s in 8.1s

2013-04-27 07:23:52 (10.8 MB/s) - "latest_kernel_20" saved [91415315/91415315]

Here it is 10.9 M/s or about 87 mbps.
 
that works for the server at trouble-free.net, but lets say i wanted to determine the speed (and line quality) for every one of my customers.

for example right now i am at home in Arizona, and John Q is in New Jersey (i am assuming), it would be so cool to have a way to determine what my speed is, and what johns speed is, all from my server.

i should hope that there is something like HTTP_USER_AGENT that would tell me this.
 

Quags

Administrator
Staff member
Server side I am not certain of a way, and it may not be possible server/vps side, at least automatically. You would need to download/upload data between both points to get a known speed (like speedtest.net does)

It is not impossible, at least there are some CDN's I know in the past that used to try to measure speed by sometimes doing a traceroute to the connecting IP so on the network edge with the right hardware some places do something similar.
 
well thanks for trying, Q.

one would think (or assume) that type of information would be readily available with some obscure apache function.
 
Top