RegisterRegister    SearchSearch   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AJAX upload progress bar

File sharing script

File mirror script

Newsletter script
my download is limited

 
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XFileSharing Free
View previous topic :: View next topic  
Author Message
crazyboy



Joined: 06 Sep 2008
Posts: 1

PostPosted: Sep 07, 2008 11:37 am    Post subject: my download is limited Reply with quote

After i installed the script my download was limited by the script.. when i pus a file to download without script i download with 11 mb/sec but when i upload a file with the script my download is limited at 600 kb/sec
Back to top
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 2109
Location: UFO Lab

PostPosted: Sep 08, 2008 6:50 am    Post subject: Reply with quote

Check your CPU/RAM usage while uploading.
Back to top
View user's profile Send private message Visit poster's website
PilgrimX182



Joined: 22 Mar 2006
Posts: 2109
Location: UFO Lab

PostPosted: Sep 08, 2008 7:10 am    Post subject: Reply with quote

Also try this quick hack: in upload.cgi replace subfunction "sub hook {...}"
with new one:
Code:
sub hook
{
  my ($fname, $buffer) = @_;
 
  my $buff_size = length($buffer);
  $current_bytes+=$buff_size;
  $time = time;
  $time_spent = $time - $time_start;
  my ($changed,$nf);
  if($fname_old ne $fname || $buff_old<$buff_size)
  {
     $files_uploaded++ if $fname_old;
     $fname_old=$fname;
     my $fsize = $current_bytes-$total_old;
     $total_old=$current_bytes;
     $nf = "file_uploaded:$files_uploaded:$fsize\n";
  }
  $buff_old = $buff_size;

  if($time>$old_time)
  {
     $speed = int( ($current_bytes-$old_size)/($time-$old_time) );
     $old_size = $current_bytes;
     $old_time = $time;
     $changed=1;
  }

  if($changed || $nf)
  {
     open F,"$temp_dir/flength";
     my @arr = <F>;
     close F;
   
     $arr[0] = "$ENV{CONTENT_LENGTH}:$current_bytes:$time_spent:$speed:$files_uploaded\n";
     push(@arr, $nf) if $nf;
   
     open F,"+< $temp_dir/flength" or die"Can't open flength";
     flock F, LOCK_EX or die"Can't lock flength";
     truncate F, 0;
     print F @arr;
     close F;
  }
}
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XFileSharing Free All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group