How will this affect server usage?

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
Winkles
Forum Newbie
Posts: 1
Joined: Tue Feb 05, 2008 2:46 pm

How will this affect server usage?

Post by Winkles »

I'm putting up a service that will host some large files, but that needs to hide the actual locations of the files. I found a script (http://www.zubrag.com/scripts/download.php) that will help with this. The crux of the script is that it pipes through the data from the file in the following manner.

Code: Select all

$file = @fopen($file_path,"rb");
if ($file) {
  while(!feof($file)) {
    print(fread($file, 1024*8));
    flush();
    if (connection_status()!=0) {
      @fclose($file);
      die();
    }
  }
  @fclose($file);
}
My question is, how will this type of activity affect my server usage allowances? I don't imagine that it will increase my bandwidth usage at all, but I worry that asking a script to handle all outgoing data might significantly increase my CPU usage and therefore get me in trouble with my host. Does anyone know if this is the case?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: How will this affect server usage?

Post by Christopher »

The script won't change your bandwidth allowances because it is downloading the same file. I doubt if will effect the CPU much because it is doing the same thing that the web server would be doing anyway.
(#10850)
Post Reply