Showing posts with label Performance Related. Show all posts
Showing posts with label Performance Related. Show all posts

Clearing All - portal dynacaches (DistributedMap) with one click


IBM Dyna Cache Monitor is best way to monitor the any dynacache instances (at WAS level). Most of the time when you access the portal page (with WCM portlet on it or not) portal generate entries in multiple cache objects ( i.e like user information goes into different cache object, portlet related goes into different, and portal page related stuff goes into different cache object..etc). 

During the development it may be very annoying to go to individual caches and clear those to make sure you are seeing proper(updated) content. (Note: Some of portal/wcm caches gets cleared automatically when you change but not all).

We can clear all caches with single click by injecting the below small piece of code into the Cache Monitor JSP (WebSphere\wp_profile\installedApps\sivapcCell\Dynamic Cache Monitor.ear\CacheMonitor.war\selectInstance.jsp)

    <form name="clearAll" method="get" action="selectInstance.jsp">
        <input type="hidden" name="clearAll" value="true">
        <input type="submit" value="Clear All" class="buttons">
    </form>
    <%
    if (request.getParameter("clearAll") != null
        && request.getParameter("clearAll").equals("true")) {
            out.println("<script> var msg = 'Clearing All caches....\\n';");
            Cache tempCache = null;
            String cacheName = "";
            java.util.ListIterator cacheIterator = configuredInstances.listIterator();
            while (cacheIterator.hasNext()) {
                cacheName = (String)cacheIterator.next();
                tempCache = CacheMonitor.getCache(cacheName);
                out.print("msg = msg + 'Clearing-Cache:::"+cacheName.toString() +"\\n';");
                System.out.println("Clearing-Cache:::"+cacheName.toString());
                tempCache.clear();
            }
            out.println("alert(msg);</script>");
    }
    %>  
    <br/>


Didn't want to make any fancy UI changes , so "Clear All" button looks like below



Once you click on , you will see javascript alert as below.

NOTE :
  1. It is not IBM recommended* way , just came up with this to make my development process simple. 
  2. No guarantees with future version of cache monitor implementations (Tested with latest cachemonitor available as of today, installed on Portal 8/7)

References

1. Visit below link for Download, Install & Update instructions for DynaCache Monitor.

GZIP Compression Issues - IE Developer Toolbar showing wrong Compression/Encoding Headers – IHS

As part of the portal performance tuning, have enabled the GZIP compression on IBM HTTP server by adding following lines httpd.conf and restarted the IHS.

LoadModule deflate_module modules/mod_deflate.so

#Enable GZIP Compression
DeflateFilterNote Input instream
DeflateFilterNote Output outstream

# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png|exe)$ no-gzip dont-vary

Mozilla is showing proper Content-Encoding response headers   but Internet explorer always returns response without compression headers when we monitor through IE Developer tool bar. 

After proper analysis realized that IE Developer toolbar is not showing the proper response header for the compression.To find out actual compression details , Add the following to httpd.conf  and restart the server

DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio

LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog /tmp/logs/siva_test_compression_log deflate

