From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id E2C187EE7A for ; Thu, 28 Mar 2013 13:29:11 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.126.187; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.126.187; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@moutng.kundenserver.de designates 212.227.126.187 as permitted sender) identity=helo; client-ip=212.227.126.187; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@moutng.kundenserver.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYAALE2VFHU4367jWdsb2JhbABDgzqsWZILgQMWDgEBAQEHCwsJEgUlgh8BAQQBJxMyAggDBSgTXQkEDgYTCQkJh2cDCQoItQIDiWUViQGFXCYHg0ADjhmFCIRlknQ X-IPAS-Result: ArYAALE2VFHU4367jWdsb2JhbABDgzqsWZILgQMWDgEBAQEHCwsJEgUlgh8BAQQBJxMyAggDBSgTXQkEDgYTCQkJh2cDCQoItQIDiWUViQGFXCYHg0ADjhmFCIRlknQ X-IronPort-AV: E=Sophos;i="4.84,925,1355094000"; d="scan'208";a="10846459" Received: from moutng.kundenserver.de ([212.227.126.187]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 28 Mar 2013 13:29:11 +0100 Received: from office1.lan.sumadev.de (dslb-094-219-220-119.pools.arcor-ip.net [94.219.220.119]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0LsuhK-1UoWBY1AFe-011yWL; Thu, 28 Mar 2013 13:29:10 +0100 Received: from samsung (ip-5-146-55-186.unitymediagroup.de [5.146.55.186]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id DB582C00D0; Thu, 28 Mar 2013 13:29:09 +0100 (CET) Date: Thu, 28 Mar 2013 13:29:09 +0100 From: Gerd Stolpmann To: Philippe Veber Cc: caml users In-Reply-To: (from philippe.veber@gmail.com on Thu Mar 28 10:18:28 2013) X-Mailer: Balsa 2.4.11 Message-Id: <1364473749.14693.3@samsung> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-Provags-ID: V02:K0:p9o/qLYq5AD7HbMfL0ogFV5BGL0uTeYMoaMGpD8ohgf dSUYMDJd9YF6iSUrXh/if6mzg9nSglI6ZRPo8Oy4D2cuFkJlAG xClI1FScOPlEIcIP22VUMkLZVzf+ZfNDYTryf//2kxOpLodUze 3Vam/CZDGzC7cJ2eYF1trqQoFKQWY5xbx3sNYv5oUmlRaohOTI YZ0ZBXg1L+pipfLhPjnu33xj708nlWSwKPZyJO4q/FxrJwwYFk Mv0tIVxYWuYHnkQa3kqkRp6xzYcGYLrDxiCBOXudUkqvtkK5zb ag/seIoTC03lZ64F3NcG+6GQfHtyptMwGcEnzOKwPn7tc6J2oL lvwm05YBotHYqzL2LEVw= Subject: AW: [Caml-list] Master-slave architecture behind an ocsigen server. Am 28.03.2013 10:18:28 schrieb(en) Philippe Veber: > Thanks for your input Gerd! As I understand it, your suggestion is to=20= =20 > have > an RPC server (based on netplex) doing the actual calculations. That=20= =20 > 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=20= =20 > call > should be lwt-friendly. Digging in ocamlnet documentation, it seems=20=20 > that > could be achieved using [Rpc_simple_client.call] wrapped inside a > [Lwt_preemptive.detach]. I guess RPC would be most convenient here - it supports a server mode=20=20 where the child processes accept the new connections (btw, if you don't=20= =20 want to deal with the RPC encoding stuff (i.e. XDR), just marshal the=20=20 OCaml value as string, and use RPC functions that are declared as=20=20 string->string). A sample program would the "finder" service here: http://projects.camlcity.org/projects/dl/ocamlnet-3.6.3/examples/rpc/finder Gerd > This would be more complex than using nproc, but if it is effectively > dangerous/impossible to fork the ocsigen server process (as required=20= =20 > to use > nproc), that seems a feasible solution for me --> I might ask a=20=20 > couple more > questions later then. >=20 > Danke sehr! > ph. >=20 >=20 >=20 > 2013/3/27 Gerd Stolpmann >=20 > > Am Dienstag, den 26.03.2013, 15:29 +0100 schrieb Philippe Veber: > > > Dear all, > > > > > > I'm developping an ocsigen website doing some scientific=20=20 > calculations. > > > Up to now, the calculations were done in the same process that=20=20 > runs > > > the server. In order to gain in scalability (and maybe stability=20= =20 > 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=20=20 > few > > > people have already done that. So I'd like to hear some=20=20 > suggestions on > > > what library to use in this particular context. It seems to me=20=20 > 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=20=20 > Netplex: > > > > > >=20=20 > http://projects.camlcity.org/projects/dl/ocamlnet-3.6.3/doc/html-main/Int= ro.html#netplex > > > > I've no good recipe, though, how to plug in service processors that=20= =20 > base > > on lwt (well, there is an adaptor in Ocamlnet for lwt - Uw_lwt -=20=20 > but I > > wouldn't know what to do on the Ocsigen side, but maybe worth > > exploring). > > > > Ocamlnet also includes other mechanisms that are generally=20=20 > interesting > > for compute stuff, namely Netmulticore for exploiting several cores=20= =20 > on > > the same machine with fast shared memory architecture, and RPC for > > distributing computations in a network. Both are extensions of=20=20 > 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. > > ------------------------------------------------------------ > > > > >=20 > -- > 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 --=20 ------------------------------------------------------------ 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 ------------------------------------------------------------=