caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Philippe Veber <philippe.veber@gmail.com>
Cc: caml users <caml-list@inria.fr>
Subject: AW: [Caml-list] Master-slave architecture behind an ocsigen server.
Date: Thu, 28 Mar 2013 13:29:09 +0100	[thread overview]
Message-ID: <1364473749.14693.3@samsung> (raw)
In-Reply-To: <CAOOOohSE4Srtjw6KMxTkgK4sOvmLE9Aajb+ovKGWTE=tL3c0NQ@mail.gmail.com> (from philippe.veber@gmail.com on Thu Mar 28 10:18:28 2013)

Am 28.03.2013 10:18:28 schrieb(en) Philippe Veber:
> 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].

I guess RPC would be most convenient here - it supports a server mode  
where the child processes accept the new connections (btw, if you don't  
want to deal with the RPC encoding stuff (i.e. XDR), just marshal the  
OCaml value as string, and use RPC functions that are declared as  
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  
> 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 <info@gerd-stolpmann.de>
> 
> > 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.
> > ------------------------------------------------------------
> >
> >
> 
> --
> 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



-- 
------------------------------------------------------------
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
------------------------------------------------------------

  reply	other threads:[~2013-03-28 12:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26 14:29 Philippe Veber
2013-03-26 19:02 ` Martin Jambon
2013-03-26 21:01 ` Martin Jambon
2013-03-27  1:11   ` Francois Berenger
2013-03-28  7:37   ` Philippe Veber
2013-03-28  8:47     ` Alain Frisch
2013-03-28  9:39       ` Philippe Veber
2013-03-28 10:54         ` Alain Frisch
2013-03-28 11:02       ` Anil Madhavapeddy
2013-03-28 11:23         ` Alain Frisch
2013-03-28 12:18         ` AW: " Gerd Stolpmann
2013-03-27 10:00 ` Sébastien Dailly
2013-03-28  8:34   ` Philippe Veber
2013-03-27 16:07 ` Gerd Stolpmann
2013-03-28  9:18   ` Philippe Veber
2013-03-28 12:29     ` Gerd Stolpmann [this message]
2013-03-27 22:42 ` Denis Berthod
2013-03-27 22:49   ` AW: " Gerd Stolpmann
     [not found]     ` <4A6314AA-0C59-4E35-9EA4-F465C0A5AF3A@gmail.com>
2013-03-28  9:23       ` Philippe Veber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1364473749.14693.3@samsung \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=philippe.veber@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).