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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-post-not-found" data-username="sasajuric" data-post="37" data-topic="5036">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/48/991_2.png" class="avatar"><a href="https://forum.elixirforum.com/t/techempower-benchmarks-round-14/5036/37" rel="nofollow">TechEmpower Benchmarks Round 14</a></div>
<blockquote>
<p>A proper way to optimize this IMO is to reduce the number of db roundtrips, which is unfortunately not permitted by the rules.</p>
</blockquote>
</aside>
<p>Looking through some of the other tests, it does look like many are taking steps to ensure that the same database connection is used to burn through the entire set of requests. Doesn’t Ecto hand it back after every call in the current setup? Is there a way to avoid that? Ecto.Multi maybe? I saw the tests for Ruby using Sequel were all wrapped in <code>DB.synchronize</code>.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="35239" 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/techempower-benchmarks/171/53">Post #52</a>
	                </div>
	            </div>
              <div id="likers-container-35239" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="35239"
                     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 #52"></div>
  </section>
</div>
    <div class="postbit" id="35246" data-post-id="35246">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I don’t mind benchmarks. They can be useful. But I don’t like how most of the benchmarks out there are done because they measure the wrong thing!</p>
<p>I think TE benchmarks have the right idea. They test against more than just the HTTP layer (i.e database, data serialization, etc) but they measure the wrong thing. They have the wrong test setup to give you an idea.</p>
<p>And phoenix and erlang does great in these benchmarks! If you analyze the results some of the benchmarks that beat phoenix did it once. For a particular 15 second period, for a particular (low) concurrency level.</p>
<p>Unless the framework consistently give good result for the various concurrency levels and benchmarks something is wrong with either the test or the framework and I would discard the result at once. If the results are jumping all over the place I would discard the result. A max latency that is too high is also something I would consider a warning flag.</p>
<p>If you sort by <strong>max</strong> latency phoenix is:</p>
<ul>
<li>phoenix is <span class="hashtag-raw">#6</span> for json</li>
<li>phoenix is <span class="hashtag-raw">#2</span> for single query</li>
<li>It drops down a bit on the others but still higher than the average (why do they use average? it should never be used.)</li>
</ul>
<p>They test a closed system and not the open web. This is a very important distinction. Testing against a closed system and comparing with an open system means you will have the “coordinated omission” problem. I.e the client and server work together to make sure the server isn’t overloaded. The open web doesn’t work like this. Clients will not stop sending requests because another request is slow.</p>
<p>If someone wants to re-run the TE benchmarks please:</p>
<ul>
<li>Client framework. Either use full simulator (I think tsung will work here) or use a benchmark tool that can work with coordinated omission (wrk2). The difference is massive!</li>
<li>Use much higher concurrency. For the open web, if you are serving 300,000 request per second I can tell you that your concurrency is deemed to be somewhere along the 100,000 mark at least. They test with 256.</li>
<li>Run the tests for longer time.</li>
<li>Display the full data tables, no summaries.</li>
</ul>
<p>Run these tests again with the above parameters and I will assure you phoenix will end up higher currently and it should generally outperform any ruby/python/php framework out there with a big margin.</p>
<p>If you ask me: If you test any other way for the <em>open</em> web you are wasting your time and optimising the wrong thing.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="35246" data-batch-url="/posts/batch_likers">
                        4
                      </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/techempower-benchmarks/171/54">Post #53</a>
	                </div>
	            </div>
              <div id="likers-container-35246" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="35246"
                     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 #53"></div>
  </section>
</div>
    <div class="postbit" id="35249" data-post-id="35249">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>In general, the feeling i get for having followed multiple round of tentative by phoenix people to work on the TE benchmark :</p>
<ul>
<li>It is really really hard to understand what is happening in these benchmark</li>
<li>it is really really hard to get anything that look like perf data that would allow to analyse and solve what makes something slow</li>
<li>The TE team tend to modify the code of a particular framework when they want, breaking it regularly</li>
<li>In general, getting anytime of information from the TE team is super hard.</li>
</ul>
<p>So if you want to fix it, go for it. But i prefer to fix a complex problem or help build the next Orleans for the BEAM. It will results with far more net result for the time invested.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="35249" 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/techempower-benchmarks/171/55">Post #54</a>
	                </div>
	            </div>
              <div id="likers-container-35249" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="35249"
                     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 #54"></div>
  </section>
