[Top][All Lists]

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

Re: [libmicrohttpd] Question on Async support

From: Santos Das
Subject: Re: [libmicrohttpd] Question on Async support
Date: Fri, 24 Aug 2018 00:39:13 +0530


Thanks a lot. Is there any significant performance impact when it runs in this mode ?

Has anyone compared its performance against "mongoose " ?

I''m evaluating a http library for my C++ based application microservices .  I am evaluating libraries that can provide our C++ workers with native HTTP capabilities. 

I’m defining native as:

  • No additional threads other than those spawned by the application when it chooses to use blocking calls (entirely optional)
  • No additional queueing
  • Native sockets interface with full use of listen, accept, bind, connect, recv, send.

Do you think libmicrohttpd is the best choice or is there any better alternatives for me ?

Please advise.

thanks, santos

On Fri, Aug 24, 2018 at 12:15 AM, silvioprog <address@hidden> wrote:
Hello Santos.

Yes, you can use your own main loop. Please see:

"The fourth threading model (used when no specific flag is given), uses no threads. Instead, the main application must (periodically) request file descriptor sets from MHD, perform a select call and then call MHD_run. MHD_run will then process HTTP requests as usual and return. MHD_run is guaranteed to not block; however, access handlers and response processing callbacks that it invokes may block. This mode is useful if a single-threaded implementation is desired and in particular if the main application already uses a select loop for its processing." More ...

Enjoy MHD! ☺

On Thu, Aug 23, 2018 at 3:36 PM Santos Das <address@hidden> wrote:

Thank you for the quick reply. I have one more question, please help in clarifying -

Can "libmicrohttpd" run as a part of the application event loop or is it mandatory for the  "libmicrohttpd"  to have its own event loop?

thanks, santos

On Thu, Aug 23, 2018 at 11:58 PM, Christian Grothoff <address@hidden> wrote:
On 08/23/2018 06:21 PM, Santos Das wrote:
> Hi,
> Can anyone please confirm if libmicrohttpd supports the Async handling?

Yes, it supports asynchronous processing.

> Also, any information on the performance of libmicrohttps will be useful.

Let's just say if used properly, it will never be anywhere near the
bottleneck. We know people running 100,000 requests/s on a single system
with MHD years ago. Quite likely to do more today, but very difficult to
test: when benchmarking, you will always be benchmarking your clients,
your network or your application logic long before hitting any MHD
threshold (on sane operating systems).

Silvio Clécio

reply via email to

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