From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id AE640BBAF for ; Sun, 25 Jul 2010 15:52:48 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq8CAC3eS0xDww/HkWdsb2JhbACDFI9Rg1aJNgEBAQEJCwoHEQMfrhw7ghCEPokCAQQEAYEhgx1zBIQI X-IronPort-AV: E=Sophos;i="4.55,257,1278280800"; d="scan'208";a="64383091" Received: from web111512.mail.gq1.yahoo.com ([67.195.15.199]) by mail1-smtp-roc.national.inria.fr with SMTP; 25 Jul 2010 15:52:47 +0200 Received: (qmail 39696 invoked by uid 60001); 25 Jul 2010 13:52:46 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1280065966; bh=Qyf1yMKGknAY9QmSbvKVtO4PVfe61bWD/8IHRRK1Rbs=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=SewEZNTDPb0TMg9zUmxh4f37hj0yVPNVwRD+Z6hZtlYV87Dc1CLQg/laioHwss8f7pvePyJvJHZockLDhljwfN7AUlc5AyabWRM4/opl9rpPQ9Fk+xRCJso6oqQzZTN4LuDVFuPTrHbRV7ZXx0+NUujs2goONpJrLlcMFZZu6qI= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Fb6tiMGTXgbOpd8rl53Kt88fQokxjFwWsUOh92EZA0Cn6/Yll9EAOFAEvT1QEHtMnJfUufO9KHCPEEbAX17UK+mMFVnSDq4YY5wFvzX+0/IqBvi14nIeh/cfMgEH1L52CgyrKwkaQEvKTzk1L9/8m4he/VCEa6JkxF2e5PXj3OE=; Message-ID: <407966.39005.qm@web111512.mail.gq1.yahoo.com> X-YMail-OSG: bifzyioVM1mDoLKUpeGPzRe8Ze.Zx1hw2LINz2oevD889Tj aAY61yyuwEYD2ZRmMDkZ8tLb9_19UzhP08rFX85hTce_KK_mW_Tl_G.uZ3F3 OdmIxxnwxWps1uWwzDM6aRfNeV3B6BUH74Mg5nTiphPWbV917vv2mnh9qFFb FASie1UsHpHHQ5C7k5T0skyQ.eSDE3BoIOBEbBxbKrU8zWVV2q_nsjxgFt0a w9w7Ds3c.t3xA1i5bU_vzp5gVufSi4OjVmMgCeVPYlnntMfsuYc5_ralWu51 mX2u6BHV48flho76vwCwxpJ6qyjWx7wqhAaI2cvGD8bxigfblufnq8Yorv80 30B16MQlwuMLd Received: from [213.205.71.51] by web111512.mail.gq1.yahoo.com via HTTP; Sun, 25 Jul 2010 06:52:46 PDT X-Mailer: YahooMailClassic/11.2.4 YahooMailWebService/0.8.105.277674 Date: Sun, 25 Jul 2010 06:52:46 -0700 (PDT) From: Dario Teixeira Subject: Re: [Caml-list] scalable web apps To: caml-list@yquem.inria.fr, Joel Reymont In-Reply-To: <914B9960-EBC8-439B-B7F8-A852859B522F@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; scalable:01 scalable:01 ocaml:01 native-code:01 caching:01 non-blocking:01 ocaml's:01 caching:01 ocaml:01 gerd:01 stolpmann:01 surviving:98 circumstance:98 unix:01 caml-list:01 Hi,=0A=0A> How do you build scalable web apps with OCaml?=0A> Do you use Ap= ache with mod_caml? Naked Ocsigen?=0A> Do you put Ocsigen behind Nginx?=0A= =0AYour question is quite open-ended. There are several "scalability crisi= s"=0Athat an web app is expected to confront as it grows from handling at m= ost=0Aa handfull of requests per second to dealing with tens or even hundre= ds of=0Athousands of requests per second. Are we talking about surviving a= "mere"=0ASlashdot effect (not as scary nowadays as it once was), or about = competing=0Awith Facebook?=0A=0ANaked Ocsigen -- particularly naked native-= code Ocsigen -- should serve=0Ayou a long way in the initial stage of the g= rowth path. In fact, I suspect=0Ayou'll run into scalability problems with= the database backend much sooner=0Athan you'll find them on the Ocsigen si= de. (For caching DB requests, I=0Areckon that Ocsigen's Ocsigen_cache modu= le should be sufficient for this=0Aearly stage, single Ocsigen server situa= tions).=0A=0AThe only circumstance where I would be cautious on relying sol= ely on a=0Anaked Ocsigen is if you are also required to serve plenty of sta= tic content=0A(images, etc). Even though Ocsigen includes an extension for= serving static=0Apages, for hysterical reasons no Unix supports non-blocki= ng mode for regular=0Afiles, which of course causes problems for Lwt-apps (= see the Lwt manual for=0Amore information on this). Therefore, in this con= text you may get better=0Aresults by having another server (like Nginx) ded= icated to static content.=0A=0AAs Sylvain mentioned, in my talk I discussed= that Ocaml's single-coredness is =0Ain no way an obstacle to scaling an we= b app beyond a single Ocsigen server.=0AHowever, at this stage of growth yo= u'll also have to consider using a=0Adistributed caching mechanism, such as= Memcached or Wink's Cache [1] (the=0Alater developed in Ocaml by Gerd Stol= pmann et al).=0A=0ABest regards,=0ADario Teixeira=0A=0A[1] http://oss.wink.= com/cache/=0A=0A=0A=0A