<?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>The world of "Kube" &#187; MySQL</title>
	<atom:link href="http://blog.codexp.net/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.codexp.net</link>
	<description></description>
	<lastBuildDate>Wed, 17 Dec 2008 06:44:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Monitoring Remote Java Apps</title>
		<link>http://blog.codexp.net/2008/11/30/monitoring-remote-java-apps/</link>
		<comments>http://blog.codexp.net/2008/11/30/monitoring-remote-java-apps/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 18:38:49 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.codexp.net/?p=33</guid>
		<description><![CDATA[Monitoring remote Java applications may not be a very easy task. Especially considering the application needed to be started with -Dcom.sun.management.jmxremote option to allow jConsole access it.
VisualVM has made it a bit easier for us to monitor remote apps. You will have to start jstatd process on your remote system and then you can monitor [...]]]></description>
			<content:encoded><![CDATA[<p>Monitoring remote Java applications may not be a very easy task. Especially considering the application needed to be started with <code>-Dcom.sun.management.jmxremote</code> option to allow jConsole access it.</p>
<p>VisualVM has made it a bit easier for us to monitor remote apps. You will have to start <em>jstatd </em>process on your remote system and then you can monitor how your remote VM is feeling.</p>
<p>However.. there are some pitfalls. Here are 2 of the most annoying once:</p>
<p><strong>When starting jstatd you are getting Security Exceptions</strong></p>
<p>To solve this error you will need to create a policy file containing something like this (call it jstatd.all.policy):</p>
<blockquote>
<pre>grant codebase "file:${java.home}/../lib/tools.jar" {

permission java.security.AllPermission;

};</pre>
</blockquote>
<p>Now start <em>jstatd </em>with the following command:</p>
<blockquote>
<pre>jstatd -J-Djava.security.policy=jstatd.all.policy</pre>
</blockquote>
<p><strong>You are trying to connect to the remote host but getting Socket connection refused.</strong></p>
<p>This is most likely caused because of an underlying exception &#8211; connection refused to host 127.0.0.1 or something simmilar (not the IP you are trying to access). This is easily solved by adding the following parameter to <em>jstatd </em>startup command:</p>
<blockquote>
<pre>-J-Djava.rmi.server.hostname=&lt;your ip or hostname&gt;</pre>
</blockquote>
<p>&#8230; Naturally there are more pitfalls but I am not going to cover all of them here. VirtualVM, just like legacy jConsole may be very usefull for monitoring how some applications act in the testing environment before you put them into producstion. Usually things that do not appear on your development machine while profiling may appear in the test environment where it is hard to notice them without profiling.</p>
<p>One of such problems may be MySQL Connector/J PermGen leak caused by Statement cancelation timer (something i have encountered recently and trying to come around)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codexp.net/2008/11/30/monitoring-remote-java-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Connector/J lockup</title>
		<link>http://blog.codexp.net/2008/11/30/mysql-connectorj-lockup/</link>
		<comments>http://blog.codexp.net/2008/11/30/mysql-connectorj-lockup/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 15:34:37 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[JDBC]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.codexp.net/?p=24</guid>
		<description><![CDATA[Lately I have been working on a multi-threaded Java application that utilizes MySQL Connector/J 5.1.7
This is probably the easiest way to access a MySQL database from Java. Everything seemed to be fine until i recently ran a few days long test of the daemon application on one of our test servers. It did not like [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I have been working on a multi-threaded Java application that utilizes MySQL Connector/J 5.1.7</p>
<p>This is probably the easiest way to access a MySQL database from Java. Everything seemed to be fine until i recently ran a few days long test of the daemon application on one of our test servers. It did not like me in the long run, i am still not sure why and whether it really was a Conenctor/J problem or not.</p>
<p>In any case, the problem i have faced was CPU usage suddenly started raising to about 50% (in a period of one day) and it wasnt a spike &#8211; it was a steady raise. When i checked the log file there were no warnings except one i got a at the end of the day: MySQL connection link failure.</p>
<p>Now one may wonder &#8211; how is this related to MySQL Connector. Well, it seems to me that it was due to Statement cancellation timer lockup that it started causing problems. Right now i have modified the code of the application to cancel all statemnts explicitly as well as some forced Garbage Collection, just to make sure that nothing unwanted slips by. The new test has been deployed to the servers and we are about to see if it has any effect.</p>
<p>Another note about Java (not really MySQL related):<br />
It seems to be smart using &#8220;-server&#8221; option when starting a VM if the application is supposed to run for a very long time. The performance optimization is huge: we are talking about almost 2x performance optimization compared to &#8220;-client&#8221; VM (default).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codexp.net/2008/11/30/mysql-connectorj-lockup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
