Thursday, August 4, 2011

Dynacache - 101 !!!!

Dynacache service is an in-memory cache system that has disk offload capacity.
What is CacheSpec.xml?
The objects to be cached are specified in cachespec.xml.
Location of cachespec in toolkit\Stores\WebContent\WEB-INF
On server: \Stores.war\WEB-INF\
What can be cached? Servlet\JSP's and commands that extend from CacheableCommand interface can be cached using DynaCache.

What is DynaCache Monitor? This is an application provided by IBM for dynacache statistics, it can be installed on toolkit as well as server.

Example from cachespec for JSP\Servlet caching entries:
Servlet: .e.g. storecatalogdisplay:
<cache-id>
<component id="" type="pathinfo">
<required>true</required>
<value>/StoreCatalogDisplay</value>
</component>
<component id="storeId" type="parameter">
<value>10151</value>
<required>true</required>
</component>
<component id="catalogId" type="parameter">
<required>true</required>
</component>
<component id="langId" type="parameter">
<required>false</required>
</component>
<component id="trackingEvent" type="parameter">
<required>false</required>
</component>
<priority>30</priority>
</cache-id>


JSP: e.g. header.jsp
<cache-entry>
<class>servlet</class>
<name>ABCStorefront/include/header.jsp</name>
<property name="do-not-consume">true</property>
<property name="save-attributes">false</property>
<property name="ignore-get-post">true</property>
<sharing-policy>not-shared</sharing-policy>

<cache-id>
<component id="storeId" type="parameter">
<required>true</required>
</component>
<component id="catalogId" type="parameter">
<required>true</required>
</component>

<component id="DC_lang" type="attribute">
<required>false</required>
</component>
<component id="userImpersonated" type="parameter">
<required>false</required>
</component>
<priority>100</priority>
</cache-id>

<!-- Dependency Ids -->
<dependency-id>TTL:STAGEPROP</dependency-id>

<dependency-id>storeId
<component id="storeId" type="parameter">
<required>true</required>
</component>
</dependency-id>
<dependency-id>catalogId
<component id="catalogId" type="parameter">
<required>true</required>
</component>
</dependency-id>
<!-- Ends Dependency Ids -->
</cache-entry>


Enable Servlet caching:
1. In the administrative console, click Servers > Application servers > server_name > Web container settings > Web container in the console navigation tree.
2. Select Enable servlet caching under the Configuration tab.
3. Click Apply.
4. Restart the Server.

Performance and CPU usage: performance of the overall site and CPU usage on the app server is considerably improved with Dynacache enabled. Having a good Dynacache strategy is very important for the performance of the site. Will write another blog on that topic.


2 comments:

  1. You can deposit and withdraw via iDebit, Mastercard, Visa, Interac, and Paysafecard on your cost options for lower than $10. The casino offers Roulette games such as European Roulette, Premium French Roulette, Premium American Roulette, and Penny Roulette. Hence, some live Roulette games include Quantum Roulette, Live Fire Blaze 슬롯 Roulette, Live French Roulette, and Live Roulette. When you play in a reputable casino such as those on our listing, you can be certain of verified and fair games. To {ensure that|make certain that|be certain that} a casino has fair games, find out occasion that they} hold a sound license from a reliable jurisdiction and have been independently examined by a 3rd party. Making deposits and withdrawals at Cafe Casino is easy as main cost methods, including cryptocurrencies, are accepted.

    ReplyDelete