Version française
Home     About     Download     Resources     Contact us    
Browse thread
Nethttpd_plex performance question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Andre Nathan <andre@s...>
Subject: Nethttpd_plex performance question
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;
    };

Also, even though I'm using Netplex_mp.mp (multiple processes, instead of
multiple threads), compiling with -thread gives me a performance gain
(the numbers above are for a compilation with the -thread flag). Is that
expected?

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.

Thanks in advance,
Andre