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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mtrudel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mtrudel/120/28190_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mtrudel
                      <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 class="user-title">
									<span>Creator of Bandit</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Tough to tell. A few observations:</p>
<ul>
<li>
<p>BLUF: <strong>Of course</strong> this is an apples and oranges comparison. I personally couldn’t give two hoots how well we perform against other languages (especially natively compiled ones running on base libraries); that’s not a game I have any interest in playing or one that has any winners. It’s MONGODB IS WEB SCALE all over again and I have better things to do with my time than to engage in the comparative aspects of this. The two contestants aren’t even playing the same sport</p>
</li>
<li>
<p>The PR’s setup looks fine (it’s not a matter of app configuration). I didn’t look at any of the lower level OS / BEAM tuning details</p>
</li>
<li>
<p>He’s using <code>m7a.large</code> instances, which at first glance look like they’d perform a <em>smidge</em> worse than the  instances we use for microbenchmarks in CI. From that perspective the results seem <em>roughly</em> correspondent with what I’d expect in absolute terms.</p>
</li>
<li>
<p>I’m a little worried by the growth numbers that Bandit demonstrates. CPU usage shouldn’t be growing without bound like that, and (as he states) that’s likely the root cause of the lacklustre numbers elsewhere</p>
</li>
<li>
<p>There’s not really a whole lot of actionable steps to take based on this data. We really do need a better benchmarking environment (ideally one that runs as part of CI), as the microbenchmarking setup we use now just doesn’t get to the absolute scale needed to reproduce these sorts of situations ‘in the lab’, which is a necessary precondition to be able to improve them in Bandit. If anyone is looking for a place to help, that’s probably the highest value way to do so</p>
</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="349133" data-batch-url="/posts/batch_likers">
                        8
                      </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/bandit-a-pure-elixir-http-server-for-plug-websock-applications/59146/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-349133" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="349133"
                     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="349136" data-post-id="349136">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mpope" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mpope
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’d say that POST benchmark is a bit disingenuous given it is also testing Ecto. But for the GET I would suggest enabling the <a href="https://www.erlang.org/doc/apps/erts/supercarrier.html" rel="nofollow">supercarrier</a> to 85% of the available memory, that could give Bandit a boost. I’ve been profiling some webservers using <a href="https://www.erlang.org/doc/apps/runtime_tools/msacc.html" rel="nofollow">msacc</a> recently and quite a bit of time is spent in GC. I wonder if it is a similar scenario in this case.</p>
<p>Futher, the <a href="https://github.com/antonputra/tutorials/blob/230/lessons/230/elixir-app/lib/app/router.ex#L56" rel="noopener nofollow ugc">benchmark application</a> uses <code>Jason.encode</code> instead of <a href="https://hexdocs.pm/jason/Jason.html#encode_to_iodata/2" rel="noopener nofollow ugc">Jason.encode_to_iodata</a> While the body is not large, I’m sure it would help. Using <code>:erlang.byte_size</code> on the encoded device lists shows that they breach the <a href="https://www.erlang.org/doc/system/binaryhandling.html#refc-binaries" rel="nofollow">refc binary</a> threshold. This has the potential to put pressure on the binary allocator and effect the system negatively. Keeping these terms to the local process heap might be a benefit.</p>
<p>Final note is that iirc these are the “defacto” configs to use <a href="https://forum.elixirforum.com/t/any-tips-on-tuning-the-beam-vm/51038/2" class="inline-onebox" rel="nofollow">Any tips on tuning the BEAM VM? - #2 by scottmessinger</a>. These are not set in the <a href="https://github.com/antonputra/tutorials/blob/230/lessons/230/elixir-app/rel/vm.args.eex" rel="noopener nofollow ugc">vmargs</a> of the test app.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">+sbwt none
+sbwtdcpu none
+sbwtdio none
</code></pre>
<p>TL;DR VM settings could make Bandit look better <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" 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="349136" data-batch-url="/posts/batch_likers">
                        2
                      </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/bandit-a-pure-elixir-http-server-for-plug-websock-applications/59146/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-349136" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="349136"
                     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 #12"></div>
  </section>
