From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 875F9BBAF for ; Mon, 21 Dec 2009 18:42:48 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuYAAAVCL0tDww+XkWdsb2JhbACECo4FgQOIPAEBAQEJCwoHEwOsMCmBMoQ1iCkBBQQBgSqCLVIE X-IronPort-AV: E=Sophos;i="4.47,432,1257116400"; d="scan'208";a="52609650" Received: from web111504.mail.gq1.yahoo.com ([67.195.15.151]) by mail4-smtp-sop.national.inria.fr with SMTP; 21 Dec 2009 18:42:47 +0100 Received: (qmail 63578 invoked by uid 60001); 21 Dec 2009 17:42:46 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1261417366; bh=IV9nWP7OIFo/hE1KqzZ+WCVupZfmhES5zMF2rUZ6bbw=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=XM9cxc+YKteCIZFvarkifQ71aSHHfkmC0r0O3xKH5j3cjgOBA8ja0Zr3l1yFVVH3Pig1oSsoGcIjUefm0BXLGOC99cgjZC/qEKT2K+G7cfCKXxEHREmqfUmbqThGDiJSN/AJ90Y7Ynmclmr4YGWsq03xjskoyt1hYJUg/P7M2Yk= 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=awWrf2OC2SYVjTsW+oDJKbfkGVea52NrVQjMsY/Wneay5FDDbqOR6sCSStKl/XZE1f2qwdQoZad/To1T2qoWMHIa+YkwE1trzvTW3kI/lk6khGbZeIJDMpMItXtPBHn2mey+DV13H70oswi2fr55FeuHNYM4iXW+1piBufu/RHQ=; Message-ID: <247389.62985.qm@web111504.mail.gq1.yahoo.com> X-YMail-OSG: GLkfZEgVM1ne7G0c4hDHhg2zrwKIRwfTP8qhpj.Sq9Q.LN9fGIiisRlaC6_f9LKTrnjA5U2J4Uq5ODbR5J2lXFtsopSRHhc6lae8T5o7o64KYJfn7EWIcl3IHH40ltucJD6PNImFP0_wMXfWGxVbETkOWk5ahQT88j0SjC9rR2DLub1YTjNfWdIRdkDT2hIbtIzA26onBxV2wTe9yiREjYDYENx_SCOnQDtBg_GPjsn2W_ymR4l.adUS21J0YPjTaoZCuU25oMhGh0R_8YRnOjmONlG531uhj8yOVxm9t_SLf2r.i6hQEmRHKFrIksYn.m7hY6zZ Received: from [213.205.71.53] by web111504.mail.gq1.yahoo.com via HTTP; Mon, 21 Dec 2009 09:42:46 PST X-Mailer: YahooMailClassic/9.0.19 YahooMailWebService/0.8.100.260964 Date: Mon, 21 Dec 2009 09:42:46 -0800 (PST) From: Dario Teixeira Subject: Re: [Caml-list] Re: multicore wish To: caml-list@yquem.inria.fr, ocsigen@sympa.mancoosi.univ-paris-diderot.fr, Mihamina Rakotomandimby In-Reply-To: <20091221171936.75d1186b@pbmiha.malagasy.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; model:01 dispatching:01 syscalls:01 threads:01 threads:01 caml-list:01 standpoint:01 ensuring:02 latter:03 concurrency:04 contention:04 flaw:04 parallel:05 instances:06 context:06 Hi,=0A=0A> I am beginning using Ocsigen, for a growing web project:=0A> Is = multicore support useless for scaling on Ocsigen?=0A=0ACategorically, yes. = In fact, I would say that the model used by Ocsigen=0Ais close to being op= timal performance-wise as far as web applications are=0Aconcerned. The Ocs= igen server and Eliom applications use Lwt for concurrency,=0Aensuring that= the CPU is always busy and will not idle waiting for I/O.=0AMoreover, the = green threads offered by Lwt are much lighter than system=0Athreads, and av= oid the context switching penalty incurred by the latter.=0A=0AAnd what abo= ut those multiple cores? Simple, if you have n cores, then=0Asimply fire u= p n instances of the Ocsigen server, and put a dispatching=0Aserver like HA= Proxy or Ocsigen itself as frontend (there are some simple=0Atricks to ensu= re that the same client is always directed to same server).=0AThis solution= takes advantage of the fact that serving web requests from=0Amultiple clie= nts is embarrasingly parallel from the web application=0Astandpoint. (Sure,= you'll have contention on the database side, but=0Amost DBMSs handle that = reasonably well).=0A=0A(And yes, I am aware that Lwt's performance could be= improved further=0Aby using syscalls like epoll/kqeueue/etc instead of sel= ect. That is=0Ahowever an implementation issue, not an architectural flaw)= .=0A=0ABest regards,=0ADario Teixeira=0A=0A=0A=0A