</div>
    <div class="postbit" id="35254" data-post-id="35254">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sasajuric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/120/991_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sasajuric
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Elixir In Action</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-post-not-found" data-username="anthonyb" data-post="43" data-topic="5036">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/f9ae1b/48.png" class="avatar"><a href="https://forum.elixirforum.com/t/techempower-benchmarks-round-14/5036/43" rel="nofollow">TechEmpower Benchmarks Round 14</a></div>
<blockquote>
<p>The argument I hear in favor of Phoenix is that it doesn’t require the typical tradeoff between productivity/developer happiness and speed/reliability. So, the claim is being made that its technical performance (both reliability and speed) is meaningfully superior to that of other options, and that technical performance does indeed matter. It’s hard to make such claims convincingly without doing some measurement (and comparison).</p>
</blockquote>
</aside>
<p>Yeah, I believe that this selling point is poorly worded. The “speed” is a very relative thing. It depends on your needs, and your requirements. Sometimes you don’t care about milliseconds, other times a single millisecond can be an eternity.</p>
<p>I’d say instead that Erlang/Elixir/Phoenix doesn’t require a trade-off between productivity, fault-tolerance, and scalability, and will give you a “reasonable” speed in many cases, with the option to easily step outside of Erlang for the situations where Erlang simply doesn’t suffice.</p>
<aside class="quote no-group quote-post-not-found" data-username="anthonyb" data-post="43" data-topic="5036">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/f9ae1b/48.png" class="avatar"><a href="https://forum.elixirforum.com/t/techempower-benchmarks-round-14/5036/43" rel="nofollow">TechEmpower Benchmarks Round 14</a></div>
<blockquote>
<p>Yes, but how do you know if Elixir exhibits better fault-tolerance, stable latency, and uptime compared with other options?</p>
</blockquote>
</aside>
<p>By studying properties of the runtime and the language, and understanding what tools does it give you to help you get those properties.</p>
<p>For example, in Erlang, a process crash doesn’t disturb anything else in the system, but any other process can be notified about it. This gives you a way of isolating crashes but also to detect them and respond to them, thus allowing your systems to self-heal. Shared-nothing concurrency ensures that the failing thing doesn’t leave the garbage behind.</p>
<p>In contrast, in go, an uncaught error (panic) in a goroutine takes down the whole OS process. Shared memory means that even if you catch that error, you might still end up with an inconsistent global state, leading to other errors. Improving fault-tolerance, while certainly possible, is going to be harder in go, simply because the language doesn’t give you the kind of support Erlang gives you. This shouldn’t come as a surprise, given that Erlang was built precisely for systems which run continuously and experience as little downtime as possible.</p>
<p>For a few other interesting and unique properties of BEAM, you can also take a look at <a href="https://www.youtube.com/watch?v=5SbWapbXhKo" rel="noopener nofollow ugc">my ElixirDaze talk</a>.</p>
<aside class="quote no-group quote-post-not-found" data-username="anthonyb" data-post="43" data-topic="5036">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/f9ae1b/48.png" class="avatar"><a href="https://forum.elixirforum.com/t/techempower-benchmarks-round-14/5036/43" rel="nofollow">TechEmpower Benchmarks Round 14</a></div>
<blockquote>
<p>I was addressing your more general claim that individual measurements in isolation are useful, whereas measurements of multiple platforms under similar circumstances are not. Given that the latter can be reduced to the former, this doesn’t make sense.</p>
</blockquote>
</aside>
<p>The individual measurements can give you some hints about how you’re doing. They can also help you check whether you’re improving or degrading in performance, as you make subsequent changes. This is where a number is good. If today it’s much higher than it was yesterday, then likely some change had affected performance in a bad way.</p>
<p>In contrast, bench comparison is a very dangerous territory, because you end up reducing a stack to a number, and then choose one based on comparing numbers, completely disregarding the features it gives you.</p>
<aside class="quote no-group quote-post-not-found" data-username="anthonyb" data-post="43" data-topic="5036">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/f9ae1b/48.png" class="avatar"><a href="https://forum.elixirforum.com/t/techempower-benchmarks-round-14/5036/43" rel="nofollow">TechEmpower Benchmarks Round 14</a></div>
<blockquote>
<p>Just substitute “stability” for “raw performance” in all of your arguments against comparative measurements, and it would seem we also have no way of determining that Elixir/Phoenix is generally any more stable or reliable than any other option.</p>
</blockquote>
</aside>
<p>I wasn’t suggesting reducing this property into a number. Instead, I’m saying that we should focus more on how the tech helps us with some difficult challenges. Fault-tolerance is one such challenge, which is both required and  difficult even in a moderately complex system. Therefore, the question is how can tech help us deal with this challenge from the day one, when things are always simple, all the way to production when things are never simple.</p>
<p>That’s definitely not an exact science, so it’s always a bet, but a deeper look into what the tech gives you can definitely help you make a more educated guess. In contrast, a simple comparison of two numbers is IMO as good as throwing a coin <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>
<aside class="quote no-group quote-post-not-found" data-username="anthonyb" data-post="43" data-topic="5036">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/f9ae1b/48.png" class="avatar"><a href="https://forum.elixirforum.com/t/techempower-benchmarks-round-14/5036/43" rel="nofollow">TechEmpower Benchmarks Round 14</a></div>
<blockquote>
<p>Presumably for each new project, we must build a realistic proof of concept in Elixir and several other stacks to see how each perform in that particular unique system</p>
</blockquote>
</aside>
<p>I’m not suggesting doing it for every project. I did it once, the first time I considered Erlang. Once that was followed by the success in production, and my deeper understanding of the tech, I got a much higher confidence about the stack.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="35254" 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/techempower-benchmarks/171/56">Post #55</a>
	                </div>
	            </div>
              <div id="likers-container-35254" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="35254"
                     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 #55"></div>
  </section>
