Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When page loading is too slow in a Semarchy xDM application, bad performance could be related to :

  • SQL query processing time  ( see Enable Logging in Semarchy xDM for reference on how to track and capture long-running queries )
  • lack of horsepower and RAM on the application server ( check RAM and CPU usage on the host, verify connection pool sizing vs number of users, and tomcat memory settings )
  • slow network

This article will focus on the latter. 

Big files ?

When a semarchy form is loaded for the first time in the current session, the browser downloads a json file that describes the page layout. For complicated BoViews with multiple tabs and transitions, this json file could weigh 6 Mo or more. This can significantly increase page loading time if you have a low bandwidth and / or when the application server is far 

Then what ?

The tomcat application server (as most application servers) can compress some of the resources used in a HTML page before transferring them over the network. There's a slight processing overhead to compress the files, but it's definitely worth it if network bandwidth is the main bottleneck.

There's a lot of structural redundancy in the average json file, making it a very good candidate for compression (you can expect more than 95 % reduction in size).

Step-by-step guide


  1. Open the server.xml file with your favorite text editor (it's typically found in the tomcat_root/conf folder)
  2. Locate the <Connector> element
  3. Modify it  by adding three compression-related properties as follows

    Code Block
    	compression="on"
    	compressionMinSize="4096"
    	compressableMimeType="text/html,application/json"
    
    


  4. Restart your tomcat server
  5. Start developer tools in chrome, go to network tab, select the semRootEO file, and check the header to make sure the changes were applied : the content encoding should now be *gzip* 











Info
titleWarning
This is not a solution to all performance issues, and could be detrimental if you compress files that don't need to be compressed : watch your tresholds and don't compress javascript and image files

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@140ea
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("optimization","tomcat","performance") and type = "page" and space = "SKB"
labelstomcat optimization performance


Page Properties
hiddentrue


Related issues