<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="150352" data-post-id="150352">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="OvermindDL1" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/OvermindDL1/120/2677_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  OvermindDL1
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’d be curious to see the debug log sql processing times to see which is actually the slow one first of all?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="150352" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/performance-issues-slowness-after-elixir-upgrade/26786/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-150352" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="150352"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="150355" data-post-id="150355">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="l00ker" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/l00ker/120/4095_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  l00ker
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This suggestion might be going out on a limb… but have a look at this recent post:</p>
<p><a href="https://forum.elixirforum.com/t/disable-prepared-statements-for-an-individual-query/26775" rel="nofollow">Disable prepared statements for an individual query</a></p>
<p>I didn’t bother to research when prepared statements where introduced in ecto etc., but since this was such a large upgrade jump, maybe you’re being affected in a similar way and it’s adding up fast due to the shear volume of queries.</p>
<p>It’s a long shot, but the read and eventual outcome might prove educational either way <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="150355" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/performance-issues-slowness-after-elixir-upgrade/26786/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-150355" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="150355"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="150414" data-post-id="150414">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="agacode" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  agacode
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I put <code>Repo.checkout</code> in the controller action in my localhost, the pool size is 10<br>
It is processing 10 request only at the same time, but it is getting stuck/hung.<br>
I have run some commands that I’ve found on a closed issue for <a href="https://github.com/elixir-ecto/ecto/issues/2946" rel="noopener nofollow ugc">db_connection</a> and the output is the following:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex(7)&gt; pid = spawn(fn -&gt; Beacon.Repo.query("SELECT 1") end)
#PID&lt;0.2153.0&gt;
iex(8)&gt; Process.info(pid)
[
  current_function: {DBConnection.Holder, :checkout_call, 5},
  initial_call: {:erlang, :apply, 2},
  status: :waiting,
  message_queue_len: 0,
  links: [],
  dictionary: [],
  trap_exit: false,
  error_handler: :error_handler,
  priority: :normal,
  group_leader: #PID&lt;0.65.0&gt;,
  total_heap_size: 233,
  heap_size: 233,
  stack_size: 38,
  reductions: 188,
  garbage_collection: [
    max_heap_size: %{error_logger: true, kill: true, size: 0},
    min_bin_vheap_size: 46422,
    min_heap_size: 233,
    fullsweep_after: 65535,
    minor_gcs: 0
  ],
  suspending: []
]
iex(9)&gt; Process.info(pid, :current_stacktrace)
{:current_stacktrace,
 [
   {DBConnection.Holder, :checkout_call, 5,
    [file: 'lib/db_connection/holder.ex', line: 251]},
   {DBConnection.Holder, :checkout, 2,
    [file: 'lib/db_connection/holder.ex', line: 60]},
   {DBConnection, :checkout, 3, [file: 'lib/db_connection.ex', line: 1030]},
   {DBConnection, :run, 6, [file: 'lib/db_connection.ex', line: 1340]},
   {DBConnection, :parsed_prepare_execute, 5,
    [file: 'lib/db_connection.ex', line: 540]},
   {DBConnection, :prepare_execute, 4,
    [file: 'lib/db_connection.ex', line: 533]},
   {Postgrex, :query_prepare_execute, 4, [file: 'lib/postgrex.ex', line: 219]}
 ]}
</code></pre>
<p>Any idea why might be getting hung? Thank you</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="150414" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/performance-issues-slowness-after-elixir-upgrade/26786/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-150414" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="150414"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="150421" data-post-id="150421">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>What is getting hung, the 10 requests or the iex command? Are you running that <code>spawn</code> command while the 10 requests are happening? If you have a pool size of 10 and there are 10 requests happening each with a connection, your pid in console MUST hang until a connection becomes available.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="150421" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/performance-issues-slowness-after-elixir-upgrade/26786/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-150421" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="150421"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="150487" data-post-id="150487">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="agacode" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  agacode
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The 10 requests are getting hung. Actually they all executed till the end I had a 200 (OK) response from each of them in JMeter. But it won’t execute any other request after that, no more logs in the console, no activity, nothing.</p>
<p>I ran those commands because I saw them in <a href="https://github.com/elixir-ecto/ecto/issues/2946" rel="noopener nofollow ugc">this post</a> from <a class="mention" href="/u/josevalim" rel="nofollow">@josevalim</a></p>
<p>I tried then replacing Repo.checkout by Repo.transaction (The queries can execute in a transaction) because I saw it in <a href="http://blog.plataformatec.com.br/2018/10/a-sneak-peek-at-ecto-3-0-performance-migrations-and-more/" rel="noopener nofollow ugc">this article</a> from <a class="mention" href="/u/josevalim" rel="nofollow">@josevalim</a>, but that did not solve the problem either, not getting hung with Repo.transaction, but the same behavior as before very slow.</p>
<p>I also tried the master branch for <a href="https://github.com/elixir-ecto/db_connection" rel="noopener nofollow ugc">db_connection</a> but I got the same behavior.</p>
<p>Thanks again for looking into this.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="150487" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/performance-issues-slowness-after-elixir-upgrade/26786/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-150487" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="150487"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="152817" data-post-id="152817">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="12" data-topic="26786" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>I’d be curious to see the debug log sql processing times to see which is actually the slow one first of all?</p>
</blockquote>
</aside>
<p><a class="mention" href="/u/agacode" rel="nofollow">@agacode</a> <img src="https://forum.elixirforum.com/images/emoji/apple/point_up.png?v=15" title=":point_up:" class="emoji" alt=":point_up:" loading="lazy" width="20" height="20"> This. Give us some more details, there are practically zero at this point.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="152817" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/performance-issues-slowness-after-elixir-upgrade/26786/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-152817" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="152817"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>