Simulating Slow Internet Connection

前端 未结 16 1576
深忆病人
深忆病人 2020-11-27 09:30

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 th

相关标签:
16条回答
  • 2020-11-27 10:02

    On Linux machines u can use wondershaper

    apt-get install wondershaper
    
    $ sudo wondershaper {interface} {down} {up}
    

    the {down} and {up} are bandwidth in kpbs

    So for example if you want to limit the bandwidth of interface eth1 to 256kbps uplink and 128kbps downlink,

    $ sudo wondershaper eth1 256 128
    

    To clear the limit,

    $ sudo wondershaper clear eth1 
    
    0 讨论(0)
  • 2020-11-27 10:02

    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.

    0 讨论(0)
  • 2020-11-27 10:04

    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.

    0 讨论(0)
  • 2020-11-27 10:04

    Starting with Chrome 38 you can do this without any plugins. Just click inspect element (or F12 hotkey), then click on "toggle device mod"enter image description here and you will see something like this:

    enter image description here

    Among many other features it allows you to simulate specific internet connection (3G, GPRS)

    P.S. for people who try to limit the upload speed. Sadly at the current time it is not possible.

    P.S.2 now you do not need to toggle anything. Throttling panel is available right from the network panel.

    Note that while clicking on the No throttling you can create your custom throttling options.

    0 讨论(0)
  • 2020-11-27 10:05

    You can try Dummynet, it can simulates queue and bandwidth limitations, delays, packet losses, and multipath effects

    0 讨论(0)
  • You can use NetEm (Network Emulation) as a proxy server to emulate many network characteristics (speed, delay, packet loss, etc.). It controls the networking using iproute2 package and it's enabled in the kernel of the most Linux distributions.

    It is controlled by the tc command-line application (from the iproute2 package), but there are also some web interface GUIs for NetEm, for example PHPnetemGUI2.

    The advantage is that, as I wrote, it can emulate not only different network speeds but also, for example, the packet loss, duplication and/or corruption, random or defined delay, etc., so you can emulate various poorly performing networks.

    For your application it's absolutely transparent, you can configure the operating system to use the NetEm proxy server, so all connections from that machine will go trough NetEm. Or you can configure only your application to use it as a proxy.

    I have been using it to test the performance of an Android app on various emulated poor-performance networks.

    0 讨论(0)
提交回复
热议问题