<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question ExecuteSQL does not let go of threads in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/ExecuteSQL-does-not-let-go-of-threads/m-p/308764#M223670</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the ExecuteSQL processor in NiFi to write records to PostgreSQL.&lt;/P&gt;&lt;P&gt;The problem I have is when running on multi-thread (for example 10), the processor gets stuck and runs too slow. This doesn't happen in a single thread. However, single thread is not efficient so doesn't work for me.&lt;/P&gt;&lt;P&gt;After getting slow, I stop the processor, terminate it, and start it again. For almost 5-10 seconds everything is ok and then the same problem.&lt;/P&gt;&lt;P&gt;I also have a similar problem with the InvokeHTTP processor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jan 2021 08:35:58 GMT</pubDate>
    <dc:creator>garoosy</dc:creator>
    <dc:date>2021-01-05T08:35:58Z</dc:date>
    <item>
      <title>ExecuteSQL does not let go of threads</title>
      <link>https://community.cloudera.com/t5/Support-Questions/ExecuteSQL-does-not-let-go-of-threads/m-p/308764#M223670</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the ExecuteSQL processor in NiFi to write records to PostgreSQL.&lt;/P&gt;&lt;P&gt;The problem I have is when running on multi-thread (for example 10), the processor gets stuck and runs too slow. This doesn't happen in a single thread. However, single thread is not efficient so doesn't work for me.&lt;/P&gt;&lt;P&gt;After getting slow, I stop the processor, terminate it, and start it again. For almost 5-10 seconds everything is ok and then the same problem.&lt;/P&gt;&lt;P&gt;I also have a similar problem with the InvokeHTTP processor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 08:35:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/ExecuteSQL-does-not-let-go-of-threads/m-p/308764#M223670</guid>
      <dc:creator>garoosy</dc:creator>
      <dc:date>2021-01-05T08:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteSQL does not let go of threads</title>
      <link>https://community.cloudera.com/t5/Support-Questions/ExecuteSQL-does-not-let-go-of-threads/m-p/308809#M223690</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/84262"&gt;@garoosy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You should look in to using the "&lt;SPAN&gt;&lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.12.0/org.apache.nifi.processors.standard.ExecuteSQLRecord/" target="_self"&gt;ExecuteSQLRecord&lt;/A&gt;" instead of "&lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.12.0/org.apache.nifi.processors.standard.ExecuteSQL/" target="_self"&gt;ExecuteSQL&lt;/A&gt;" for large volume data.&amp;nbsp; To be efficient&amp;nbsp;here you&amp;nbsp; would have many records in a single FlowFile.&lt;BR /&gt;&lt;BR /&gt;Right now you have a single record per each FlowFile which is not going to be very efficient.&amp;nbsp; The only way for "ExecuteSQL" to handle multiple FlowFile executions in a single connection is if the SQL statement used in every FlowFile is identical.&amp;nbsp; In order to do that the unique values&amp;nbsp;would&amp;nbsp;need to come from FlowFile attributes.&lt;BR /&gt;&lt;BR /&gt;You may find these post helpful:&lt;BR /&gt;&lt;A href="https://community.cloudera.com/t5/Support-Questions/Nifi-ExectueSQL-how-to-force-a-parameter-to-be-a-string/td-p/240117" target="_blank"&gt;https://community.cloudera.com/t5/Support-Questions/Nifi-ExectueSQL-how-to-force-a-parameter-to-be-a-string/td-p/240117&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://stackoverflow.com/questions/63330790/using-nifi-executesqlrecord-with-parameterized-sql-statements" target="_blank"&gt;https://stackoverflow.com/questions/63330790/using-nifi-executesqlrecord-with-parameterized-sql-statements&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you have threads that never seem to complete (will see small number in upper right corner of processor (2)), it is best to get a series of thread dumps (4 - 6) to verify thread is not progressing.&amp;nbsp; Then you have to determine if what the thread is waiting on.&amp;nbsp; Did you try setting a "Max Wait Time" on the processor?&amp;nbsp; It defaults&amp;nbsp;to 0 which means it would&amp;nbsp;wait forever.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 19:19:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/ExecuteSQL-does-not-let-go-of-threads/m-p/308809#M223690</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2021-01-05T19:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteSQL does not let go of threads</title>
      <link>https://community.cloudera.com/t5/Support-Questions/ExecuteSQL-does-not-let-go-of-threads/m-p/308815#M223696</link>
      <description>&lt;P&gt;You generally don't need to run multiple threads for that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also make sure you size your nodes and cluster appropriately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.datainmotion.dev/2020/07/sizing-your-apache-nifi-cluster-for.html" target="_blank"&gt;https://www.datainmotion.dev/2020/07/sizing-your-apache-nifi-cluster-for.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 20:52:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/ExecuteSQL-does-not-let-go-of-threads/m-p/308815#M223696</guid>
      <dc:creator>TimothySpann</dc:creator>
      <dc:date>2021-01-05T20:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteSQL does not let go of threads</title>
      <link>https://community.cloudera.com/t5/Support-Questions/ExecuteSQL-does-not-let-go-of-threads/m-p/308898#M223711</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I will try it.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 05:43:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/ExecuteSQL-does-not-let-go-of-threads/m-p/308898#M223711</guid>
      <dc:creator>garoosy</dc:creator>
      <dc:date>2021-01-06T05:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: ExecuteSQL does not let go of threads</title>
      <link>https://community.cloudera.com/t5/Support-Questions/ExecuteSQL-does-not-let-go-of-threads/m-p/308899#M223712</link>
      <description>&lt;P&gt;Thank you Matt!&lt;/P&gt;&lt;P&gt;Altering the "Max Wait Time" value was a game-changing move. I still need to improve it. But the thread problem is fixed now.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 05:47:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/ExecuteSQL-does-not-let-go-of-threads/m-p/308899#M223712</guid>
      <dc:creator>garoosy</dc:creator>
      <dc:date>2021-01-06T05:47:59Z</dc:date>
    </item>
  </channel>
</rss>

