Tuesday, August 30, 2016

Limiting Internet Speed On Mobile Device (Bandwidth Throttling): Using Charles


If you have been through Mobile Apps development or testing, you should know the importance of testing the app in varying network conditions specially the weak network conditions. We need to ascertain the proper functioning of our apps when the bandwidth is very low or when there is no connectivity at all. Remember robust apps do not break down due to speed issues.
Using Charles, we can downgrade/limit the internet speed and simulate various low network conditions to effectively test our app. Slowing down of internet speed is called Bandwidth Throttling.
Let’s see how to do this. For this exercise we will use Android device, process/concept on iOS devices is almost the same.
Setting up a proxy in the mobile device is the first step, lets configure it first.

Configuring Proxy On The Mobile Device:

Prerequisite:

  1. Mobile device and a system (desktop/laptop) connected to the same WiFi.
  2. Keep the IP address of the system handy, you will need it while configuring proxy.
  3. Charles (Free only in trial period, else it is paid)

Steps:

       1.Open the WiFi connections page on your Android device. 












     2. Long press on the connected WiFi name.
     3. Navigate to the "Manage network settings" page.

     4. In the Proxy drop down select “Manual”
     5. In the "proxy Hostname" field type the IP address of your system which will act as a proxy
     6. In the "Proxy port" field type “8888”            













      7. SAVE the connection

Your proxy is all set. Launch Charles on your system, all the mobile traffic would now be routed via Charles.

Next step in the process is to throttle the internet speed on your device. This can be achieved by controlling the internet speed on your system, eventually your mobile device would be using the internet of your system so controlling/limiting the speed on your system will directly limit the internet speed on your device.

Setting Up Charles

Steps:

  1. Open Charles, Click on Proxy option in the title bar at the top.






     2. Select the option “Throttle Settings…”











     3. In the window that opens, select the checkbox “Enable Throttling”
        4. In the Bandwidth field select the Download and Upload speed you want.
     5. The speed you specify is in kbps so enter accordingly. 

For e.g to get a download speed of 1 Mbps enter 1000 in Download field and to get an upload speed of 2 Mbps enter 2000 in the Upload field.














6. Select the value in Utilization field as per your need, it simply means how much speed will be utilized out of what you have specified in the Upload and Download fields. 
7. Keep it close to 80 or 90 percent to get the speed you have specified in the Upload and Download fields, keeping this value low means degrading the speed further for e.g. keeping this to 10 would really slow down your internet speed.
8. Leave other fields as is unless you really want to change them.
9. Click OK

Hola!!!! you are all set. Try opening any webpage or any app on your device and you will get the internet speed that you have mentioned in the Charles settings.
      

Other Pointers

  1. The “Throttle Preset” field simulates some of the internet connection types. For e.g. selecting 3G would simulate a 3G connection.
  2. Reliability and Stability is used to simulate the reliability and stability of the connection. This is used to simulate connections that have frequent drops.
  3. Last but not the least after you are done with the settings in Charles just test it by opening www.speedtest.net or http://beta.speedtest.net/ on your system and check if you are getting a speed close to what you have desired. It may not be same but it would be close enough.

6 comments:

  1. Thank You, I was out of my working place for sometime. Will be working on some new posts shortly.

    ReplyDelete
  2. The bandwidth bottleneck often proves to be a tiresome issue. Thank you for such an effective article on how to deal with it. However, if anyone is looking to switch their internet service provider in Oman, Internet Packages they should look up AWASR.

    ReplyDelete
  3. Good Post. I like your blog. Thanks for Sharing
    WiFi Speed Test

    ReplyDelete
  4. Many thanks for providing this information.
    Wifi Speed test
    Wifi Speed

    ReplyDelete