[erlang-questions] Erlang in the mist

Peter Sabaini peter@REDACTED
Fri Dec 11 21:00:59 CET 2009


On Fri, 2009-12-11 at 11:26 +0100, Joe Armstrong wrote:
> I want to build an Erlang mist.
> 
> I want to experiment with "many" Erlangs
> on one machine (note *not* distributed Erlang).
> 
> So I need to be able to start and stop the Erlangs and manage them.
> 
> Questions:
> 
>    - Anybody got any code that does this?

FWIW, I dug up and cleaned a Python script I used for mass starting
Erlang VMs. I uploaded it to
http://sabaini.at/src/mass-start-erl.py 

Use it like this:
% python2.6 mass-start-erl.py -c 20 -b /usr/local/bin/erl \
  -e "+B -noinput -run erlangtest start 2000"

This would start 20 VMs, running "erlangtest:start(2000)". 

Some usage info (mail probably breaks formatting, sorry):
% python2.6 mass-start-erl.py -h
Usage: mass-start-erl.py [options]

Options:
  -h, --help            show this help message and exit
  -c STARTNODES, --start-nodes=STARTNODES
                        number of nodes to start, default: 10
  -l LOGFN, --logfn=LOGFN
                        log output to LOG
  -m, --node-log        log messages go to one file per VM, default: use
                        single file (line buffered)
  -n NODENAME, --node-name=NODENAME
                        template for nodename of the form 'n-%s', where
%s is
                        replaced with a counter; if unset, node starts
without
                        a name
  -b ERLBIN, --erlbin=ERLBIN
                        path to erlang binary, default: /usr/bin/erl
  -e ERLOPTIONS, --erlopts=ERLOPTIONS
                        options passed verbatim to the erl binary (dont
forget
                        to quote), defaults to '+B -noinput', disabling
                        reading from stdin and Erlangs signal handling
  -t TIMETOLIVE, --time-to-live=TIMETOLIVE
                        kill VMs after timeout seconds, default: live
forever
  -s SLEEP, --sleep=SLEEP
                        slow startup: sleep seconds between VM starts,
default



I'm entirely unsure if the script works on non-Unices, and it's probably
buggy :-)

>    - How many Erlangs per Gigabyte can I start? (assume they just
> start and do nothing)

On my box I (Linux 2.6, 64bit, 6Gb RAM, 8Gb swap) I've run 200 nodes
without much trouble.

>    - Where does standard output go when there is nobody to watch?

With the script above, I either log everything (stdout, stderr) to one
file or open a logfile for each VM

peter.

> 
> /Joe
> 
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20091211/962b7e02/attachment.bin>


More information about the erlang-questions mailing list