<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DBA survival BLOG &#187; JBoss</title>
	<atom:link href="http://www.ludovicocaldara.net/dba/tag/jboss/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ludovicocaldara.net/dba</link>
	<description>Keep DBA job simple. Thanks.</description>
	<lastBuildDate>Sat, 01 Oct 2011 20:06:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>JBoss Portal and MySQL scalability: What The&#8230;???</title>
		<link>http://www.ludovicocaldara.net/dba/jboss-portal-and-mysql-scalability/</link>
		<comments>http://www.ludovicocaldara.net/dba/jboss-portal-and-mysql-scalability/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 22:06:33 +0000</pubDate>
		<dc:creator>Ludovico</dc:creator>
				<category><![CDATA[JBoss]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Portal]]></category>

		<guid isPermaLink="false">http://www.ludovicocaldara.net/dba/?p=33</guid>
		<description><![CDATA[I found several queries running on a MySQL 5.0 database like this one: SELECT PATH, NAME FROM JBP_OBJECT_NODE  WHERE PK IN &#40; SELECT NODE_KEY FROM JBP_OBJECT_NODE_SEC WHERE ROLE IN &#40; SELECT jr.jbp_name FROM jbp_users ju, jbp_role_membership jrm, jbp_roles jr WHERE jrm.jbp_uid = ju.jbp_uid AND jr.jbp_rid = jrm.jbp_rid AND ju.jbp_uname = 'LUDOVICO' AND ju.jbp_enabled = 1&#41;&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p>I found several queries running on a MySQL 5.0 database like this one:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> PATH<span style="color: #66cc66;">,</span> NAME <span style="color: #993333; font-weight: bold;">FROM</span> JBP_OBJECT_NODE  <span style="color: #993333; font-weight: bold;">WHERE</span> PK <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> NODE_KEY <span style="color: #993333; font-weight: bold;">FROM</span> JBP_OBJECT_NODE_SEC <span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #993333; font-weight: bold;">ROLE</span> <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> jr<span style="color: #66cc66;">.</span>jbp_name <span style="color: #993333; font-weight: bold;">FROM</span> jbp_users ju<span style="color: #66cc66;">,</span> jbp_role_membership jrm<span style="color: #66cc66;">,</span>
jbp_roles jr
<span style="color: #993333; font-weight: bold;">WHERE</span> jrm<span style="color: #66cc66;">.</span>jbp_uid <span style="color: #66cc66;">=</span> ju<span style="color: #66cc66;">.</span>jbp_uid
<span style="color: #993333; font-weight: bold;">AND</span> jr<span style="color: #66cc66;">.</span>jbp_rid <span style="color: #66cc66;">=</span> jrm<span style="color: #66cc66;">.</span>jbp_rid
<span style="color: #993333; font-weight: bold;">AND</span> ju<span style="color: #66cc66;">.</span>jbp_uname <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'LUDOVICO'</span>
<span style="color: #993333; font-weight: bold;">AND</span> ju<span style="color: #66cc66;">.</span>jbp_enabled <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>This query is related to JBoss Portal and does a full scan on table JBP_OBJECT_NODE.</p>
<p>It has bad performances (&gt;0.8 sec) with just a few records:</p>
<p>mysql&gt; select count(*) from JBP_OBJECT_NODE;<br />
+&#8212;&#8212;&#8212;-+<br />
| count(*) |<br />
+&#8212;&#8212;&#8212;-+<br />
|    33461 |<br />
+&#8212;&#8212;&#8212;-+</p>
<p>If I rewrite the query using an inner join (à la Oracle, please forgive me) instead of a subquery I get an index scan:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">DISTINCT</span> a<span style="color: #66cc66;">.</span>PATH<span style="color: #66cc66;">,</span> a<span style="color: #66cc66;">.</span>NAME <span style="color: #808080; font-style: italic;">/* , b.NODE_KEY */</span> <span style="color: #993333; font-weight: bold;">FROM</span>  JBP_OBJECT_NODE
a<span style="color: #66cc66;">,</span> JBP_OBJECT_NODE_SEC b
<span style="color: #993333; font-weight: bold;">WHERE</span> a<span style="color: #66cc66;">.</span>pk<span style="color: #66cc66;">=</span>b<span style="color: #66cc66;">.</span>NODE_KEY
<span style="color: #993333; font-weight: bold;">AND</span> b<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">ROLE</span> <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> jr<span style="color: #66cc66;">.</span>jbp_name <span style="color: #993333; font-weight: bold;">FROM</span> jbp_users ju<span style="color: #66cc66;">,</span> jbp_role_membership jrm<span style="color: #66cc66;">,</span>
jbp_roles jr
<span style="color: #993333; font-weight: bold;">WHERE</span> jrm<span style="color: #66cc66;">.</span>jbp_uid <span style="color: #66cc66;">=</span> ju<span style="color: #66cc66;">.</span>jbp_uid
<span style="color: #993333; font-weight: bold;">AND</span> jr<span style="color: #66cc66;">.</span>jbp_rid <span style="color: #66cc66;">=</span> jrm<span style="color: #66cc66;">.</span>jbp_rid
<span style="color: #993333; font-weight: bold;">AND</span> ju<span style="color: #66cc66;">.</span>jbp_uname <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'UTDEMO'</span>
<span style="color: #993333; font-weight: bold;">AND</span> ju<span style="color: #66cc66;">.</span>jbp_enabled <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>With 30k records the execution time falls down from 0.8 secs to 0.01 secs&#8230;<br />
That&#8217;s NOT all! I found this open bug:</p>
<p>https://jira.jboss.org/jira/browse/JBPORTAL-2040</p>
<p>With many users registered in, the JBoss Portal Admin console tooks over a minute to show a single page&#8230;</p>
<p>I don&#8217;t like portals&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ludovicocaldara.net/dba/jboss-portal-and-mysql-scalability/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JBOSS Cluster isolation and multicasting</title>
		<link>http://www.ludovicocaldara.net/dba/jboss-cluster-isolation-and-multicasting/</link>
		<comments>http://www.ludovicocaldara.net/dba/jboss-cluster-isolation-and-multicasting/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 15:02:47 +0000</pubDate>
		<dc:creator>Ludovico</dc:creator>
				<category><![CDATA[JBoss]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[mod_jk]]></category>
		<category><![CDATA[multicast]]></category>

		<guid isPermaLink="false">http://www.ludovicocaldara.net/dba/?p=26</guid>
		<description><![CDATA[JBoss uses UDP multicasting to replicate informations across cluster nodes: even if I isolate TCP traffic, JBoss will "ear" messages sent from other clusters.]]></description>
			<content:encoded><![CDATA[<p>I configured two <strong>JBoss</strong> clusters in the same LAN: a production and a test environment.<br />
I decided to configure every single cluster with a dedicate private LANs using a restricted netmask to isolate production and test connectivity, so I assigned<br />
<strong>192.168.100.0/255.255.255.0</strong> to test and<br />
<strong>192.168.200.0/255.255.255.0</strong> to production.<br />
I configured <strong>Apache</strong> and <strong>mod_jk </strong>to loadbalance activities between cluster instances.</p>
<p>The page <a title="UsingMod_jk1.2WithJBoss" href="http://www.jboss.org/com munity/docs/DOC-12525" target="_blank">UsingMod_jk1.2WithJBoss</a> (http://www.jboss.org/community/docs/DOC-12525) is a good tutorial to achieve this.</p>
<p><span style="text-decoration: underline;">What problems should I expect?</span><br />
<strong>JBoss</strong> uses <strong>UDP multicasting</strong> to replicate informations across cluster nodes: even if I isolate TCP traffic, JBoss will &#8220;ear&#8221; messages sent from other clusters and will log a lot of warnings like the following:</p>
<p>&#8230; WARN [NAKACK] [...] discarded message from non-member &#8230;.</p>
<p>I had to change <strong>BOTH</strong> multicast ip address and port (attributes <em>mcast_addr</em> and <em>mcast_port</em>) in the following configuration files:</p>
<ul>
<li>./deploy/jboss-web-cluster.sar/META-INF/jboss-service.xml</li>
</ul>
<ul>
<li>./deploy/jmx-console.war/WEB-INF/web.xml</li>
</ul>
<ul>
<li>./deploy/cluster-service.xml</li>
</ul>
<ul>
<li>./deploy/ejb3-clustered-sfsbcache-service.xml</li>
</ul>
<ul>
<li>./deploy/ejb3-entity-cache-service.xml</li>
</ul>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ludovicocaldara.net/dba/jboss-cluster-isolation-and-multicasting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

