<?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>topic Custom code mysql too many connections in Data Hub</title>
    <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-mysql-too-many-connections/m-p/635428#M859</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi, I've got a custom code workflow where I try to get data from an external MySQL database. I get a "too many connections" error because it's possible that more than 200 contacts go through that workflow at the same time. It needs to fetch data right before an e-mail has to leave. Do you guys have any solution to pass each contact one at a time through a workflow or a custom code step? Or how I can anticipate that there are too many connections? Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 19 May 2022 06:21:07 GMT</pubDate>
    <dc:creator>thomasvbe</dc:creator>
    <dc:date>2022-05-19T06:21:07Z</dc:date>
    <item>
      <title>Custom code mysql too many connections</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-mysql-too-many-connections/m-p/635428#M859</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi, I've got a custom code workflow where I try to get data from an external MySQL database. I get a "too many connections" error because it's possible that more than 200 contacts go through that workflow at the same time. It needs to fetch data right before an e-mail has to leave. Do you guys have any solution to pass each contact one at a time through a workflow or a custom code step? Or how I can anticipate that there are too many connections? Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 06:21:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-mysql-too-many-connections/m-p/635428#M859</guid>
      <dc:creator>thomasvbe</dc:creator>
      <dc:date>2022-05-19T06:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Custom code mysql too many connections</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-mysql-too-many-connections/m-p/635561#M865</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/230157"&gt;@thomasvbe&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;There isn't an ideal solution here as there is no way of throttling how many contacts (or any record for that matter) can enroll into a workflow at any given time. With that said some ideas that spring to mind include:&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT size="4"&gt;Increasing the max_connections system variable but be mindful that this could impact overall performance depending on volume. More information on how to do that can be found &lt;A href="https://ubiq.co/database-blog/how-to-increase-max-connections-in-mysq" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size="4"&gt;Another option might be to ensure that you're closing/terminating the connection within the custom coded action as early as is reasonably possible.&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;FONT size="4"&gt;The way our tool is structured is that each contact enrolled that the custom coded workflow action runs against will count towards the total number of client connections you can have at any given time to your database.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;I appreciate this isn't a perfect solution but just wanted to provide some insight on my end.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;Jack&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 11:38:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-mysql-too-many-connections/m-p/635561#M865</guid>
      <dc:creator>jackcoldrick</dc:creator>
      <dc:date>2022-05-19T11:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Custom code mysql too many connections</title>
      <link>https://community.hubspot.com/t5/Data-Hub/Custom-code-mysql-too-many-connections/m-p/636082#M866</link>
      <description>&lt;P&gt;Hi Jack&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We did actually increase the max connections, although this isn't a future-proof solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 05:27:55 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/Data-Hub/Custom-code-mysql-too-many-connections/m-p/636082#M866</guid>
      <dc:creator>thomasvbe</dc:creator>
      <dc:date>2022-05-20T05:27:55Z</dc:date>
    </item>
  </channel>
</rss>

