<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Batch Import Performance with Grails and MySQL</title>
	<atom:link href="http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/</link>
	<description>Groovy, Grails and OS X tips and tricks</description>
	<lastBuildDate>Sat, 31 Jul 2010 11:43:17 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: berlinguyinca</title>
		<link>http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/comment-page-1/#comment-2666</link>
		<dc:creator>berlinguyinca</dc:creator>
		<pubDate>Sat, 08 May 2010 01:18:05 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2666</guid>
		<description>thanks,

still debugging it. It&#039;s getting better, but not perfect yet. One days I will have it perfect.</description>
		<content:encoded><![CDATA[<p>thanks,</p>
<p>still debugging it. It&#8217;s getting better, but not perfect yet. One days I will have it perfect.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaromir D.B. Nemec</title>
		<link>http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/comment-page-1/#comment-2663</link>
		<dc:creator>Jaromir D.B. Nemec</dc:creator>
		<pubDate>Wed, 05 May 2010 20:58:20 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2663</guid>
		<description>Loading mass data in the database using Hibernate is something like transporting people on the highway using motorcycles (one record a time). Of course it is possible to scale between a low class bike and a Fat Boy, but this doesn’t mean this is the right way. The argument about validation of te data with the domain class is valid, but this is neither argument for Grails nor for Hibernate. It should be possible to reuse the validation closure from an external loading process as well. 
But anyway this is a great tuning result that many will find useful.</description>
		<content:encoded><![CDATA[<p>Loading mass data in the database using Hibernate is something like transporting people on the highway using motorcycles (one record a time). Of course it is possible to scale between a low class bike and a Fat Boy, but this doesn’t mean this is the right way. The argument about validation of te data with the domain class is valid, but this is neither argument for Grails nor for Hibernate. It should be possible to reuse the validation closure from an external loading process as well.<br />
But anyway this is a great tuning result that many will find useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tednaleid</title>
		<link>http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/comment-page-1/#comment-2598</link>
		<dc:creator>tednaleid</dc:creator>
		<pubDate>Thu, 18 Mar 2010 00:13:14 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2598</guid>
		<description>@berlinguyinca I could be wrong, but I think you need to take a look at the queries that are getting generated by your code.  See how many times for each insert each query is getting called.  There might be situations where you could use an executeQuery rather than pulling back and hydrating entire database objects.  

You&#039;ll want to beware of the &lt;a href=&quot;http://www.pbell.com/index.cfm/2006/9/17/Understanding-the-n1-query-problem&quot; rel=&quot;nofollow&quot;&gt;n + 1 problem&lt;/a&gt; too, and might be better off doing eager loads of objects rather than lazy loads.  It&#039;s hard to get into much more detail without actually seeing code.

If you&#039;re doing hundreds of queries for every insert (even if they&#039;re all really quick to start), that&#039;s going to bog down over time.  Looking at (and minimizing) the number of queries might be your best bet.

I&#039;d also look at connecting jconsole to see if memory is going up and then not being released too.  That could point to a memory leak on the grails side.

Good luck.</description>
		<content:encoded><![CDATA[<p>@berlinguyinca I could be wrong, but I think you need to take a look at the queries that are getting generated by your code.  See how many times for each insert each query is getting called.  There might be situations where you could use an executeQuery rather than pulling back and hydrating entire database objects.  </p>
<p>You&#8217;ll want to beware of the <a href="http://www.pbell.com/index.cfm/2006/9/17/Understanding-the-n1-query-problem" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.pbell.com/index.cfm/2006/9/17/Understanding-the-n1-query-problem?referer=');">n + 1 problem</a> too, and might be better off doing eager loads of objects rather than lazy loads.  It&#8217;s hard to get into much more detail without actually seeing code.</p>
<p>If you&#8217;re doing hundreds of queries for every insert (even if they&#8217;re all really quick to start), that&#8217;s going to bog down over time.  Looking at (and minimizing) the number of queries might be your best bet.</p>
<p>I&#8217;d also look at connecting jconsole to see if memory is going up and then not being released too.  That could point to a memory leak on the grails side.</p>
<p>Good luck.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: berlinguyinca</title>
		<link>http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/comment-page-1/#comment-2597</link>
		<dc:creator>berlinguyinca</dc:creator>
		<pubDate>Wed, 17 Mar 2010 21:52:07 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2597</guid>
		<description>it&#039;s me again,

still working on the problem and managed to drop the curve a bit with the use of a couple of SSD&#039;s in our db server, but still not enough to make it feasible.

basically grails seems to store some more data somewhere, i guess. Reason that I&#039;m thinking this is that I can import 100k objects with there relations in a fairly quick time of 100-200ms an insert, till I hit a certain point and than the curve jumps up again.

this is my curve for about 1.2 Mio inserts.

http://dl.dropbox.com/u/5396494/curve.png

The problem is defiantly on the grails side or my rather simple algorithm, since there is now load on the DB during this progress or queries.</description>
		<content:encoded><![CDATA[<p>it&#8217;s me again,</p>
<p>still working on the problem and managed to drop the curve a bit with the use of a couple of SSD&#8217;s in our db server, but still not enough to make it feasible.</p>
<p>basically grails seems to store some more data somewhere, i guess. Reason that I&#8217;m thinking this is that I can import 100k objects with there relations in a fairly quick time of 100-200ms an insert, till I hit a certain point and than the curve jumps up again.</p>
<p>this is my curve for about 1.2 Mio inserts.</p>
<p><a href="http://dl.dropbox.com/u/5396494/curve.png" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/dl.dropbox.com/u/5396494/curve.png?referer=');">http://dl.dropbox.com/u/5396494/curve.png</a></p>
<p>The problem is defiantly on the grails side or my rather simple algorithm, since there is now load on the DB during this progress or queries.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#160; Rendimiento en proceso de importación con Grails y MySQL (inglés)&#160;-&#160;Observatorio de Grails</title>
		<link>http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/comment-page-1/#comment-2587</link>
		<dc:creator>&#160; Rendimiento en proceso de importación con Grails y MySQL (inglés)&#160;-&#160;Observatorio de Grails</dc:creator>
		<pubDate>Fri, 12 Mar 2010 11:08:59 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2587</guid>
		<description>[...] información sobre Batch Import Performance with Grails and MySQL (traducido al [...]</description>
		<content:encoded><![CDATA[<p>[...] información sobre Batch Import Performance with Grails and MySQL (traducido al [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Blog bookmarks 03/10/2010 &#171; My Diigo bookmarks</title>
		<link>http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/comment-page-1/#comment-2584</link>
		<dc:creator>Blog bookmarks 03/10/2010 &#171; My Diigo bookmarks</dc:creator>
		<pubDate>Wed, 10 Mar 2010 04:30:45 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2584</guid>
		<description>[...] Batch Import Performance with Grails and MySQL &#8211; Ted Naleid [...]</description>
		<content:encoded><![CDATA[<p>[...] Batch Import Performance with Grails and MySQL &#8211; Ted Naleid [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Grails MySQL Batch Insert</title>
		<link>http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/comment-page-1/#comment-2583</link>
		<dc:creator>Grails MySQL Batch Insert</dc:creator>
		<pubDate>Tue, 09 Mar 2010 18:06:27 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2583</guid>
		<description>[...] stumbled upon this post http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/.  It&#8217;s an excellent read and gives some insight into some of the inner workings of both [...]</description>
		<content:encoded><![CDATA[<p>[...] stumbled upon this post <a href="http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/. " rel="nofollow">http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/. </a> It&#8217;s an excellent read and gives some insight into some of the inner workings of both [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Lynn</title>
		<link>http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/comment-page-1/#comment-2581</link>
		<dc:creator>Dan Lynn</dc:creator>
		<pubDate>Tue, 09 Mar 2010 01:29:37 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2581</guid>
		<description>Excellent post. I can&#039;t believe you had the patience to gather so much data!

Cheers,
dan</description>
		<content:encoded><![CDATA[<p>Excellent post. I can&#8217;t believe you had the patience to gather so much data!</p>
<p>Cheers,<br />
dan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tednaleid</title>
		<link>http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/comment-page-1/#comment-2557</link>
		<dc:creator>tednaleid</dc:creator>
		<pubDate>Tue, 23 Feb 2010 02:34:27 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2557</guid>
		<description>@berlinguyinca If you haven&#039;t done it already, I&#039;d fire up jconsole (or jvisualvm, either should be in your path already if you&#039;re using java 1.6) and connect to the grails process.  Let it run for quite a while and see if it looks like the memory is continuing to go up and up, or if it sawtooths up and then comes back down to the same level again.

I&#039;d also suggest looking at using a profiler to see where your code is spending most of it&#039;s time.  Yourkit is good, but not free.  I haven&#039;t had a lot of luck with the free ones out there, but I think yourkit has a trial period.

If that doesn&#039;t get it done, unfortunately, it&#039;s possible that your particular use case is complicated and large enough that grails/GORM isn&#039;t the right tool for the job.</description>
		<content:encoded><![CDATA[<p>@berlinguyinca If you haven&#8217;t done it already, I&#8217;d fire up jconsole (or jvisualvm, either should be in your path already if you&#8217;re using java 1.6) and connect to the grails process.  Let it run for quite a while and see if it looks like the memory is continuing to go up and up, or if it sawtooths up and then comes back down to the same level again.</p>
<p>I&#8217;d also suggest looking at using a profiler to see where your code is spending most of it&#8217;s time.  Yourkit is good, but not free.  I haven&#8217;t had a lot of luck with the free ones out there, but I think yourkit has a trial period.</p>
<p>If that doesn&#8217;t get it done, unfortunately, it&#8217;s possible that your particular use case is complicated and large enough that grails/GORM isn&#8217;t the right tool for the job.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: berlinguyinca</title>
		<link>http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/comment-page-1/#comment-2556</link>
		<dc:creator>berlinguyinca</dc:creator>
		<pubDate>Mon, 22 Feb 2010 21:45:11 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2556</guid>
		<description>hi,

great from you to respond. Well yes we do update/delete/select/insert (it&#039;s a merging tool for several databases)

So all 10k inserts I tend to rebuild the indexes and the auto vacuum daemon is running and taking care of these issues (did not really tune the auto vacuum)

I do think it&#039;s grails and not the db and yes I also use batch statements.

I checked for indexes and monitored the executed queries (p6sql spy + jdbc profiler, which I slightly rewrote to make it work with current version of log4j, I will upload a fork in a week or two) And it looks that I have all the required indexes.

thanks again,

any other ideas? So far there were good, but already taken care off. I really think it&#039;s more of a grails issue. I ordered some SSD&#039;s for the server to speed up index access, but they won&#039;t arrive before mid/end next week. IO Doesn&#039;t not seem to be the bottleneck anyway.</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>great from you to respond. Well yes we do update/delete/select/insert (it&#8217;s a merging tool for several databases)</p>
<p>So all 10k inserts I tend to rebuild the indexes and the auto vacuum daemon is running and taking care of these issues (did not really tune the auto vacuum)</p>
<p>I do think it&#8217;s grails and not the db and yes I also use batch statements.</p>
<p>I checked for indexes and monitored the executed queries (p6sql spy + jdbc profiler, which I slightly rewrote to make it work with current version of log4j, I will upload a fork in a week or two) And it looks that I have all the required indexes.</p>
<p>thanks again,</p>
<p>any other ideas? So far there were good, but already taken care off. I really think it&#8217;s more of a grails issue. I ordered some SSD&#8217;s for the server to speed up index access, but they won&#8217;t arrive before mid/end next week. IO Doesn&#8217;t not seem to be the bottleneck anyway.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
