caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Gerd Stolpmann" <info@gerd-stolpmann.de>
To: "Andre Nathan" <andre@digirati.com.br>
Cc: ocamlnet-devel@lists.sourceforge.net, caml-list@inria.fr
Subject: Re: [Ocamlnet-devel] Nethttpd_plex performance question
Date: Wed, 13 Feb 2008 16:29:14 +0100 (CET)	[thread overview]
Message-ID: <4105.192.168.1.2.1202916554.squirrel@gps.dynxs.de> (raw)
In-Reply-To: <1202732562.25701.11.camel@andre.mz.digirati.com.br>

Hi Andre,

the results are more or less what I would expect. For cached static pages
there is no advantage of using multiple processes. Nethttpd has the built-in
capability of handling serveral connecrtions in parallel, so easy_daemon
already profits from that. As the static pages need not to be loaded
from anywhere, and there are no other complex computations either,
easy_daemon runs under optimal conditions.

Using multiple processes implies a lot of additional overhead. I don´t
mean the time for creating processes (which is hidden from the user
in the prefork model), but there is some extra communication for
coordinating the processes.

Generally, the multi-process model has advantages only if either

- there is some wait time until the web page is available, such as
  loading it from disk or requesting it from some background
  service
- you need some CPU time to compute the pages, and you have
  several CPU´s
- you need some CPU time, and you want to minimize latencies
  (even on a 1-CPU box)
- your program is a bit instable - crashing a sinegle
  process does not stop the whole service

As you have figured out, measuring performance is more difficult
for a multi-process server. This has mostly to do with the varying
startup time until all processes are created. The longer the benchmark
the better, and you will see stabler numbers. 600 qps roughly matches
what I measured a few months ago.

I hope this helps,

Gerd

Andre Nathan said:
> Hello
>
> I'm trying to write a simple webserver using Nethttpd_plex from the
> ocamlnet package. I did a simple benchmark using the examples provided
> in the distribution (easy_daemon.ml and netplex.ml). Both examples
> create static pages, but the netplex version shows worse performance,
> which I think is odd because it uses a multi-process model, while
> easy_damon is a single process handling all requests.
>
> I'm running "ab" (apache's benchmark tool), doing 1,000 connections, 100
> concurrently. Here are the results:
>
> - easy_daemon:
> Requests per second:    1699.87 [#/sec] (mean)
>
> - netplex:
> Requests per second:    591.22 [#/sec] (mean)
>
> [netplex's results actually vary a lot, sometimes reaching about 1,000
> req/s but sometimes also being as low as 300 req/s. On average it seems
> to be around 600 req/s]
>
> I'm using the following configuration for netplex's workload_manager:
>
>     workload_manager {
>       type = "dynamic";
>       max_jobs_per_thread = 1;
>       min_free_jobs_capacity = 30;
>       max_free_jobs_capacity = 50;
>       max_threads = 256;
>     };
>
> Does anyone have any tips for improving netplex's performance? I believe
> that with the right settings it should be able to outperform the simpler
> daemon easily, since it's using multiple processes.
>
> I hope this question is appropriate for the list.
>
> Thanks in advance,
> Andre
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Ocamlnet-devel mailing list
> Ocamlnet-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel
>
>


------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
------------------------------------------------------------


           reply	other threads:[~2008-02-13 15:29 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1202732562.25701.11.camel@andre.mz.digirati.com.br>]

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=4105.192.168.1.2.1202916554.squirrel@gps.dynxs.de \
    --to=info@gerd-stolpmann.de \
    --cc=andre@digirati.com.br \
    --cc=caml-list@inria.fr \
    --cc=ocamlnet-devel@lists.sourceforge.net \
    /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).