Anatomy of BI EE Page Rendering - Use of HTTP/Web Server & Compression
There are many aspects/variables thatcan affect the performance of a BI Deployment. Generally whenever a BI Dashboard is slow the general tendency is to attribute the slowness in performance to eitherthe BI Reports or underlying databases. Of course, in 90% of the cases this will be truebut there are cases where some other factors affect the page load times. In thisblog post, we will try to investigate the various other factors like browser cache,HTTP Server, HTTP Server compression etc. Also, we will try to understand whathappens from a communication standpoint between the browser and the Server. How much of network traffic gets passed, what is the optimal bandwidth etc.
To basically find out what happens at a protocol/network level we will be using the Firebug & YSlowNetwork Monitoring extension. There are other network monitoring and sniffing tools available todo this, but i prefer the Firebug/YSlow (& LiveHTTPHeaders) extension as it gives a graphical representation of each GET/POST request madealong with the times and size. Lets load up the extension and point it to the SampleAppLite Overview dashboard (directly using a URL without the HTTP Server enabled) from a browser that has its browser cache cleared completely.
To summarize, there are 3 things that we can notice
- BI EE just does not make a single HTTP call(obvious but a definite thing to keep in mind) to the Server from the browser
- With browser cache significant amount of data can be reduced from being passed on over the network
- BI EE - to render a single web page makes close to 300-400 HTTP requests to get almost 4MB of data
At a high level this is what happens
- Step 1: User enters a BI EE URL and hits on enter in the browser. A HTTP request is passed on to the server.
- Step 2: The server on receiving the request, does some internal processing(basically fires SQL to get the dataand then creates the HTML) and then formulates the response.
- Step 3: The browser will receive the response. The sample response is nothing but the source of the HTML output page.
- Step 4: Based on the first HTTP response it decides whether to use browser cache(if populated) or to make further http requests to the server
- Step 5: If the browser cache is enabled, only those images,css,js files that are not cached will generate the HTTP request. The HTTPrequests will be generated in parallel. The number of parallel requests depend on the browser.
- Step 6: HTTP request is generated for all other remaining files required for browser rendering. Modern browsers can start renderingthe page as and when the first HTTP response is received. Then after that once the individual images are retrieved, browsers can render them incrementally (hence we get an impression as though the pages are being painted especially on slow networkinstalls)
- Browser Cache once enabled can reduce the traffic significantly atleast for static images. This can reduce the numberof HTTP requests.
- BI EE transfers around 4 to 10 MB(or more) of traffic per page (not a single transfer - this happens in parallel in chunks).There is scope for compression.
- Browser Cache though very good still cannot cache every static file/resource. This is best done by a separate HTTP server. Also, the first time access of new users to a website will be slow if we depend on browser cache (until that warms up). So,HTTP Server ideally is the best way to cache static resources so that all end user static file response will
Having the Web Server and App Serveron the same box might not give that much of performance gains (though it still makes sense to isolate the main app server processfrom serving static resources - http server has to do that as it can serve in-memory as well).
So, lets try to take a look at the BI EE SampleAppLite Overview dashboard page through the Web Server URL (rather than the appserver port).
Now lets try to understand how the page load times relate to the network bandwidth. As we had seen earlier almost 4MB of data gets movedover the network for loading one page. Majority of it can be cached either at the http server layer or at the browser level. But still 4MBis a lot of data.
So, lets try adding a compression at the HTTP Server layer. The idea behind this is HTTP Server before sending the response will compress using gzip(that will be specified in the HTTP Header so that the client browser can uncompress). The client browser will then uncompress the packets using gzip again. To enable compression the following needs to be done on the httpd.conf file of the http server
- Ensure that the following lines are not commented out in the httpd.conf file.
LoadModule expires_module "${ORACLE_HOME}/ohs/modules/mod_expires.so
LoadModule deflate_module "${ORACLE_HOME}/ohs/modules/mod_deflate.so
- Add the following after the LoadModule section
HTTP Server Support:
As a footnote, if you are in the process of enabling HTTP Servers for your existing BI EE 11g installs, ensure that you are on theright patch sets of Oracle Web Tier. For example, BI EE 11.1.1.5 supports only 11.1.1.4 version of Oracle Web Tier. And 11.1.1.4version of Web Tier is not a direct install - instead one has to install 11.1.1.2 version and then upgrade that version to 11.1.1.4 using the patchset. But for BI EE 11.1.1.6, Oracle Web Tier 11.1.1.6 is supported (no Patchset for this).