<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Andy,<div><br></div><div>I'm kind of fresh to Erlang and wrote a standalone Web Socket server as a learning project. Just out of curiosity, would you mind to run your tests against my implementation just to get an idea if I'm on the right track?</div><div><br></div><div><a href="https://github.com/rodaebel/ewsd">https://github.com/rodaebel/ewsd</a></div><div><br></div><div>$ cd ewsd;</div><div>$ make</div><div>$ bin/ewsd</div><div><br></div><div>The default handler just echoes incoming Web Socket messages.</div><div><br></div><div>Thanks in advance,</div><div>Tobias</div><div><br><div><div>On May 31, 2011, at 10:26 AM, Andy W. Song wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">1400+2 WebSocket packet size is OK. Packet rate stays the same. CPU usage goes up from 24% to 37%.<div><br></div><div>CPU usage proportion to packet size is not a good sign. handle_data() function will traverse the list to find 255, which is low efficient. Can it be improved?</div>
<div><br></div><div>Regards</div><div>Andy<br><br><div class="gmail_quote">On Tue, May 31, 2011 at 4:08 PM, Andy W. Song <span dir="ltr"><<a href="mailto:wsongcn@gmail.com">wsongcn@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I guess Misultin's handle_data function has some problem if TCP packets are large, perhaps larger than ethernet MTU. <div><br></div><div>If I use 1536+2 WebSocket packet size, I got follow error form Misultin(I fill up char 'M' with my packet):</div>
<div><br></div><div><div>http process <0.515.0> has died with reason: {function_clause,</div><div> [{misultin_websocket,</div><div> handle_data,</div>
<div> ["MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM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MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM",</div>
<div> [],#Port<0.1012>,<0.516.0>,</div><div> http,true,<0.40.0>]},</div><div> {misultin_websocket,connect,4},</div>
<div> {misultin_http,handle_data,9}]}, removing from references of open connections</div><div><div></div><div class="h5"><br><div class="gmail_quote">On Tue, May 31, 2011 at 2:18 PM, Andy W. Song <span dir="ltr"><<a href="mailto:wsongcn@gmail.com" target="_blank">wsongcn@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I installed R14B03. <br><div><br></div><div>I'm disappointed with my Erlang WebSocket client's performance. So I wrote a C version using libev, code attached.</div>
<div>Usage:</div><div>./new A B C</div><div>A/B/C have the same meaning of Erlang client.</div>
<div><br></div><div>Here is the result with my new client:</div><div><div><br></div><div>misultin_websocket_binary_example(file attached, no change to rest of Misultin)</div><div>start 519M</div><div>3.5G</div><div>CPU, with 550 Kbyte/s traffic about 23%.</div>
<div><br></div><div>misultin_websocket_example</div><div>start 519M</div><div>3.5G</div><div>CPU, with 550 Kbyte/s traffic about 25%.</div><div><br></div><div>Packet size is 512 bytes, client sends packets, server echo.</div>
<div><br></div><div>Cowboy can't pass my test this time. Connections start dropping from 20K, don't know why. </div><div><br></div><div>Regards</div><div>Andy</div><div><div></div><div><br><div class="gmail_quote">
On Mon, May 30, 2011 at 10:20 PM, Roberto Ostinelli <span dir="ltr"><<a href="mailto:roberto@widetag.com" target="_blank">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"><div>2011/5/30 Andy W. Song <span dir="ltr"><<a href="mailto:wsongcn@gmail.com" target="_blank">wsongcn@gmail.com</a>></span><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Version 14.a-dfsg-3 is what comes with Debian stable. It's on my company machine which now doesn't have internet access anymore. <div><div><br></div><div>Debian splits Erlang to a bunch of small packages. I may download a single Erlang/OTP package and install manually later on. </div>
<div><br></div><div>Thanks</div><div>Andy</div></div></blockquote><div><br>misultin has just been updated in the master branch [0.8-dev] to support binary mode.<br><br>i would be very interested if you could redo your tests using the binary example for websockets:<br>
<a href="https://github.com/ostinelli/misultin/blob/master/examples/misultin_websocket_binary_example.erl" target="_blank">https://github.com/ostinelli/misultin/blob/master/examples/misultin_websocket_binary_example.erl</a><br>
<br>let's see if loic hit the spot :)<br>
<br>r. <br></div></div>
</blockquote></div><br><br clear="all"><br></div></div><div>-- <br><div>---------------------------------------------------------------</div><div>有志者,事竟成,破釜沉舟,百二秦关终属楚</div><div>苦心人,天不负,卧薪尝胆,三千越甲可吞吴</div><br>
</div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div>---------------------------------------------------------------</div><div>有志者,事竟成,破釜沉舟,百二秦关终属楚</div><div>苦心人,天不负,卧薪尝胆,三千越甲可吞吴</div><br>
</div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div>---------------------------------------------------------------</div><div>有志者,事竟成,破釜沉舟,百二秦关终属楚</div><div>苦心人,天不负,卧薪尝胆,三千越甲可吞吴</div><br>
</div>
_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></blockquote></div><br></div></body></html>