</div>
    <div class="postbit" id="35257" data-post-id="35257">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sasajuric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/120/991_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sasajuric
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Elixir In Action</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-post-not-found" data-username="anthonyb" data-post="43" data-topic="5036">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/f9ae1b/48.png" class="avatar"><a href="https://forum.elixirforum.com/t/techempower-benchmarks-round-14/5036/43" rel="nofollow">TechEmpower Benchmarks Round 14</a></div>
<blockquote>
<p>It sounds like you believe the answer is no and that if these same tech stacks were used in real-world scenarios, the relevant performance metrics would show little correlation with the TE benchmark results (i.e., you would expect to see essentially a random permutation of the rank ordering shown on the site).</p>
</blockquote>
</aside>
<p>I forgot to address this point, so just want to confirm that this is precisely what I’m saying. Regardless of the fact that I believe that choosing a stack amounts to way more than focusing on raw perf, my impression is that TE benches are fundamentally flawed as well as poorly conducted, so I think that their results have little correlation to what would happen in a real world scenario.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="35257" 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/techempower-benchmarks/171/57">Post #56</a>
	                </div>
	            </div>
              <div id="likers-container-35257" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="35257"
                     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 #56"></div>
  </section>
</div>
    <div class="postbit" id="35270" data-post-id="35270">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<blockquote>
<p>By studying properties of the runtime and the language, and understanding what tools does it give you to help you get those properties.</p>
</blockquote>
<p>Sure, but then the question becomes how much do these properties matter in practice (i.e., how much more reliability do they really buy, and at what cost)? Ultimately, I think you need to see real measurements to confirm expectations based on analysis. An analysis of the properties of the runtime would be less compelling if we couldn’t also point to examples like the famed nine nines of uptime. You indicated that in your own initial evaluation of Erlang, you tested it out – you didn’t pick it blindly after merely analyzing its properties.</p>
<blockquote>
<p>In contrast, bench comparison is a very dangerous territory, because you end up reducing a stack to a number, and then choose one based on comparing numbers, completely disregarding the features it gives you.</p>
</blockquote>
<p>Sure. That doesn’t mean they can’t provide value when used appropriately. I suppose the same argument could be made about comparing systems merely based on their properties/features – a particular feature may sound compelling on paper, but if it can’t be demonstrated to tip the cost-benefit scale in the right direction in practice, it has no real value.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="35270" 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/techempower-benchmarks/171/58">Post #57</a>
	                </div>
	            </div>
              <div id="likers-container-35270" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="35270"
                     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 #57"></div>
  </section>
</div>
    <div class="postbit" id="35272" data-post-id="35272">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Sounds to me like you’re a fan of the benchmarks that show Phoenix in a good light and not so much those that show it in a bad light.</p>
<p>The 2M connection is basically testing Linux.  It opens a socket, accepts connections and reads a ~1KB. The most basic TE benchmark is more representative of HTTP load than that is of websocket load. Apparently when a benchmark “demonstrates” that Phoenix doesn’t add much overhead, that’s a good benchmark. If it demonstrates that it adds a lot of overhead, well..the benchmark is flawed, or you should care more about stability, or it doesn’t represent real world examples.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="35272" 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/techempower-benchmarks/171/59">Post #58</a>
	                </div>
	            </div>
              <div id="likers-container-35272" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="35272"
                     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 #58"></div>
  </section>
</div>
    <div class="postbit" id="35273" data-post-id="35273">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-post-not-found" data-username="anthonyb" data-post="43" data-topic="5036">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/a/f9ae1b/48.png" class="avatar"><a href="https://forum.elixirforum.com/t/techempower-benchmarks-round-14/5036/43" rel="nofollow">TechEmpower Benchmarks Round 14</a></div>
