[erlang-questions] Measuring Erlang Communication Overhead?
Fri Jun 24 22:03:05 CEST 2011
> We put together a system which consists of a few thousand processes
> each of which holds a rule. A request comes in with a context, the
> context is sent to a subset of the processes (although this could be
> close to a thousand of them), which combines the context and the rule
> and sends back a result (both sends are done in a non-blocking fashion
> and a gen_fsm recieves all the results and collates then).
Since your unit of parallelization is a request, why not have a single
process per request, which runs through determining the rules and
executing them and returning the result? Does each rule have a lot of
state or need information from more than one request?
Your request is blocked until the results are all in anyway, so you
might as well run all the results in the request's process to begin
with. If each rule has lots of its own state, you could use ETS to
manage that instead of processes. If rules depend on multiple
requests, then I'm not sure what to suggest.
More information about the erlang-questions