Following was logged to “siva_test_compression_log when we access from IE7
GET /wps/portal/ welcome/!ut/p/b1/04_Sj9CPykssy0xPLMnMz0vMAfGjzOINjA1cLZ0MHQ0MXP0cDTwDLEN9PNxCDAxcjIAKIpEV- 4/d5/L2dBISEvZ0FBIS9nQSEh/ HTTP/1.1" 16010/71089 (22%)
"GET /mccbuilder/css/portal_editmode_widgets.css HTTP/1.1" -/- (-%)
"GET /portal_dojo/v1.4.3/dijit/themes/tundra/tundra.css HTTP/1.1" -/- (-%)
"GET /wps/contenthandler/!ut/p/digest!T/dav/fs-type1/common-resources/ibm/css/common.css HTTP/1.1" -/- (-%)
"GET /portal_dojo/v1.4.3/com/ibm/widgets/css/widgets_combined.css HTTP/1.1" -/- (-%)
"GET /wps/contenthandler/!ut/p/digest! /res/SivaTheme/themes/html/SivaTheme/css/master.css HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/styles/layout.css HTTP/1.1" 1188/3524 (33%)
"GET /SivaTestTheme/styles/wcm/wcm.css HTTP/1.1" 1129/3836 (29%)
"GET /SivaTestTheme/styles/ie.css HTTP/1.1" 160/190 (84%)
"GET /SivaTestTheme/scripts/html5shiv.js HTTP/1.1" 1083/2050 (52%)
"GET /portal_dojo/v1.4.3/dojo/dojo.js HTTP/1.1" -/- (-%)
"GET /portal_dojo/v1.4.3/dojo/nls/dojo_en.js HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/themes/html/SivaTestTheme/js/asa_cmAggr.js HTTP/1.1" 2665/7534 (35%)
"GET /SivaTestTheme/themes/html/SivaTestTheme/js/custom.js HTTP/1.1" 1596/4931 (32%)
"GET /SivaTestTheme/images/theme/page-bkg.jpg HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/scripts/displayDate.js HTTP/1.1" 233/381 (61%)
"GET /SivaTestTheme/images/theme/bannerLeftLogo.png HTTP/1.1" -/- (-%)
"GET /portal_dojo/v1.4.3/dojo/resources/blank.gif HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/images/alert.png HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/styles/wcm/alert.css HTTP/1.1" 518/1527 (33%)
"GET /SivaTestTheme/images/theme/top-menu-seperator.jpg HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/images/theme/bannerRight.png HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/images/theme/tab-menu-bkg.jpg HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/images/theme/tab-menu-bkg-highlight.jpg HTTP/1.1" -/- (-%)
"GET /portal_dojo/v1.4.3/com/ibm/widgets/css/images/bwArrows.png HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/images/theme/tab-menu-bottom-bar.jpg HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/images/theme/content-bkg.jpg HTTP/1.1" -/- (-%)
"GET /wps/contenthandler/!ut/p/digest!TXuRWzXY7QQZLuFyFmUoKQ/dav/fs-type1/common-resources/ibm/css/portal/images/ButtonBackground.gif HTTP/1.1" -/- (-%)
"GET /wps/wcm/connect/e76fe831-d81b-4d3d-b383-cb028bc7ad03/CustomGlobe.png?MOD=AJPERES&CACHEID=e76fe831-d81b-4d3d-b383-cb028bc7ad03 HTTP/1.1" -/- (-%)
"GET /wps/wcm/connect/7384f79b-798b-4007-97ad-85c84ff82438/images+%289%29.jpg?MOD=AJPERES&CACHEID=7384f79b-798b-4007-97ad-85c84ff82438 HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/images/leftArrow.png HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/images/theme/footerLogoTrans.png HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/images/skin/sprite32.png HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/images/theme/footerGrad.jpg HTTP/1.1" -/- (-%)
"GET /wps/menu/menu_service.js HTTP/1.1" 3507/10925 (32%)
"GET /wps_semanticTag/javascript/semanticTagService.js HTTP/1.1" 45670/186100 (24%)
"GET /SivaTestTheme/themes/html/SivaTestTheme/js/nls/theme_en.js HTTP/1.1" 22490/81943 (27%)
"GET /SivaTestTheme/themes/html/SivaTestTheme/js/theme.js HTTP/1.1" 515299/2498285 (20%)
"GET /wps/contenthandler/%21ut/p/digest%21FWMinu5Of_321wJCNoFzLA/model/service-document HTTP/1.1" -/- (-%)
"GET /portal_dojo/v1.4.3/dojo/resources/iframe_history.html HTTP/1.1" 718/1299 (55%)
"GET /mccenabler/js/com/ibm/mm/iwidget/image/progress-anim.gif HTTP/1.1" -/- (-%)
"GET /wps/contenthandler/!ut/p/digest!FWMinu5Of_321wJCNoFzLA/res/SivaTestTheme/themes/html/SivaTestTheme/js/init.js HTTP/1.1" -/- (-%)
"GET /wps/contenthandler/!ut/p/digest!FWMinu5Of_321wJCNoFzLA/res/SivaTestTheme/themes/html/SivaTestTheme/images/favicon.ico HTTP/1.1" -/- (-%)
"GET /SivaTestTheme/skins/html/SivaTestSkin/js/skin.js HTTP/1.1" 1449/3880 (37%)
"GET /wps/contenthandler/!ut/p/digest!FWMinu5Of_321wJCNoFzLA/mashup/mashup:huffman/n0wypzQB/Z2F scopeZ3DpublicZ26ampZ3BvaryZ3DnoneZ22/aw7OKMEINga6xr-u8adr_OoaP9o3 HTTP/1.1" -/- (-%)
"GET /wps_semanticTag/ui/styles.css HTTP/1.1" 1295/5334 (24%)
"GET /portal_dojo/v1.4.3/dijit/themes/tundra/images/spriteArrows.png HTTP/1.1" -/- (-%)

Breadcrumbs Issue - When LiveTextSercice disabled - WP7

As part of the portal performance tuning on the environment , have disabled the live text service by removing or commenting following line from the nls/theme_en.html 

dojo.addOnLoad(function(){
com.ibm.pb.themes.commonInit({
setWindowTitle:true,
useNavigationController: true,
useRenderingController: true,
useDNDController: true,
//initLiveTextService: true,
lazyLoadModeWidgets: true,
navPrimingContainers: ["selectionPathPrimer","topNavLinks","navTabsRoot"],
customInit: com.ibm.themes.FluorTheme.init
});


But unfortunately this setting made breadcrumb widget  disappeared on the portal page but was not able to find solution expect enabling livetextservice back.

This is observed with PageBuilder theme with server side rendering enabled.

IBM Whole-system Analysis of Idle Time (WAIT)


Recently attended the demo of the IBM Whole System Analysis of Idle Time (WAIT) Performance monitor tool. 

WAIT is designed to be zero-install, it requires no monitoring agents installed on the application server and even you don’t need to restart the server. WAIT can help you pinpoint performance bottlenecks like waiting for database data, waiting on hot locks, or executing code  in a Java applications.

Following are three steps for using WAIT
  1. Collect the data from system using the datacollector scripts provided , This is like issuing a signal to a running JVM.
  2. Upload the generated data to WAIT service.
  3. View the report in your browser. 
Following links help find out more information regarding WAIT.