Questions tagged [bandwidth-throttling]

Bandwidth throttling is the intentional slowing of the speed at which data is sent from the server to a client. In web programming, it is used to lower the chances of a DDOS attack, by the website/app releasing data in a limited speed.

In web programming, Bandwidth throttling is used to intentionally lower the rate at which data is served to the client. It is considered one of the important methods to lower chances of failure of a site from a DDOS attack.

It can also be used to ensure that all users are accessing enough resources by limiting greedy users who may be using lots of connections and downloading lots of data whereby other users are suffering from slower connections.

Php Example

set_time_limit(0);
$file = array();
$file['name'] = "file.mp4";
$file['size'] = filesize($file['name']);
header("Content-Type: application/octet-stream");
header("Content-Description: file transfer");
header('Content-Disposition: attachment; filename="' . $file['name'] . '"');
header('Content-Length: '. $file['size']);
$open = fopen($file['name'], "rb");
while(!feof($open))
    {
    echo fread($open, 256);
    usleep(500);
    }

fclose($open);

In the above example, a download manager(which opens lots of connections) think that server is unresponsive and hence close all connections

Links

Bandwidth throttling

Work arounds for Bandwidth throttling

135 questions
4
votes
2 answers

mp3 bandwidth throttle using htaccess and php

I'm being destroyed by robots and malicious users trying to take down my site. I tried making a bandwidth limiter by mod_rewriting all requests for mp3 files to a php script which would track each ip and limit how much each can download per hour.…
4
votes
1 answer

How can I split a single direct ftp download into simultaneous multiple parts?

Is there any way, commonly known or purely theoretical, to have a single link to a single file -- say, a typical download file on your regular browser -- but split the transfer itself into multiple parts from the client side? Essentially, I want to…
3
votes
0 answers

How can I limit my flutter application's bandwidth

I'm using a youtube video player in my app and I cannot adjust the quality of the video, it automatically adjusts to the internet speed. I don't want to my app to consume mobile data, so want to limit the app's bandwidth based on the video quality…
3
votes
2 answers

How to enable TCP BBR on Windows?

TCP BBR can be enabled in linux using the following commands: net.core.default_qdisc=fq net.ipv4.tcp_congestion_control=bbr as explained here How do you do the same on a Windows 10 machine?
VarunVk
  • 109
  • 2
  • 6
3
votes
2 answers

Testing Network Throttling using chrome dev-tools for an android app does not work

Goal: Test android app on a physical device with various network connectivity issues (Offline, Slow 3G etc). Android Emulator is not an option for my use case. Steps I have tried: (Remote Debugging) Connect my phone to my computer and open the app…
3
votes
2 answers

Laravel Limit Client Download Speed (Bandwidth throttling)

In Laravel, I can download using response()->download(); But is there any way to limit client speed?
3
votes
1 answer

Charles Proxy 100% throttling

I'm using Charles (4.0.2) as a proxy server to test my mobile app, which relies on WebSockets inside of a WKWebView. I am trying to simulate a situation in which a user briefly experiences no packet movement on their internet connection (about 5…
AlexZ
  • 11,515
  • 3
  • 28
  • 42
3
votes
1 answer

How to throttle bandwidth for OverGrive in Linux (Debian)?

I've installed trickle but can't seem to get it to throttle overGrive. $ trickle -d 500 -u 100 overgrive trickle: Could not reach trickled, working independently: No such file or directory trickle: exec(): No such file or directory Is there another…
General Chad
  • 455
  • 1
  • 5
  • 17
3
votes
2 answers

Trickle Fails to Shape My Python Script's Upload Bandwidth

I have a very simple Python script -- flickr.py -- that uploads a file to Flickr. It looks like this: #!/usr/bin/python import sys import os.path import flickr_api KEY = '' SECRET = '' filename = sys.argv[1] basename =…
hanksims
  • 1,479
  • 2
  • 12
  • 22
3
votes
1 answer

Determine available upload/download bandwidth

I have an application which does file upload and download. I also am able to limit upload/download speed to a desired level (CONFIGURABLE), so that my application does not consume the whole available bandwidth. I am able to achieve this using the…
Sandeep
  • 1,237
  • 1
  • 14
  • 29
3
votes
3 answers

Simulate slow speed for TCP sockets in Windows

I'm building an application that uses TCP sockets to communicate. I want to test how it behaves under slow-speed conditions. There are similar question on the site, but as I understand it, they deal with HTTP traffic, or are about Linux. My traffic…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
3
votes
0 answers

Limiting Network Bandwidth Programmatically using C#

I'm developing an application in C# to find Number of users accessing my router (This part is Done) Now for the no.of users i need to split the total n/w bandwidth among each users locally such that UserBandwidth = (OverallAllBandWidth /…
2
votes
2 answers

How can I add a download speed limit to this php script?

I found this great script to download and protect the files from a directory: http://www.gowondesigns.com/?page.getfile And I saw this code from a website too: // local file that should be send to the client $local_file = 'test-file.zip'; //…
2
votes
2 answers

Prioritizing Erlang nodes

Assuming I have a cluster of n Erlang nodes, some of which may be on my LAN, while others may be connected using a WAN (that is, via the Internet), what are suitable mechanisms to cater for a) different bandwidth availability/behavior (for example,…
none
  • 5,701
  • 28
  • 32
2
votes
0 answers

HTML 5 : Bandwith throttling when uploading a file

I've read that we have a nice solution to upload files and get progress bar in HTML5, but I'm wondering if there is a way to manage throughput and limit bandwidth consumption with the same technology (just to get rid of Flash or Silver-whatever…
Yann
  • 135
  • 9
1 2
3
8 9