Page 1 of 1

Help With Bandwidth Script

Posted: Thu Jul 06, 2006 3:10 pm
by dsjohnson
I am trying to write a script that orders a given list of servers in order of most bandwidth free (in kb/s or mb/s) then tells the downloading client to try to connect to the servers in that order. This is to try to maximize the download speed for those using the website. However, I do not know what php function (if there even is one?) that I can use that will return the amount of bandwidth a remote server has free/in use.
As of now, all I have is primitive direct links to the servers, so what usually ends up happeneing is server 1 gets overwhelmed while server 3 sits idle, so I am trying to fix that problem. Thanks in advance for any help.

Posted: Wed Jul 12, 2006 12:30 am
by Benjamin
You might be able to write a shell script that the php script can call for bandwidth usage, but it would probably be more practical just to setup a round robin.

Posted: Wed Jul 12, 2006 12:53 am
by Todd_Z
The simplest way to solve this, if the first link is always the one that is getting clicked on, is to randomize the order of the links.

Posted: Wed Jul 12, 2006 1:27 am
by jamiel
You will probably need to combine PHP with a technology such as SNMP to get the data you are looking for.