From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 38B4DBBAF for ; Mon, 26 Jul 2010 09:29:11 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtoDAN7VTEzRVaFEhmdsb2JhbACSaYxvCBUBAQEKCQoHEyKuaYIQhHsuiFQBAQMFhTEEhAOHKA X-IronPort-AV: E=Sophos;i="4.55,260,1278280800"; d="scan'208";a="56115042" Received: from mail-fx0-f68.google.com ([209.85.161.68]) by mail2-smtp-roc.national.inria.fr with ESMTP; 26 Jul 2010 09:29:10 +0200 Received: by fxm15 with SMTP id 15so3095173fxm.3 for ; Mon, 26 Jul 2010 00:29:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=WjYXYiPSVN8oDpe0PxWe46nITNB1qOzl2tt3DAZDW8c=; b=ffykjkQx4sPZYcwIADT2tUqHAcmf8vmmw9iMQ++pIr6B8YkhLYEyYtq8mecQCVlSC9 uddqWlr72j+WzOx7yePZEUyr3NTtGeLg2cGgf0rZq5UnPMXo5WWMh/IG5esSE7scuafI N/qvMrFfGR/PIxVe6DvQuUTqU77E6QTsgQCL4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=kPPN24pvKdEkz+Lf/V+DIoYZVfQ2JiSGqBsJvhHw6l2/kZB8u3vlyP/WvMb2MqAVDr TPtTIa7cIK+BOMF4XDybP4ZNZEHxSRwpYAY9wCn/OitRr5NBLJx6pURkFxPb1RBu+7N4 3gf1DXDVbfm5qreFvGUYIsVRfl14QfocU01gM= Received: by 10.223.122.208 with SMTP id m16mr5821333far.88.1280129350444; Mon, 26 Jul 2010 00:29:10 -0700 (PDT) Received: from deb0 ([79.114.80.43]) by mx.google.com with ESMTPS id q17sm1262145faa.45.2010.07.26.00.29.09 (version=SSLv3 cipher=RC4-MD5); Mon, 26 Jul 2010 00:29:10 -0700 (PDT) Date: Mon, 26 Jul 2010 10:29:04 +0300 From: =?UTF-8?B?VMO2csO2aw==?= Edwin To: Dario Teixeira Cc: caml-list@yquem.inria.fr, Joel Reymont Subject: Re: [Caml-list] scalable web apps Message-ID: <20100726102904.10ed4768@deb0> In-Reply-To: <407966.39005.qm@web111512.mail.gq1.yahoo.com> References: <914B9960-EBC8-439B-B7F8-A852859B522F@gmail.com> <407966.39005.qm@web111512.mail.gq1.yahoo.com> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; scalable:01 non-blocking:01 ocaml's:01 ocaml:01 ocaml:01 edwin:98 circumstance:98 threads:01 threads:01 wrote:01 unix:01 caml-list:01 pthreads:02 cached:02 native:03 On Sun, 25 Jul 2010 06:52:46 -0700 (PDT) Dario Teixeira wrote: > The only circumstance where I would be cautious on relying solely on a > naked Ocsigen is if you are also required to serve plenty of static > content (images, etc). Even though Ocsigen includes an extension for > serving static pages, for hysterical reasons no Unix supports > non-blocking mode for regular files, which of course causes problems > for Lwt-apps (see the Lwt manual for more information on this). I thought ocaml's "threads" are meant to solve the I/O problem. Doesn't it use native pthreads for each OCaml thread, and prior to performing I/O it releases the mutex allowing other threads to run? Of course you'd still have to wait for the I/O to complete to serve the file to one particular user, but in the meantime you could serve some other (already cached) file to another user, generate some dynamic content, etc. Lwt's Lwt_preemptive seems to allow one to use 'preemptive threads' (which I assume are just usual OCaml threads). So would it be possible to put the file I/O on Lwt_preemptive.detach threads? Has anyone tried to measure the performance of doing that? Best regards, --Edwin