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

136 questions
211
votes
12 answers

Simulate limited bandwidth from within Chrome?

Is there a way I can simulate various connection speeds from within Chrome? I need to be able to check http://localhost with varying speeds. I know there are standalone applications that can do this, but I'd rather do this inside Chrome.
48
votes
8 answers

Network throttling with chrome and selenium

Google Chrome 38 introduced the new "Device Mode & Mobile Emulation" functionality in devtools. In addition to choosing a device for emulation, it is also possible to emulate different network conditions: Optimizing your site's performance under…
alecxe
  • 414,977
  • 106
  • 935
  • 1,083
41
votes
3 answers

Any way to throttle calls to a specific API in Chrome DevTools while leaving others unthrottled?

I have a single page application that communicates with a few different APIs, and I am hoping to throttle requests made to a specific one for testing. Is it possible to be domain specific with network throttling using Chrome DevTools? I know you can…
13
votes
1 answer

Chrome console api - change network throttling programmatically

Does the chrome developer console have an API to change the network throttle? I've been looking through the documentation and not come across anything yet, however is there perhaps an undocumented / dug deep somewhere feature?
Alex KeySmith
  • 15,289
  • 6
  • 63
  • 143
11
votes
1 answer

Throttling with urllib2

is it possible to easily cap the kbps when using urllib2? If it is, any code examples or resources you could direct me to would be greatly appreciated.
Evan Fosmark
  • 89,147
  • 33
  • 99
  • 116
11
votes
4 answers

Best practices of high-performance network applications

While testing out a UDP multicast server that I've written on Windows 7 Ultimate x64, I came across a most curious thing. Playing music with foobar2000 in the background significantly improved the server's transmission rate yet also incurred minor…
James Dunne
  • 3,437
  • 3
  • 20
  • 29
10
votes
2 answers

What is a separate flow in Linux fq_codel?

I'm setting up a proof of concept to throttle ingress traffic at terminal end (client): eth0 -> ifb0 -> htb -> filter by ip -> htb rate -> fq_codel+ecn I have 2 source ips for specific program I want to throttle. The program in question opens a…
Dima Tisnek
  • 9,367
  • 4
  • 48
  • 106
10
votes
2 answers

Bandwidth throttling using Twisted

I'm trying to set speed limits on downloading/uploading files and found that twisted provides twisted.protocols.policies.ThrottlingFactory to handle this job, but I can't get it right. I set readLimit and writeLimit, but file is still downloading on…
dan.ch
  • 101
  • 5
9
votes
2 answers

How to limit bandwith use when using HttpWebRequest?

How to limit bandwith use when using HttpWebRequest?
SuitUp
  • 2,972
  • 5
  • 25
  • 40
9
votes
2 answers

limiting the network bandwidth of a java process

Is there an efficient way to limit the bandwidth of a certain java process? I am familiar with solutions like trickle to limit bandwidth of a certain process on run time sudo trickle -s -d 1024 /path/to/app.sh But when dealing with java processes…
eran
  • 12,534
  • 28
  • 87
  • 133
8
votes
3 answers

JMS message size

I'm currently working on bandwidth limiting feature (don't ask me why, its not my decision) for application which use JMS (Spring framework JMS and Active MQ namely) to sending messages with payload between server and clients. I found lot of…
Sorceror
  • 4,575
  • 2
  • 18
  • 34
8
votes
3 answers

Using trickle with Git

I would like to throttle a simple git pull using trickle. This seems like it should be easy: trickle -d 100 git pull, but when git shows its bandwidth rate, it still hovers around 3.3 MiB/s for me, much greater than the supposed maximum of 1000…
cg505
  • 193
  • 1
  • 2
  • 9
7
votes
1 answer

Use tc to throttle Docker container's outgoing network bandwidth

I'm trying to do the bandwidth throttling to the Docker containers. To limit the downlink bandwidth, I can first find the veth interface of the container and use tc: tc qdisc add dev vethpair1 root tbf rate 1mbit latency 50ms burst 10000. If I want…
Wei-Tsung
  • 297
  • 3
  • 12
7
votes
2 answers

Limiting bandwidth of http get

I'm a beginner to golang. Is there any way to limit golang's http.Get() bandwidth usage? I found this: http://godoc.org/code.google.com/p/mxk/go1/flowcontrol, but I'm not sure how to piece the two together. How would I get access to the http…
John
  • 2,607
  • 6
  • 29
  • 63
7
votes
1 answer

How can can I throttle bandwidth on an application domain level in Windows (in user mode)?

I would like to make the following happen: My application runs on a Windows machine (call it application A). I can modify the source code of application A to introduce bandwidth throttling. I would like to be able to reuse my bandwidth throttling…
Alexandru
  • 10,808
  • 12
  • 98
  • 183
1
2 3
9 10