[erlang-questions] Cowboy vs Misultin

Andy W. Song <>
Sun May 29 15:59:11 CEST 2011


Hi,

I want to build a C1000K test and see how Erlang performs.

Here is the start: Cowboy vs Misultin on WebSocket.
Both of them support WebSocket out of box. I use code examples from
here<https://github.com/extend/cowboy_examples> and
here <https://github.com/ostinelli/misultin/wiki/ExamplesPage>. 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.

The client code is attached which I modified from this
one<https://github.com/MiCHiLU/erlang_websocket>.
It's a quick hack with a fixed request and doesn't really do the handshake.
run the client by 'sample_client:start(A,B,C)'.
A - number of local IP address you want to use.
B - number of connections per IP
C - base port number per IP.
I started with A=20, B=10000 because I don't have that much of memory.

What I found:
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.
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.

Cowboy's code is simpler and it only uses one process per WebSocket
connection. I really like to find out why its CPU load is high. I'm new to
Erlang and don't really know how. Erlang manual mentions about etop, but my
installation on Linux doesn't have that etop script. I do find that etop
module has a start/1 function but I don't know what I should input for the
parameter. The Erlang menu doesn't say a word about this function.

Thanks
Andy

-- 
---------------------------------------------------------------
有志者,事竟成,破釜沉舟,百二秦关终属楚
苦心人,天不负,卧薪尝胆,三千越甲可吞吴
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110529/20a07340/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: websocket_client2.erl
Type: text/x-erlang
Size: 6177 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110529/20a07340/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample_client.erl
Type: text/x-erlang
Size: 1114 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110529/20a07340/attachment-0001.bin>


More information about the erlang-questions mailing list