[erlang-questions] Re: Unicast 20k messages, $500-$1000 bounty
Joel Reymont
joelr1@REDACTED
Thu Jul 16 12:29:22 CEST 2009
Some notes on the architecture...
janus_acceptor spawns transport which initializes janus_flash.
janus_flash:start sends a token to the client.
janus_flash will also initialize a client_proxy. Think of client_proxy
as the session process.
Upon receipt of the token, client will try to subscribe and wait for
subscription confirmation. Client will start a 5s timer once
subscription is confirmed by the server. Client expects to receive its
packet before the timer expires.
topman maps subscription topics to pubsub instances keeping track of
subscribers.
pubsub keeps client_proxy (subscriber) pids in ETS and monitors
subscribers to automatically unsubscribe if they die.
pubsub will traverse the client_proxy pids in ETS once a publish
request is received and gen_server:cast the message to each
client_proxy. Message will be sent by client_proxy to the transport
instance connected to the socket and that will send the message to the
socket itself.
bot will launch as many instances of the flashbot client as required.
It then waits for bots to finish and calculates statistics.
launcher takes care of starting bots on the node where it's running.
The client load can actually be spread across multiple instances.
Simply connect the nodes and invoke launcher:start(true) on each one.
Try pg2:get_members(launcher) on the master bot node to make sure you
have multiple bot launcher nodes.
flashbot connects, subscribes and waits for its message.
Note that it does not matter how long the setup time takes, the
critical path is in pubsub:publish and, perhaps, in the parsing and
handling of messages by flashbot.
Thanks, Joel
---
Mac hacker with a performance bent
http://www.linkedin.com/in/joelreymont
More information about the erlang-questions
mailing list