I cloned Misultin from GitHub, the latest commit is:<div><div>commit 1ab74e3ae1d6c41f8486f798e6ff43b011e2fd97</div><div>Author: Roberto Ostinelli <<a href="mailto:roberto@ostinelli.net">roberto@ostinelli.net</a>></div>

<div>Date:   Sat Apr 23 17:33:13 2011 -0700</div><div><br></div><div>    removed unnecessary code.</div><div><br></div><div>Both Cowboy and Cowboy examples are cloned from GitHub. The last commit to Cowboy is:</div><div>
<div>
commit 5d698250b228229001ca9966a390bf1545fcd0b0</div><div>Author: Loïc Hoguin <<a href="mailto:essen@dev-extend.eu">essen@dev-extend.eu</a>></div><div>Date:   Mon May 9 22:01:31 2011 +0200</div></div><div><br></div>

<div>My change is attached.</div><div><br></div><div>Configuration:</div><div>Machine 1: run Cowboy or Misultin, ip address 30.0.1.1</div><div>Machine 2: run client code, ip address 30.0.1.X, X=2~50, config it by "for ((x=2; x<50; x++)); do ip addr add 30.0.1.$x/24 dev eth0; done"</div>

<div><br></div><div>My machine info(Both machines are identical VMware VMs):</div><div>Debian GNU/Linux 6.0.1 (squeeze)</div><div>2.6.32-5-amd64</div><div>Erlang R14A (erts-5.8).</div><div><br></div><div>A little more about Misultin, when it's running, each Websocket connect maps to two processes:</div>

<div><div><0.632.0>             erlang:apply/2                         343       50    0</div><div>                      erlang:hibernate/3                       0</div><div><0.633.0>             erlang:apply/2                          18     1410    0</div>

<div>                      erlang:hibernate/3                       0</div></div><div>The second one is the one with TCP link.</div><div><br></div><div>Thanks</div><div>Andy</div><br><div class="gmail_quote">On Sun, May 29, 2011 at 10:38 PM, Roberto Ostinelli <span dir="ltr"><<a href="mailto:roberto@widetag.com">roberto@widetag.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote">2011/5/29 Andy W. Song <span dir="ltr"><<a href="mailto:wsongcn@gmail.com" target="_blank">wsongcn@gmail.com</a>></span><div class="im">

<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Hi, <div><br></div><div>I want to build a C1000K test and see how Erlang performs. </div><div><br></div><div>Here is the start: Cowboy vs Misultin on WebSocket. <br clear="all">Both of them support WebSocket out of box. I use code examples from <a href="https://github.com/extend/cowboy_examples" target="_blank">here</a> and <a href="https://github.com/ostinelli/misultin/wiki/ExamplesPage" target="_blank">here</a>. Both are very simple echo servers. I added erlang:hibernate/3 call into to both Cowboy and Misultin's WebSocket handler loop to save memory.</div>




<div><br></div><div>The client code is attached which I modified from <a href="https://github.com/MiCHiLU/erlang_websocket" target="_blank">this one</a>. It's a quick hack with a fixed request and doesn't really do the handshake. </div>




<div>run the client by 'sample_client:start(A,B,C)'. </div><div>A - number of local IP address you want to use. </div><div>B - number of connections per IP</div><div>C - base port number per IP. </div><div>I started with A=20, B=10000 because I don't have that much of memory. </div>




<div><br></div><div>What I found:</div><div>1. with 200K connections, my client's Erlang instance takes about 2.2G residence memory, about the same for Cowboy and 3.8G for Misultin.</div><div>2. When number of connections is higher than 30K, Cowboy's CPU usage is going up and I start to see gen_tcp:connect times out. Misultin's CPU usage is pretty consistent and doesn't cause client time out.<br>


</div></blockquote></div><div><br><br>please provide complete code to reproduce these tests, environment specifications, and configuration settings. i don't see why misultin's memory usage should have this much difference and would like to understand better. i'm currently keeping two distinct ets tables for open tcp connections and open websocket ones, so that could be a spot but is currently the only one which i can think of.<br>


<br>very good to see that misultin is being CPU consistent all the way through and not timing out on new connections.<br><br>r.<br></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div>---------------------------------------------------------------</div><div>有志者,事竟成,破釜沉舟,百二秦关终属楚</div><div>苦心人,天不负,卧薪尝胆,三千越甲可吞吴</div><br>
</div>