When I use their benchmark here:<br>https://github.com/yesodweb/benchmarks<br>(as mentioned here: http://www.yesodweb.com/blog/2011/03/preliminary-warp-cross-language-benchmarks)<br>to test elli, here:<br>https://github.com/knutin/elli<br><br>I get 99000 req/s.  The (httperf) test of CloudI's http_req erlang service using cowboy gives 13358 req/s.  cowboy has more features, so that can explain the extra average latency which limits throughput. <br><br>If you want to understand why their benchmark isn't decent, read this:<br>http://www.mnot.net/blog/2011/05/18/http_benchmark_rules<br><br>So, if you want something faster in Erlang, you could use ellis, however, keep in mind their testing isn't long enough to be meaningful (due to garbage collection and other impacts on performance).<br><br><br>On Tuesday, June 25, 2013 10:38:25 AM UTC-7, BM Kim wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Damian DobroczyƄski <qoocku <at> <a href="http://gmail.com" target="_blank">gmail.com</a>> writes:<p>> <br>> W dniu 25.06.2013 13:51, BM Kim pisze:<br>> > Hi folks,<br>> ><br>> > First of all, I want to apologise for my poor english skills,<br>> > since english is not my first language, but I'll try my best<br>> > to formulate my quesions as clear as possible.<br>> ><br>> > Second, I've just begun to learn erlang, so if I'm asking<br>> > obvious "noob" questions I apologise for that too in advance...<br>> ><br>> > Anywho, now to my actual question:<br>> ><br>> > I am planning to write a high-performance server application in erlang,<br>> > which will primarily handle HTTP requests. After some reseach with <br>google,<br>> > I narrowed down my choices to cowboy, misultin and mochiweb and decided<br>> > to go with the cowboy library first...<br>> ><br>> > Looking at some tutorials, I've quickly built a small server capable of<br>> > serving static files and was eager to see first benchmark-results...<br>> > I've also built a small Haskell server using Warp library to compare it<br>> > with erlang's cowboy...<br>> ><br>> > But my first impression was, that my cowboy server is much much slower <br>than<br>> > expected when serving static-files and after some research I found a <br>presentation<br>> > of the cowboy's author claiming that cowboy shouldn't be used for <br>serving<br>> > static-files. So I modified the server code, so that it replies to every<br>> > request with in-memory 4Kb binary blob and compared it with my haskell <br>warp<br>> > server serving 4kb static file...<br>> ><br>> > this is my simple cowboy's http handler:<br>> ><br>> > ------------------------------<wbr>------------------------------<wbr>----------<br>> ><br>> > blob() -><br>> >     [<<0:8>> || _ <- lists:seq(1,4096)].<br>> <br>> First, try to replace blob/0 function with this:<br>> <br>>   blob() -> <<0:(4096*8)>>.<br>> <br>> Then, restart the test and report ;)<br>> </p><p><br>Hi,</p><p>Thank you very much for pointing out the obvious mistake...<br>After correcting it, I got improvement from 5940 req/s to 8650 req/s...</p><p>But still much slower than the haskell warp-server, which has throughput<br>of 38000 req/s...</p><p>But I have another question regarding blob/0. Is it going to be evaluated<br>only once (like GHC would do) since it is a pure expression? I'm not<br>so sure, since erlang is not pure and any function can have side-effects<br>which you can't mark as with the IO monad in Haskell...</p><p></p><p>______________________________<wbr>_________________<br>erlang-questions mailing list<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="pzvqxTu56jcJ">erlang-q...@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br></p><p></p><p></p><p></p><p></p><p></p><p></p></blockquote>