Using Erlang as a web stress tool

Sean Hinde <>
Mon Jun 18 12:16:45 CEST 2001


> 
> I'm considering building a web application testing tool using Erlang.

Great!

> What I am thinking is, modeling each simulated user as a Erlang
> process, and each browser connection as a Erlang process.  Thus for
> 400 simulated users simulating Netscape we have 2000 processes.  (4
> browser connections per user.)
> 
> Now since I have a quad CPU machine, I would most likely split these
> evenly into 4 nodes, leaving 500 processes per node.  Most likely easy
> work for Erlang.

Yes, we use a similar configuration in a couple of our systems.

> The question is, could a single Erlang node handle 400 concurrent
> TCP/IP connections to the server(s) being tested?  Does anyone think
> that I'm better off doing this in C/C++ where I have direct access to
> poll (and friends)?

The answer to this is abslutely yes! The situation where there appears to be
some delay in responding to inputs is restricted to applications where not
much is going on and the emulator seems to wait up to a millisecond (!)
before doing poll or select again.  You would not notice this at all in your
application - it will appear to fly..

> And the second question is, if I'm in Erlang, will using binaries slow
> me down due to the shear number of binaries being created and released
> from network traffic?  I realize all of the binaries reside 
> in the same
> memory heap, and aside from passing the data from the network 
> socket to
> the browser connection process, the data won't get moved around
> anywhere.

Binaries are extremely efficient in Erlang. You should be able to easily
saturate your LAN connection by pumping binaries out of an Erlang node.

> We're talking doing 100-200 HTTP requests per second by each node
> (making 400-800 total for the machine).  Some of those requests will 
> be able to recycle the TCP stream via HTTP KeepAlive, others 
> won't.  But
> at least 100 new TCP streams will be created (and closed) per second.

This sounds pretty reasonable. It should be quite easy to mock up a quick
test arrangement and see just how fast you can make it go.

> BTW, the Erlang nodes are most likely to run on a Windows NT 
> 4.0 Server
> system, in case that makes any difference.

I've found broadly similar performance between equivalent processor speeds
across NT and Solaris.

> Just thought I'd ask.  :-)

Ask away, and enjoy!

- Sean



NOTICE AND DISCLAIMER:
This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.




More information about the erlang-questions mailing list