|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
FTP Queue System
Has anyone been able to create a FTP file queue system similar to that of the one used on FilePlanet using MySQL & PHP or does anyone have any documentation on it?
Thanks in Advance, Michael Halvorsen |
|
#2
|
||||
|
||||
|
Why not describe to us what you are trying to do, rather than posting a URL and expecting us to figure it out for you?
__________________
Alex (http://www.alex-greg.com) |
|
#3
|
|||
|
|||
|
Sorry...
Basically, our site needs a download system to limit the number of downloads per FTP server. Our site gets over 2TB of data transfer right now... thats without the file servers up yet. We are trying to put a system together similar to FilePlanet's: We want to have a download system where you click a ftp mirror and a script using PHP & MySQL checks to see if there are any slots available in the particular FTP mirror they pick. If there are open slots, it allows them to download the file... if not, they are put in a queue. That queue needs to be updated every minute or so to ensure they get to download the file. We would like to also be able to display the FTP mirrors status (ie. number of slots free vs. number of slots total). I have yet to see any documentation on this process online. I have searched Google and have came up with no results. There are two sites that I know to exist that use this file system, Fileplanet.com & FileShack.com. FilePlanet uses ASP & I am unsure what FileShack uses. ASP is not an option due to the amount of bandwidth our site consumes on a monthy basis. Thanks in Advance, Michael Halvorsen |
|
#4
|
||||
|
||||
|
This seemed initially simple - however I figured out that PHP will need to know when a download has finished, so it can free up a slot on an FTP server. Otherwise it would have just been a simple matter of incrementing a counter for each FTP server when it was given a download, and sending FTP request to servers that were loaded the least.
Maybe you can pipe the logs from the FTP servers through a Perl script that will decrement a value in MySQL when a download on a certain server finishes? The best way to do this would be to make the FTP servers keep track of the number of downloads they are doing. Another idea - when a download request comes in, try and retrieve a 1byte file from each of the FTP servers. I think they return code 550 if they're too busy to accept the transfer request, so you can give the request to a server that isn't busy. Even better, have a Perl script check each server every minute or so and record their statuses in a database table that you can read with PHP. Alternatively, you could just have a hardware load balancer sitting in front of your FTP servers ![]() |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > FTP Queue System |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|