<div dir="ltr">I don't know if this is a stupid idea, but if you are load testing is it possible that there is always around 40KB of data in flight per process? If you stop load testing and force a garbage collection in each process, does the figure reduce? Just a WAG.<br>
<br><div class="gmail_quote">On Thu, Sep 18, 2008 at 11:19 AM, Paul Oliver <span dir="ltr"><<a href="mailto:puzza007@gmail.com">puzza007@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br>
<br>
I have a simple echo server built on top of mochiweb_socket_server<br>
(<a href="http://mochiweb.googlecode.com/svn/trunk/src/mochiweb_socket_server.erl" target="_blank">http://mochiweb.googlecode.com/svn/trunk/src/mochiweb_socket_server.erl</a>):<br>
<br>
-define(DEFAULTS, [{ip, "<a href="http://127.0.0.1" target="_blank">127.0.0.1</a>"}, {loop, {?MODULE, loop}}, {name,<br>
?MODULE}, {port, 8888}, {max, 100000}]).<br>
<br>
start() -><br>
    start(?DEFAULTS).<br>
<br>
start(Options) -><br>
    mochiweb_socket_server:start(Options).<br>
<br>
loop(Socket) -><br>
    case gen_tcp:recv(Socket, 0) of<br>
        {ok, Data} -><br>
            gen_tcp:send(Socket, Data),<br>
            loop(Socket);<br>
        {error, closed} -><br>
            ok<br>
    end.<br>
<br>
I'm load testing and have found that the memory used in the echo<br>
server per connected client is approximately 40K.  I've tried setting<br>
sndbuf and recbuf to 1024 respectively (hardcoded in<br>
mochiweb_socket_server), but this doesn't seem to make a difference.<br>
Does anybody know where I should be looking to reduce this figure?<br>
<br>
Thanks,<br>
Paul.<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
<br>
</blockquote></div><br></div>