views:

1414

answers:

5

When people download files from my website, I don't want them to be able to download faster than 300KB/sec per file.

Is there anyway to do this? I'm running IIS 6.0 on Windows Server 2003.

A: 

Reduce the speed of you Internet connection.

Horcrux7
A: 

Write a script that transfer the data in chunks. After 300KB you wait until 1 seconds is consumed.

Horcrux7
That doesn't really throttle the bandwidth. The 300KB chunk will still download at the fastest rate possible. If You multiply that by X users, even with a 1s delay between chunks it isn't going to have the desired effect.
Kev
How I understand the question this should limit per user. If I send only 300KB per seconds then in middle there will be only 300KB transfer rate for this user.
Horcrux7
No what you have is a burst of data at the max available bandwith then a delay then another burst of data at max speed again. This isn't really bandwidth throttling.
Kev
+2  A: 

You can't limit download speed but you can limit the overall traffic to a particular website:

  1. Open IIS MMC
  2. Select Website
  3. Select Performance tab
  4. Enable 'Bandwidth throttling'

HTH, Kev

Kev
A: 

I agree with Horcrux (cant vote it as dont have enough rep)

if the file is less than 300KB, then this wont work, but for large files, then adverage over the course of the whole file download will be 300Kbps...

I'm assuming the idea is like a rapidshare idea, premium users will have full speed downloads?

Also, while one thread(user) is waiting for a second, another thread can be downloading.

Queue the downloads, and only let X amount run at the same time, and your away in a hack!

Overflow
A: 

Within website properties in IIS 6.0 there is a Performance tab and the first setting is Bandwith throttling which allows you to set the maximum bandwidth value in kilobytes per second. It also has this note;

For bandwidth throttling to function, IIS needs to install Windows Packet Scheduler.

I'm guessing using this setting would mean having your downloads on a separate site so you can throttle that but maintain full bandwidth to your normal content.

Dave Anderson