Page 1 of 2

web pages take a very long time to load.

Posted: Sun Nov 27, 2016 9:57 am
by Lachlanp
I am using Netburner NANO54115 as a web server.
It takes an extrordinary long time to load we pages.
My web pages are only aeround 20kb but they take between 20 and 40 seconds to load.

I am calling other java script sources from the web page (such at jquery, hichcharts, and data files), but accoring to Chrome, these others only take tens of milliseconds. It is only the .htm files that take a long time to load.
Any suggestions on where i can look to determine the problem?

Regards
Lachlan

Re: web pages take a very long time to load.

Posted: Mon Nov 28, 2016 11:19 pm
by dciliske
Any chance you can tell me what version of the NNDK you're using, whether there's any dynamic content in the pages, and what browser sees this issue?

Re: web pages take a very long time to load.

Posted: Tue Nov 29, 2016 11:17 pm
by Lachlanp
I am using 2.7.3. I tried using the next version but when I installed it I had problems getting my projects to work.

I am using Google chrome and have long delays loading the htm files. There is dynamic content and other files to load, but according to chrome, these other activities only take ms whereas the main htm file takes 20 - 40 seconds.

You referred to other browsers, so I tired with Firefox and the load times were half but still in the order of 15-20 seconds. I also tried with Microsoft Edge and the load times were almost instantaneous.

Maybe you can highlight How i can get the Netburner to respond faster to Chrome and Firefox as most systems using my systems will me macs and Linux systems. I don't use Mac Safari as the web pages don't seem to load correctly.

I have attached the complete set of web pages and example data.

Regards
Lachlan

Re: web pages take a very long time to load.

Posted: Wed Nov 30, 2016 7:55 am
by pbreed
Dynamic content...

If you have a simple static web page (even a large one) does it load quickly?

Do you have netburner dynamic content in your web pages, ie any variables or function calls?

Have you look at the load with something like wireshark?

Is this over the local network or across the Internet?

Re: web pages take a very long time to load.

Posted: Wed Nov 30, 2016 9:04 am
by Lachlanp
I have dynamic content as the web page loads a number of configuration files or is some cases images.

If I use the chrome development tools, it highlights the time taken for each of the activities, and it indicates that the files that are requested by the web page take in the order of 10 - 20 ms to load.
I presume this is the same information that wireshark will provide . ie the duration of each specific activity within the web page.

I am only loading across a local area network using hard wired ethernet.

I haven't tried a simple web page but even if I assume it is fast, that does not help me solve the problem I have with the current web pages.

I have attached a capture of two web screens with the timing information provided by chrome web browser. The first image shows that it takes 25s to load the site.css file which is 18k long, and in the second web page picture it takes 17s to load a html file of 9k but images of 1mb only take 2s.

regards

Re: web pages take a very long time to load.

Posted: Wed Nov 30, 2016 9:32 am
by rnixon
I would try the standard debugging technique of starting with a minimal static web page, then add your advanced features one by one until you isolate the code that creates the problem. There are also may web example programs with the tools, load and run those to verify function calls, variables and any java stuff works correctly. That might help you pinpoint the spot in your custom app that is creating a difference in behavior.

Re: web pages take a very long time to load.

Posted: Wed Nov 30, 2016 10:22 am
by Lachlanp
I can try that.
The problem is that it is a slow process copying over web pages from a development tool like Aptana or Eclipse to the Netburner. Making a small change and copying it over to test takes time for each small change.
The problem does not occur on Aptana/Internal Server or Eclipse/Apache server as the web pages are super fast in in the development environment.

In an earlier iteration of the web pages I tried them on a Beaglebone Black running Linux and Apache web server and they seem to be super fast. I will try the same process with the current web pages to see if it is the Netburner or the Web code.

Thanks

Re: web pages take a very long time to load.

Posted: Wed Nov 30, 2016 11:00 am
by pbreed
Ok I'm confused....
>The problem is that it is a slow process copying over web pages from a development tool like Aptana or Eclipse to the Netburner.

Is the problem when the web pages go from the NetBurner to the browser,

or is the problem in getting them from your web page development tool onto the netburner....

What code are you running on the netburner?

Are the web pages compiled in, or are you using some kind of file system on the NetBurner to render pages...


Try to be as specific as possible about your setup and what is slow...


Paul

Re: web pages take a very long time to load.

Posted: Thu Dec 01, 2016 10:25 am
by dciliske
OK, quick questions: is it always the same resources that take a long time to load? Do they take about the same time every time? How large are the actual files being sent?

There was an issue fixed in 2.7.4 that is listed as "fixed truncation issue for static files >32kB". What I cannot recall is the direction that the problem was: i.e. whether it sent the modulus of the size and 32kB and terminated, or it only wrote the modulus length, and 'hung', waiting for the connection to complete.

-Dan

Re: web pages take a very long time to load.

Posted: Thu Dec 01, 2016 11:03 am
by Lachlanp
The 5 htm files and the css are between 8 and 50k in size. The data file that provides the dynamic content are typically around 8k in size. The jquery source file is 92k and the highcharts file is 131k.

It is typically the htm files that take the longest time to load. Different timing each time but always very long in the order of 20 - 50 seconds. Although once the css file took a long time to load. Th rest of teh files except the image files take around 20ms to load.

There is one page that loads four 1MB images but this does not take any longer than the pages that only load the 8k data files. The 1Mb image files take around 2s to load.

According to the chrome development tool it always seems to be the htm file that is slow. This is supported visually because nothing changes on the web page while the delay is happening

For example, on the web page that shows images, nothing of that web page appears for about 20-40 seconds, at which time chrome indicates its has received the htm file, and then the four 1MB images come reasonably fast which is supported by chrome showing they took around 2 seconds to load.

So overall it appears that the htm files are the bottleneck. They are written in jquery. I have tried loading jquery both locally from the Netburner and also online directly from source, but the jquery source file sees to come quite quickly

Note that the reference to the Jquery source file (written in javascript) is the first reference on the htm pages, and the htm file takes up to 50 seconds to load, then the jquery file only takes 20mS to load, which indicates that the rest of the script on the web page has not yet been interpreted.