</div>
    <div class="postbit" id="349138" data-post-id="349138">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mtrudel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mtrudel/120/28190_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mtrudel
                      <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 class="user-title">
									<span>Creator of Bandit</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I know what some of those words mean!</p>
<p>When you mention you’ve been profiling web servers lately, is there anything actionable you’ve seen with Bandit? That low level of profiling is truthfully not something I have a lot of experience or expertise with, and I’d greatly appreciate if you would be willing to share some insights with the project</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="349138" 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/bandit-a-pure-elixir-http-server-for-plug-websock-applications/59146/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-349138" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="349138"
                     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="349139" data-post-id="349139">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mpope" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mpope
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Sadly no, this was a more general debugging webapp production issues and not comparing the performance across multiple web servers. What it comes down to (in my sample size of ~5) is rarely the overhead of the web server dominates but the overhead of encoding / decoding data (Absinthe / Jason / etc). Which makes application-based benchmarks difficult because that is not where the BEAM shines.</p>
<p>That being said, if you link this microbenchmark I can try to use the regular suspects on it, <code>perf</code> / <code>msacc</code> / <code>eprof</code> / <code>fprof</code>, to see if anything actionable stands out.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="349139" 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/bandit-a-pure-elixir-http-server-for-plug-websock-applications/59146/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-349139" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="349139"
                     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="349143" data-post-id="349143">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mtrudel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mtrudel/120/28190_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mtrudel
                      <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 class="user-title">
									<span>Creator of Bandit</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="mpope" data-post="15" data-topic="59146">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/m/71c47a/48.png" class="avatar"> mpope:</div>
<blockquote>
<p>That being said, if you link this microbenchmark I can try to use the regular suspects on it, <code>perf</code> / <code>msacc</code> / <code>eprof</code> / <code>fprof</code>, to see if anything actionable stands out.</p>
</blockquote>
</aside>
<p>See, that’s part of the problem. The <a href="https://github.com/mtrudel/benchmark" rel="noopener nofollow ugc">benchmarks</a> that <a href="https://github.com/mtrudel/bandit/actions/runs/12239834222" rel="noopener nofollow ugc">run in CI</a> are mostly intended to be comparative, in order to evaluate the relative perf impact of a branch compared to <code>main</code> as a baseline (I also use them to run comparative benchmarks against Cowboy).</p>
<p>Whenever I’ve done eprof/fprof work it’s always been against an adhoc ‘hello world’ Plug instance and a small set of hand-rolled client connections. The ephemeral nature of these test setups (and my general amateur relationship with profiling tools) makes it hard for me to <em>really</em> assess performance in an absolute sense.</p>
<p>So, to answer your question, I suppose a good ask here would be to ask how you as an SME would together a process that would profile a simple ‘hello world’ plug in a reproducible way that allowed for flexible client access patterns (single vs keepalive requests, HTTP/1 vs HTTP/2, etc). I’m happy to systematize it, I just generally don’t know my way around how to use the profiling tools effectively enough to not drown in the sheer volume of output</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="349143" data-batch-url="/posts/batch_likers">
                        2
                      </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/bandit-a-pure-elixir-http-server-for-plug-websock-applications/59146/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-349143" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="349143"
                     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="349148" data-post-id="349148">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mpope" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mpope
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hm I see. Let me stew on it a bit, I’ll take a look into that suite. I’ve written suites that compare the output of two profiles to rank differences between them but I find it is less stable for “low level” programs and more meaningful for “high level” programs, such as ones that transform complex data structures.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="349148" 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/bandit-a-pure-elixir-http-server-for-plug-websock-applications/59146/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-349148" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="349148"
                     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 #16"></div>
  </section>