<blockquote>
<p>In contrast, in go, an uncaught error (panic) in a goroutine takes down the whole OS process.</p>
</blockquote>
</aside>
<p>Wrapping the outer handler in a try/catch is neither difficult nor a challenge. Which is why net/http does it: <a href="https://github.com/golang/go/blob/master/src/net/http/server.go#L1690" class="inline-onebox" rel="noopener nofollow ugc">go/src/net/http/server.go at master · golang/go · GitHub</a></p>
<p>There’s two groups of people in this conversation about <em>performance</em>: those that think performance could be improved and those that want to talk about everything except performance.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="35273" 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/techempower-benchmarks/171/60">Post #59</a>
	                </div>
	            </div>
              <div id="likers-container-35273" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="35273"
                     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 #59"></div>
  </section>
</div>
    <div class="postbit" id="35275" data-post-id="35275">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="chrismccord" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/chrismccord/120/24233_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  chrismccord
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Phoenix</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-post-not-found" data-username="kseg" data-post="50" data-topic="5036">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kseg/48/6178_2.png" class="avatar"><a href="https://forum.elixirforum.com/t/techempower-benchmarks-round-14/5036/50" rel="nofollow">TechEmpower Benchmarks Round 14</a></div>
<blockquote>
<p>The 2M connection is basically testing Linux.  It opens a socket, accepts connections and reads a ~1KB.</p>
</blockquote>
</aside>
<p>This is just not true. Our Chanel benchmarks do more than just accept a connection. We exercise the channel protocol which spawns and isolated, concurrent process monitored by the underlying websocket transport, which is subscribed to our pubsub layer. We also put the pubsub layer thru its paces by broadcasting messages to the 2M clients.</p>
<aside class="quote no-group quote-post-not-found" data-username="kseg" data-post="50" data-topic="5036">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kseg/48/6178_2.png" class="avatar"><a href="https://forum.elixirforum.com/t/techempower-benchmarks-round-14/5036/50" rel="nofollow">TechEmpower Benchmarks Round 14</a></div>
<blockquote>
<p>Apparently when a benchmark “demonstrates” that Phoenix doesn’t add much overhead, that’s a good benchmark. If it demonstrates that it adds a lot of overhead, well..the benchmark is flawed, or you should care more about stability, or it doesn’t represent real world examples.</p>
</blockquote>
</aside>
<p>This is not a fair point. Saša has done nothing here to do mental dynamistics to make up for any apparent elixir or phoenix deficiencies. For anyone remotely adept at writing Elixir, the techmeme app is obviously poorly written, from configuration to middleware to lack of use of concurrency in the db tests, and more. My experience with them over the last two years has given me little confidence to see value in their results.</p>
<p>I’ll also note that this thread is turning unnecessarily negative, so please take care to avoid things going toxic</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="35275" data-batch-url="/posts/batch_likers">
                        9
                      </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/techempower-benchmarks/171/61">Post #60</a>
	                </div>
	            </div>
              <div id="likers-container-35275" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="35275"
                     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 #60"></div>
  </section>
</div>
    <div class="postbit" id="35276" data-post-id="35276">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="chrismccord" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/chrismccord/120/24233_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  chrismccord
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Phoenix</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>It’s designed this way because channels provide:</p>
<ol>
<li>isolated, concurrent lines of communication on the underlying multiplexed transport process. You don’t want an error in one channel to bring down the others. Likewise, you don’t want one channel to block others if doing any blocking or intensive work. Put simply, it’s designed exactly how  you’d manage other system sin the runtime – isolated concurrent processes that are supervised.</li>
<li>client reception of channel errors. If we used a single transport process and one of your channels caused a crash, you’d take out the physical connection. With our setup, clients get notified of channel crashes without taking out the connection and can rejoin the channel without the extra trip to reconnect.</li>
</ol>
<p>Yes these things require 3 processes vs 1, but our 2M benchmarks exactly show that this overhead scales. Phoenix also allows you to write your own transport that would forgo this multiplexed model. <a class="mention" href="/u/sasajuric" rel="nofollow">@sasajuric</a>’s has also done recent transport work to make things more extensible for these scenarios. That said, for the vast majority of usecaes our default approach is the way to go.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="35276" data-batch-url="/posts/batch_likers">
                        7
                      </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/techempower-benchmarks/171/62">Post #61</a>
	                </div>
	            </div>
              <div id="likers-container-35276" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="35276"
                     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 #61"></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/171/load_more?page=7">Load more posts (69 remaining)</a>
</div></template></turbo-stream>