This discussion is archived
4 Replies Latest reply: Jan 18, 2013 4:30 AM by RideTheStorm RSS

Issues when loading pages

RideTheStorm Newbie
Currently Being Moderated
Hi all,

I'm experiencing some performance issues when loading a page for the first time. The problem is caused when updating a css file of my own custom theme. When I access a page of the application for the first time, this produces a 404 error but the file truly exists. If I update the page via F5 or I access a different page it loads correctly with times more than acceptable. In contrast, if I update the page via Ctrl+F5 (to clear cache) the same issue occurs.

I performed the same test with another test application with a default theme and working properly.

The configuration I have is Apex 4.1.1 in a Oracle 11.2 and Apex Listener 1.1.4 in a WebLogic server. The file i.war does not pack the images directory directly, this file contains a configuration file which defines a virtual directory, in this way I can modify files on the fly without restarting the listener. If I get this problem and restart the listener everything works right. The configuration file is:

+<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">+
+<!-- This element specifies the context path the static resources are served from -->+
+<context-root>/i</context-root>+
+<virtual-directory-mapping>+
+<!-- This element specifies the location on disk where the static resources are located -->+
+<local-path>/mnt/fs_servicios/apex/datos/usuarios/apex/applications/apex/images</local-path>+
+<url-pattern>*</url-pattern>+
+</virtual-directory-mapping>+
+</weblogic-web-app>+

What could be the cause of the problem?

Edited by: RideTheStorm on Jan 17, 2013 9:57 AM
  • 1. Re: Issues when loading pages
    Colm Divilly Journeyer
    Currently Being Moderated
    Listener plays no part in serving the content of i.war. So if the static resource is taking a long to be served it's a problem with WebLogic, the file system where the file is stored, or the resource itself.

    Try accessing the URL of the static resource directly by itself, entering it's URL in the browser and measure how long it takes to load versus when it's referenced in the APEX page.

    Use Firefox/Chrome developer tools to examine where the delay is occurring, is it slow to retrieve the resource, is it slow to process the .css file (maybe it's got a degenerate rule that the browser is struggling with). Is there a delay caused by some javascript logic that is taking time to complete.

    Ensure the file is stored on a local filesystem, not on a network filesystem.

    If it's taking a long time to refresh the APEX page that references the CSS, that implies that the page is configured with a long cache expiry. Check the response headers on the APEX page.
  • 2. Re: Issues when loading pages
    RideTheStorm Newbie
    Currently Being Moderated
    Hi Colm, thanks for your response. Well, the css file is correct, it is generated by lesscss compiler, that check the syntax and the output is a well formed css file. The files are locally in the server, at same directory that the apex listener is.

    See this first image, it contains the page request. After more than 30 seconds the css file load fails, but the size/content is 155.29KB/155.09KB. It's strange, it's like the file is not completely dispached. https://docs.google.com/file/d/0B9_PRyVKGP1pRmFWQkx4TzcyZVk/edit

    The second image contains the css file header. The status code is *200 OK*, but in the request tab there are not data. https://docs.google.com/file/d/0B9_PRyVKGP1pZVhBMGVsVDB2a2s/edit

    The last image contains the life time of the page, in which we can see that almost the entire file is loaded in 1s and the last request for this file occurs 30s later. https://docs.google.com/file/d/0B9_PRyVKGP1pOGo3UDlCVkZydTQ/edit
  • 3. Re: Issues when loading pages
    Colm Divilly Journeyer
    Currently Being Moderated
    Hmm, the first image shows the file size as being ~155KB, while the second shows the Content-Length as 165750, which is ~162KB. At this point I'm going to speculate, so you'll have to figure out a way to test this hypothesis.

    For whatever reason WLS is reporting the file size as 162KB, but in reality the file is only ~155KB in size. The browser then stalls waiting for the final 7KB to appear, and eventually gives up after 30 seconds when it does not. This is what is leading to the slow loading behaviour, I have seen browsers do this in the past when the content-length header was reporting a too large value.

    1. Check the size of the file on the file system.
    2. Restart WLS to see if that cures the problem (perhaps it has cached the file size of an earlier version of the file?)
  • 4. Re: Issues when loading pages
    RideTheStorm Newbie
    Currently Being Moderated
    In the weblogic log appears this entry:
    <Jan 17, 2013 10:06:36 AM CET> <Error> <HTTP> <BEA-101019> <[ServletContext@406840767[app:i module:i.war path:/i spec-version:null]] Servlet failed with IOException
    java.io.IOException: failed to read '199' bytes from InputStream; clen: -1 remaining: 199 count: 6743
            at weblogic.servlet.internal.ChunkOutput.writeStream(ChunkOutput.java:417)
            at weblogic.servlet.internal.ChunkOutputWrapper.writeStream(ChunkOutputWrapper.java:178)
            at weblogic.servlet.internal.ServletOutputStreamImpl.writeStream(ServletOutputStreamImpl.java:520)
            at weblogic.servlet.internal.ByteRangeHandler.write(ByteRangeHandler.java:103)
            at weblogic.servlet.internal.ByteRangeHandler$SingleByteRangeHandler.sendRangeData(ByteRangeHandler.java:407)
            Truncated. see log file for complete stacktrace
    
    I will talk with the people who manage the server to find a solution for this issue.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points