Thanks for your input Gerd! As I understand it, your suggestion is to have an RPC server (based on netplex) doing the actual calculations. That RPC server would be called by the ocsigen server when needed (the ocsigen server is the client in that scheme). So in that schema, only the RPC call should be lwt-friendly. Digging in ocamlnet documentation, it seems that could be achieved using [Rpc_simple_client.call] wrapped inside a [Lwt_preemptive.detach]. This would be more complex than using nproc, but if it is effectively dangerous/impossible to fork the ocsigen server process (as required to use nproc), that seems a feasible solution for me --> I might ask a couple more questions later then. Danke sehr! ph. 2013/3/27 Gerd Stolpmann > Am Dienstag, den 26.03.2013, 15:29 +0100 schrieb Philippe Veber: > > 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? > > Well, I don't know whether this is an option for Ocsigen users, but > Ocamlnet includes fairly good multiprocessing support. You can run > servers that dynamically start subprocesses on demand. Look for Netplex: > > > http://projects.camlcity.org/projects/dl/ocamlnet-3.6.3/doc/html-main/Intro.html#netplex > > I've no good recipe, though, how to plug in service processors that base > on lwt (well, there is an adaptor in Ocamlnet for lwt - Uw_lwt - but I > wouldn't know what to do on the Ocsigen side, but maybe worth > exploring). > > Ocamlnet also includes other mechanisms that are generally interesting > for compute stuff, namely Netmulticore for exploiting several cores on > the same machine with fast shared memory architecture, and RPC for > distributing computations in a network. Both are extensions of Netplex, > so it is easy to integrate into a single program. > > Gerd > > > Thanks for any hint, cheers! > > > > Philippe. > > > > [1] https://github.com/andrenth/release > > > > -- > ------------------------------------------------------------ > Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de > Creator of GODI and camlcity.org. > Contact details: http://www.camlcity.org/contact.html > Company homepage: http://www.gerd-stolpmann.de > *** Searching for new projects! Need consulting for system > *** programming in Ocaml? Gerd Stolpmann can help you. > ------------------------------------------------------------ > >