<div class="gmail_quote">2011/5/29 Andy W. Song <span dir="ltr"><<a href="mailto:wsongcn@gmail.com">wsongcn@gmail.com</a>></span><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><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>