</div>
    <div class="postbit" id="350816" data-post-id="350816">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I tested the latest main and very happy with how exceptions, throws and exits are managed either wrapped with Plug errors or not <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20"> One thing I noticed though is that throws and exits emit <a href="https://github.com/mtrudel/bandit/blob/61d975decdf2da084c0951f30fe1891970f6bb56/lib/bandit/telemetry.ex#L193-L207" rel="noopener nofollow ugc">neither</a> <code>stop</code> nor <code>exception</code> telemetry events. Do you think they should? I’m investigating logging off of Bandit telemetry events and having those events in addition to <code>kind</code>, <code>reason</code> and <code>stacktrace</code> metadata would allow me to properly log crash reason.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="350816" 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/bandit-a-pure-elixir-http-server-for-plug-websock-applications/59146/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-350816" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="350816"
                     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 #17"></div>
  </section>
</div>
    <div class="postbit" id="351116" data-post-id="351116">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mtrudel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mtrudel/120/28190_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mtrudel
                      <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 class="user-title">
									<span>Creator of Bandit</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="martosaur" data-post="18" data-topic="59146">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/martosaur/48/38317_2.png" class="avatar"> martosaur:</div>
<blockquote>
<p>One thing I noticed though is that throws and exits emit <a href="https://github.com/mtrudel/bandit/blob/61d975decdf2da084c0951f30fe1891970f6bb56/lib/bandit/telemetry.ex#L193-L207" rel="noopener nofollow ugc">neither</a> <code>stop</code> nor <code>exception</code> telemetry events. Do you think they should?</p>
</blockquote>
</aside>
<p>Yes  I do. I’ll get that done up for the next release.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="351116" 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/bandit-a-pure-elixir-http-server-for-plug-websock-applications/59146/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-351116" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="351116"
                     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 #18"></div>
  </section>
</div>
    <div class="postbit" id="351125" data-post-id="351125">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mtrudel" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mtrudel/120/28190_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mtrudel
                      <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 class="user-title">
									<span>Creator of Bandit</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>See <a href="https://github.com/mtrudel/bandit/pull/443" class="inline-onebox" rel="noopener nofollow ugc">Add support for sending telemetry events on throws and exits by mtrudel · Pull Request #443 · mtrudel/bandit · GitHub</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="351125" data-batch-url="/posts/batch_likers">
                        3
                      </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/bandit-a-pure-elixir-http-server-for-plug-websock-applications/59146/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-351125" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="351125"
                     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 #19"></div>
  </section>
</div>
    <div class="postbit" id="352881" data-post-id="352881">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hello,</p>
<p>We have that test in out suite to ensure our http client (based on req) will return transport errors correctly:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">    base =
      mock_http_server(fn "/test", conn -&gt;
        send(conn.private.parent, :called)
        exit(:normal)
      end)

    assert {:error, %Req.TransportError{reason: :closed}} = send_post(retry: :transient, retry_delay: 1)

    for _ &lt;- 1..4, do: assert_receive(:called)
</code></pre>
<p>I could give some details about the implementation but basically we used <code>exit(:normal)</code> to force the connection to close. The function above is more or less the plug given to Bandit.</p>
<p>With the last update of Bandit, this returns a 500 error instead. Is there a simple way, callable from this test, to force the connection to close?</p>
<p>Thank you.</p>
<p>Edit: I did <code>Process.exit(conn.owner, :kill)</code> and it seems to work but I am not sure it’s very clean <img src="https://forum.elixirforum.com/images/emoji/apple/grimacing.png?v=15" title=":grimacing:" class="emoji" alt=":grimacing:" 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="352881" 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/bandit-a-pure-elixir-http-server-for-plug-websock-applications/59146/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-352881" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="352881"
                     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 #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/59146/load_more?page=3">Load more posts</a>
</div></template></turbo-stream>