From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 79FE4BB84 for ; Thu, 11 Sep 2008 16:37:37 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiUCACjKyEg+FFrDiGdsb2JhbACSZAEBAQ8gpQCBZA X-IronPort-AV: E=Sophos;i="4.32,380,1217800800"; d="scan'208";a="14833888" Received: from vtab.com (HELO oden.vtab.com) ([62.20.90.195]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Sep 2008 16:37:37 +0200 Received: from oden.vtab.com (oden.vtab.com [127.0.0.1]) by oden.vtab.com (Postfix) with ESMTP id 20E67270687; Thu, 11 Sep 2008 16:37:36 +0200 (CEST) Received: from kicki.hq.vtech (kicki.hq.vtech [10.0.0.211]) by oden.vtab.com (Postfix) with ESMTP id 06368270659; Thu, 11 Sep 2008 16:37:36 +0200 (CEST) Received: by kicki.hq.vtech (Postfix, from userid 7557) id EF7EC29B2A; Thu, 11 Sep 2008 16:37:35 +0200 (CEST) From: "=?utf-8?b?TWF0dGlhcyBFbmdkZWfDpQ==?= =?utf-8?b?cmQ=?=" To: joelr1@gmail.com Cc: caml-list@yquem.inria.fr In-reply-to: <01677251-3A8D-4DCA-9E39-7D17FAC92645@gmail.com> (message from Joel Reymont on Thu, 11 Sep 2008 13:43:55 +0100) Subject: Re: [Caml-list] ocamlnet and kernel poll References: <01677251-3A8D-4DCA-9E39-7D17FAC92645@gmail.com> Message-Id: <20080911143735.EF7EC29B2A@kicki.hq.vtech> Date: Thu, 11 Sep 2008 16:37:35 +0200 (CEST) X-Virus-Scanned: ClamAV using ClamSMTP X-Spam: no; 0.00; mattias:01 mattias:01 ocamlnet:01 ocamlnet:01 ocaml:01 ocaml:01 parallelism:01 caml-list:01 inefficient:02 kernel:02 kernel:02 seems:03 handles:03 typed:04 processors:04 >Suppose I want to build a server that runs on top of ocamlnet and >handles 10k+ connections. > >ocamlnet seems to use select exclusively. > >Any suggestions on how to add kernel poll? Is this possible even? There is an ocaml wrapper for libevent: http://www.xs4all.nl/~mmzeeman/ocaml/ With that many connections, you may actually benefit from multiple processors, which in the OCaml world usually means multiple processes. There's nothing wrong with serving myriads of connections from a single process, especially when using a strongly typed language, but parallelism can be useful. On the other hand, one process per connection may be inefficient as well - a hybrid N:M solution is probably best.