Is there a way to limit download bandwidth (or download speed) for my web site in Windows Server 2008?
I do not want any limitations for viewing my web site and loading pages, just for downloads.
Sometimes I get 503 errors because of downloads and number of users, which I would like to prevent.
One way to do it is to use a proxy server between your users and web server. A proxy server like squid uses
delay_pools
to limit the download speed from your server.The download limit can be applied to certain IPs and certain URLs. The appropriate acls should be defined to apply the limit only to the download URLs. The best scenario is to have all big downloads under a specific set of directories.
You can limit FTP bandwidth and number of connections in IIS but this will not cure your problem. IIS6 and IIS7 have different ways of doing this but if you search for 'bandwidth throttling' or 'bit rate throttling' you'll find loads of info.
If you're not using IIS then the solution will depend on the web server. For finer grained throttling you will need an external box between your server and the internet. Many firewalls do this reasonably well... the more you pay the better they get.
If you have X bandwidth then you need to make a decision on how you are going to limit your download bandwidth so that you will leave enough for your http users but not cut ftp connections. If you have, say, 100Mb of bandwidth and 1000 people ftp'ing files at once then limiting downloads to 50mb/sec and allowing unlimited downloads will mean people are downloading at approx (50*1000*1000)/1000 = 50kbs. (About 5-6KB/sec). You need to do the approx math to work out how you can limit things.