Simulating Slow Internet Connection

2020-01-24 18:32发布

I know this is kind of an odd question. Since I usually develop applications based on the "assumption" that all users have a slow internet connection. But, does anybody think that there is a way to programmatically simulate a slow internet connection, so I can "see" how an application performs under various "connection speeds"?

I'm not worried about which language is used. And I'm not looking for code samples or anything, just interested in the logic behind it.

15条回答
三岁会撩人
2楼-- · 2020-01-24 19:07

There are TCP proxies out there, like iprelay and Sloppy, that do bandwidth shaping to simulate slow connections. You can also do bandwidth shaping and simulate packet loss using IP filtering tools like ipfw and iptables.

查看更多
SAY GOODBYE
3楼-- · 2020-01-24 19:13

If you're running windows, fiddler is a great tool. It has a setting to simulate modem speed, and for someone who wants more control has a plugin to add latency to each request.

I prefer using a tool like this to putting latency code in my application as it is a much more realistic simulation, as well as not making me design or code the actual bits. The best code is code I don't have to write.

ADDED: This article at Pavel Donchev's blog on Software Technologies shows how to create custom simulated speeds: Limiting your Internet connection speed with Fiddler.

查看更多
Luminary・发光体
4楼-- · 2020-01-24 19:13

Updating this (9 years after it was asked) as the answer I was looking for wasn't mentioned:

Firefox also has presets for throttling connection speeds. Find them in the Network Monitor tab of the developer tools. Default is 'No throttling'.

Slowest is GPRS (Download speed: 50 Kbps, Upload speed: 20 Kbps, Minimum latency (ms): 500), ranging through 'good' and 'regular' 2G, 3G and 4G to DSL and WiFi (Download speed: 30Mbps, Upload speed: 15Mbps, Minimum latency (ms): 2).

More in the Dev Tools docs.

查看更多
Ridiculous、
5楼-- · 2020-01-24 19:14
成全新的幸福
6楼-- · 2020-01-24 19:14

Use a web debugging proxy with throttling features, like Charles or Fiddler.

You'll find them useful web development in general. The major difference is that Charles is shareware, whereas Fiddler is free.

查看更多
smile是对你的礼貌
7楼-- · 2020-01-24 19:16

I was using http://www.netlimiter.com/ and it works very well. Not only limit speed for single processes but also shows actual transfer rates.

查看更多
登录 后发表回答