vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Restricting Download speed on attachements. (https://vborg.vbsupport.ru/showthread.php?t=60114)

cirisme 01-12-2004 09:05 PM

Quote:

Originally Posted by Milhouse
That's what i assumed as well.

Which is not good for me. i need ti to essentially effect all attachements.

Any ideas from the gurus here?

Try finding this:

PHP Code:

echo $attachmentinfo[filedata]; 

and changing to:

PHP Code:

// UploadBandwithLimitHack 
 // Original line: echo $attachmentinfo['filedata']; 
 
$bandwidth 30// Desired max. bandwidth in KB/s. 
 
$i 0
 while (
$i strlen($attachmentinfo['filedata'])) { 
   echo 
substr($attachmentinfo['filedata'], $i1024); 
   
$i += 1024
   
flush(); 
   
usleep(1000000/$bandwidth); 
 } 
 
// UploadBandwidthLimitHack 

This is essentially what was posted above, but for the filedata with vb2 itself :)

Milhouse 01-12-2004 09:30 PM

I did that. All it did was make the download take longer to start, but once it started ti downloaded at the top speed it could and not the 30k i had set.

Zachery 01-12-2004 09:31 PM

Quote:

Originally Posted by cirisme
Try finding this:

PHP Code:

echo $attachmentinfo[filedata]; 

and changing to:

PHP Code:

// UploadBandwithLimitHack 
 // Original line: echo $attachmentinfo['filedata']; 
 
$bandwidth 30// Desired max. bandwidth in KB/s. 
 
$i 0
 while (
$i strlen($attachmentinfo['filedata'])) { 
   echo 
substr($attachmentinfo['filedata'], $i1024); 
   
$i += 1024
   
flush(); 
   
usleep(1000000/$bandwidth); 
 } 
 
// UploadBandwidthLimitHack 

This is essentially what was posted above, but for the filedata with vb2 itself :)

whats the point? this would force users to WAIT longer to download an image or a file, why not let them get it asap ..?

Milhouse 01-12-2004 10:03 PM

Quote:

Originally Posted by Faranth
whats the point? this would force users to WAIT longer to download an image or a file, why not let them get it asap ..?

That is exaclty what i experience when downloading. I no want them to wait longer I just want to slow the speed at which they get it at.

Most users have a 100k/s line or higher... I want them to only be able to download my attachements at like 40k or so. Simply because we have files of 5+ megs..

when we have 100 users downloading those files at 100+k/s you can imagine what hapepsn to our line.

Zachery 01-12-2004 11:07 PM

Quote:

Originally Posted by Milhouse
That is exaclty what i experience when downloading. I no want them to wait longer I just want to slow the speed at which they get it at.

Most users have a 100k/s line or higher... I want them to only be able to download my attachements at like 40k or so. Simply because we have files of 5+ megs..

when we have 100 users downloading those files at 100+k/s you can imagine what hapepsn to our line.

if anything slowing them down would put more stress on your line, a burst at 400kbps would get that file finished much faster

Milhouse 01-12-2004 11:19 PM

Quote:

Originally Posted by Faranth
if anything slowing them down would put more stress on your line, a burst at 400kbps would get that file finished much faster


Problem is we are getting bursts as high as 1400kbps and the datacenter is wanting more money.

Specially when these bursts are at times consecutive for like 30 minutes.

Also because of the high bursts at time the site it self becomes rather slow. While server loads at a minimum. What is happenign is some users are using up all the of the line downloading and leaving nothing or barely nothing for users who are just surfing. causing the site to drag.

If i could cap the downloads then it would be equal to all.

I have manage to get server side files to download at 40k/s if bigger then 1 meg, however that does not effect mysql attachements.

Any help would really be appricated.

Milhouse 01-13-2004 02:18 AM

Is this not possible? Such hack?

Zachery 01-13-2004 02:27 AM

Quote:

Originally Posted by Milhouse
Is this not possible? Such hack?

please wait more than 4 hours to bump a post,

maybe its time to find a differnt host with a bigger pipe. >.<

Milhouse 01-13-2004 03:42 AM

Quote:

Originally Posted by Faranth
please wait more than 4 hours to bump a post,

maybe its time to find a differnt host with a bigger pipe. >.<


Sorry about that.

cirisme 01-13-2004 04:38 PM

Quote:

Originally Posted by Milhouse
I did that. All it did was make the download take longer to start, but once it started ti downloaded at the top speed it could and not the 30k i had set.

It won't change download speed... but unlike the orginal, it will only give the download in sections at a time.

The original would only do this with the header which is why it took longer to start.

At least check the code to see it's different :rolleyes:


All times are GMT. The time now is 11:16 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01077 seconds
  • Memory Usage 1,756KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete