A non-typical challenge in Web development

An exprience in troubleshooting problems caused by access speed gaps

This is about my exprience as a Web developer in 2014. I call it non-typical because we don't often have to troubleshoot the problems in Web applications constrained by access speed gaps in different countries or continents.

It was when I worked remotely for Unetizen last year. We were working on a knowledge-sharing network project. The main target users are in China, Canada and US.

The problem was that the development team in Hefei, China was not able to access the project built on cloud hosts in Singapore and New York. The main host is in Singapore, since it is the good location between China and North America.

It took on average 1 minute for the Chinese team to load the front page entirely. Sometimes it took less, sometimes the page would just fail to load entirely. We mainly targeted Chrome and Firefox at that time, but the team in China reported that they had tested on both browers but was impossible to access in a resonable timeframe.

We, the developers back in Canada and US, didn't know the cause. For us, loading this project to a browser was much faster, usually within 10-30 seconds for the whole page. By that time, we hadn't done optimizations for browsers.

Test One:

To find out the cause, I first conducted some tests of the ping time from the Chinese team to the host IPs with the help from a Chinese colleague. It turned out the ping time was much longer compared to that from my computer in Montreal to the host IPs.

Test Two:

Then, we tested the ping time from other locations in China. The result is that some locations, for example, from another company in Shanghai, have much shorter ping time.

Possible Solution One:

We asked if it's possible to upgrade the company network of our Chinese team. This meant quite an big investment and it could take a long time.

Possible Solution Two:

As I said above, the entry host of the project is in Singapore. What if we put the entry host in China, or what if we direct Chinese users to the Chinese host, and American users to a New York host? This problem would become more complicated if we tried this solution since the ping time from North America to our other host in Beijing isn't so good either.

Test Three:

Then I analysed the loading time of our project with Chrome in my computer. I found some libraries that we have put on our cdn server in Singapore, such as jQuery, bootstrap, backbone,etc. , esp. jQuery, took tens of seconds to load, which took quite a proportion in the entire loading time. Since our Web project relied heavily on jQuery, this could contribute a lot to the delay. I put such cdn libraries on our Beijing host, and asked my Chinese colleague to test the loading time again. He told me the loading this time turned out to be quite smooth!

I thought I have found the cause: first of all, we should put cdn libs on faster hosts. Later we deployed cdn libs on both the Beijing host and the New York host: for Chinese visits, cdn libs in Beijing will be used; otherwise, cdn libs in New York is used. This challenge as I remembered, was interesting and meaningful.