libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] Re: A question about libmicrohttpd


From: Christian Grothoff
Subject: [libmicrohttpd] Re: A question about libmicrohttpd
Date: Mon, 13 Jul 2009 19:31:16 +0200
User-agent: KMail/1.11.4 (Linux/2.6.30-1-686; KDE/4.2.4; i686; ; )

Hi!

I can not reproduce the problem; when I run ab -c 100 -n 10000 MHD runs just 
fine (using internal select).  I've modified your code to use the thread 
pooling 
function, which significantly improves performance (latency) on my notebook. 

As a result, on an Intel(R) Atom(TM) CPU N270   @ 1.60GHz (dual core), I get:

address@hidden:~$ /usr/sbin/ab -c 100 -n 10000 http://127.0.0.1:8080/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:        
Server Hostname:        127.0.0.1
Server Port:            8080

Document Path:          /
Document Length:        41 bytes

Concurrency Level:      100
Time taken for tests:   6.709 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      1170000 bytes
HTML transferred:       410000 bytes
Requests per second:    1490.46 [#/sec] (mean)
Time per request:       67.093 [ms] (mean)
Time per request:       0.671 [ms] (mean, across all concurrent requests)
Transfer rate:          170.30 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       22   34   9.7     30      67
Processing:    11   32   9.9     28      69
Waiting:        1   17  10.7     15      64
Total:         46   67  18.6     58     125

Percentage of the requests served within a certain time (ms)
  50%     58
  66%     80
  75%     87
  80%     88
  90%     91
  95%     96
  98%    105
  99%    112
 100%    125 (longest request)

I used the attached code, compiled using:

 gcc -I include/ -Llib -lmicrohttpd -o serv -O2 simpleHttp.c

Now, I do not claim that this is the best way  to configure or compile MHD for 
my system, all I am saying  is that it does seem to perform reasonably well as 
far as I can see.

I hope this helps.


Christian
p.s.: In general, I think it is a good idea if you send these types of 
questions to the MHD mailinglist.


On Monday 13 July 2009 14:53:29 yavuz gokirmak wrote:
> Hi Christian,
>
> Sory for asking too much questions...
>
> I am trying to test libmicrohttp's performance via *ab*(apache benchmark)
> When I try
> ab -c 32 -n 100 http://127.0.0.1:80/
> I get
> Benchmarking 127.0.0.1 (be patient)...apr_socket_recv: Connection reset by
> peer (54)
> error from ab.
>
> Above command works well for -c values less then 32. Apache server gives no
> error even I set -c as 100.
>
> I couldn't figure out the problem. I tried both MHD_USE_SELECT_INTERNALLY
> and MHD_USE_THREAD_PER_CONNECTION modes and olsa tried to alter the
> MHD_OPTION_CONNECTION_LIMIT value.
>
> If you have any idea I am glad to hear.
>
> best regards...
>
> yavuz...
>
>
> 2009/7/10 Christian Grothoff <address@hidden>
>
> > When doing those tests, make sure to use different threading modes,
> > including
> > setting MHD_OPTION_THREAD_POOL_SIZE to different values when running
> >  MHD_USE_SELECT_INTERNALLY (which should be the best mode for most
> > systems /
> > uses).
> >
> > Best,
> >
> > Christian
> >
> > Am Friday 10 July 2009 11:47:37 schrieb yavuz gokirmak:
> > > Thanks christian,
> > >
> > > I will make some performance tests,
> > > when tests are finished I will inform you..
> > >
> > > best regards...
> > >
> > > yavuz gokirmak
> > >
> > > 2009/7/10 Christian Grothoff <address@hidden>
> > >
> > > > I'd expect MHD to scale better (thousands of clients should not be a
> > > > problem
> > > > if you set the right options) and be faster (but I have not tried the
> > > > perl module, I'd just think that perl is generally slower than
> > > > well-written C). In general, if the rest of your code is in Perl and
> >
> > the
> >
> > > > performance of the perl module is acceptable, you'll likely be happy
> >
> > with
> >
> > > > the Perl module.  If you like to write code in C/C++, then MHD is
> >
> > likely
> >
> > > > a much better choice.
> > > >
> > > > Best,
> > > >
> > > > Christian
> > > >
> > > > Am Friday 10 July 2009 11:07:17 schrieb yavuz gokirmak:
> > > > > Hello,
> > > > >
> > > > > I'am a computer engineer from Turkey. I am working on a project and
> >
> > in
> >
> > > > the
> > > >
> > > > > project we are planning to emulate a web server in a efficient
> >
> > manner.
> >
> > > > > When I have make a search about current implementations I saw your
> > > >
> > > > project
> > > >
> > > > > http://www.gnu.org/software/libmicrohttpd/. I liked libmicrohttp,
> >
> > its
> >
> > > > > design and documentation is very good I think.
> > > > >
> > > > > But I could not make a comparison between your library and
> >
> > simple-http
> >
> > > > > module of perl. I won't implement and response all the incoming
> > > > > requests, only a subset of requests will be responded but I have to
> > > > > give response
> > > >
> > > > to
> > > >
> > > > > lots of clients. I need an efficient implementation. What you can
> > > > > say
> > > >
> > > > about
> > > >
> > > > > the advantages of libmicrohttp over perl module?
> > > > >
> > > > > Thanks in advance...
> > > > >
> > > > >
> > > > > yavuz gokirmak

Attachment: simpleHttp.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]