<?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>Wed, 10 Mar 2010 04:30:45 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<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>
	<item>
		<title>By: tednaleid</title>
		<link>http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/comment-page-1/#comment-2550</link>
		<dc:creator>tednaleid</dc:creator>
		<pubDate>Sun, 21 Feb 2010 07:53:47 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2550</guid>
		<description>@berlinguyinca who&#039;s load is increasing after 100k inserts?  Is the database load increasing or java/grails?  

If it&#039;s the database, it could be that you&#039;re missing an index (or need to tune an index that you already have).

I&#039;m less familiar with current postgres installs, but I also know that in some batch programs I created against postgres a few years ago that batching thousands of records together in a transaction was a pretty big help.   

If you&#039;re doing any deletion/modification during your import, it could also be that you need to vacuum your database (something that isn&#039;t necessary in mysql).</description>
		<content:encoded><![CDATA[<p>@berlinguyinca who&#8217;s load is increasing after 100k inserts?  Is the database load increasing or java/grails?  </p>
<p>If it&#8217;s the database, it could be that you&#8217;re missing an index (or need to tune an index that you already have).</p>
<p>I&#8217;m less familiar with current postgres installs, but I also know that in some batch programs I created against postgres a few years ago that batching thousands of records together in a transaction was a pretty big help.   </p>
<p>If you&#8217;re doing any deletion/modification during your import, it could also be that you need to vacuum your database (something that isn&#8217;t necessary in mysql).</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-2549</link>
		<dc:creator>berlinguyinca</dc:creator>
		<pubDate>Sun, 21 Feb 2010 07:22:58 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2549</guid>
		<description>create post and really helped me and my problem to import millions of records into a postgres database. 

Only thing, it&#039;s still gets too slow after a couple of 100k inserts, since the performance gets gradually worse over time. It starts at 50ms and is at 200ms after 200k inserts (nothing compared to before flushing the session, but still)

So there is still something amiss with grails + hibernate + DB

any more ideas?</description>
		<content:encoded><![CDATA[<p>create post and really helped me and my problem to import millions of records into a postgres database. </p>
<p>Only thing, it&#8217;s still gets too slow after a couple of 100k inserts, since the performance gets gradually worse over time. It starts at 50ms and is at 200ms after 200k inserts (nothing compared to before flushing the session, but still)</p>
<p>So there is still something amiss with grails + hibernate + DB</p>
<p>any more ideas?</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-2534</link>
		<dc:creator>tednaleid</dc:creator>
		<pubDate>Thu, 18 Feb 2010 14:33:06 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2534</guid>
		<description>@fabien7474  I haven&#039;t used p6spy with grails 1.2 yet, that was on a previous grails 1.1.1 application that I&#039;m no longer developing so I&#039;m not much help right now about that.  I&#039;ll be sure to post if I get a chance to get p6spy going in 1.2 or greater.</description>
		<content:encoded><![CDATA[<p>@fabien7474  I haven&#8217;t used p6spy with grails 1.2 yet, that was on a previous grails 1.1.1 application that I&#8217;m no longer developing so I&#8217;m not much help right now about that.  I&#8217;ll be sure to post if I get a chance to get p6spy going in 1.2 or greater.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fabien7474</title>
		<link>http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/comment-page-1/#comment-2533</link>
		<dc:creator>fabien7474</dc:creator>
		<pubDate>Thu, 18 Feb 2010 13:29:51 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2533</guid>
		<description>Hi Ted,

And thank you for this great post !  I will definitely try all of your tips for my batch imports that were very slow and very memory-consuming !

Again than you for sharing this

BTW, I didn&#039;t manage to have p6spy and sqlprofiler working together (no queries are shown in the SqlProfiler console) with Grails 1.2 under Windows Vista). Like j pimmel, I was curious to know if you did manage to have it work and if you change something from what is explained in Mike Hugo  &#039;s article? 

Regards,

Fabien</description>
		<content:encoded><![CDATA[<p>Hi Ted,</p>
<p>And thank you for this great post !  I will definitely try all of your tips for my batch imports that were very slow and very memory-consuming !</p>
<p>Again than you for sharing this</p>
<p>BTW, I didn&#8217;t manage to have p6spy and sqlprofiler working together (no queries are shown in the SqlProfiler console) with Grails 1.2 under Windows Vista). Like j pimmel, I was curious to know if you did manage to have it work and if you change something from what is explained in Mike Hugo  &#8217;s article? </p>
<p>Regards,</p>
<p>Fabien</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/comment-page-1/#comment-2315</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Sat, 12 Dec 2009 17:22:30 +0000</pubDate>
		<guid isPermaLink="false">http://naleid.com/blog/?p=66#comment-2315</guid>
		<description>Seems in DomainClassGrailsPlugin the domain objects are getting set  not only on the propertyInstanceMap  but also on the RequestAttributes so those have to be cleared as well.

      def attributes = rch.getRequestAttributes()
                if(attributes) {
                    attributes.request.setAttribute(key,val)
                }
                else {
                    PROPERTY_INSTANCE_MAP.get().put(key,val)
                }</description>
		<content:encoded><![CDATA[<p>Seems in DomainClassGrailsPlugin the domain objects are getting set  not only on the propertyInstanceMap  but also on the RequestAttributes so those have to be cleared as well.</p>
<p>      def attributes = rch.getRequestAttributes()<br />
                if(attributes) {<br />
                    attributes.request.setAttribute(key,val)<br />
                }<br />
                else {<br />
                    PROPERTY_INSTANCE_MAP.get().put(key,val)<br />
                }</p>
]]></content:encoded>
	</item>
</channel>
</rss>
