Possible Duplicate:
Calculating Connection/Download Speed
I put data on 3 servers for app usage. I want to users load data from the fastest server base on their network connection. So I need to test user's network connection speed to my server. Is there any way to test user network speed from iPhone?
Another method to check internet speed on your Apple iPhone is through a web browser like Safari. Step 1: Open a web browser app on your iPhone. Step 3: Tap ‘Run speed Test’. You can see the upload meter and download meter when the test is finished, your speed will be displayed on the screen.
It can be used to test the speed of internet connections and add your findings to SpeedSpot’s Wi-Fi speed database. You can use the company’s app, SpeedSpot’s Wi-Fi Finder, directly from the app to find the fastest Wi-Fi hotspots worldwide. It can check your downloads and upload speeds, as well as your ping, on cellular and Wi-Fi networks.
Before we begin with the third-party apps, you can also perform a speed test on the iPhone without an app using the Safari browser. Simply open the web browser, and go to speedtest.net. Now, the catch here is that Safari on iPhone does not support flash so if you select Ookla, you will be asked to download the app.
You can test the WiFi signal strength of your WiFi signal on iPhone. The WiFi finder apps can search and find out the free WiFi available in your local area that can utilize to surf the web for free. There are several WiFi scanner apps and WiFi network analyzer helping to check the network speed and range.
Finally, I found a solution and it works fine.
I put a small static file, for example https://www.google.com/images/icons/product/chrome-48.png, on every server, then download the file from every server and calculate time spent (Calculating Connection/Download Speed is a good way to calculate speed, thanks to @Antonio MG), then save the fastest server host with NSUserDefaults
. Before the app load data from server, replace request url host with the fastest host.
When app launched or applicationWillEnterForeground:
, perform the network speed test. Now, every time at app load data is using the fastest server that just calculated.
Hope this can help those who need it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With