Hi Martin,
nproc meets exactly my needs: a simple lwt-friendly interface to dispatch function calls on a pool of processes that run on the same machine. I have only one concern, that should probably be discussed on the ocsigen list, that is I wonder if it is okay to fork the process running the ocsigen server. I think I remember warnings on having parent and children processes sharing connections/channels but it's really not clear to me.
Thanks a lot for your answer!
ph.

[Off-topic] PS I understand your remark on the use of the word slave, be assured that I did not mean to hurt anyone's feelings. However I'm affraid replacing slave by worker does not make the whole expression sound better, as it implies calling a worker's boss 'master'. This is also a bit creepy to me. Maybe it's enough to recall that we are talking about processes. Or go for a more peaceful context, music, and call this a conductor/performer architecture :o)?



2013/3/26 Martin Jambon <martin.jambon@ens-lyon.org>
On 03/26/2013 07:29 AM, Philippe Veber wrote:
Dear all,

I'm developping an ocsigen website doing some scientific calculations.
Up to now, the calculations were done in the same process that runs the
server. In order to gain in scalability (and maybe stability too), I
would like to run those calculations in a separate (pool of)
process(es). As this is a pretty typical setup, I guess quite a few
people have already done that. So I'd like to hear some suggestions on
what library to use in this particular context. It seems to me that the
release library [1] should do the job and is lwt-friendly, but there are
maybe other good options?

I wrote and used a library called Nproc about a year ago. It lets you create (Nproc.create) a pool of N processes, to which you can submit (Nproc.submit) computations of any type quasi-magically - just make sure any big environment required for the computation is not copied with each closure that you send to the workers. The submodule Nproc.Full provides a more advanced interface that lets each worker process have its own local environment.

  https://github.com/MyLifeLabs/nproc

I haven't used Nproc in a while but it was working fine and should still work.


Martin


--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs