Help With Bandwidth Script

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!

Moderator: General Moderators

Post Reply
dsjohnson
Forum Newbie
Posts: 1
Joined: Thu Jul 06, 2006 2:59 pm

Help With Bandwidth Script

Post 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.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post 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.
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post 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.
jamiel
Forum Contributor
Posts: 276
Joined: Wed Feb 22, 2006 5:17 am
Location: London, United Kingdom

Post by jamiel »

You will probably need to combine PHP with a technology such as SNMP to get the data you are looking for.
Post Reply