The debuginfod man page states that if the server is run without the
--connection-pool option, a new thread will be cloned for every request.
However this is not always the case.

Since commit e646e363e debuginfod attempts to configure the libmicrohttpd
daemon to use epoll for the daemon's internal event loop.  libmicrohttpd
requires that if epoll support is enabled, it will not create a new thread
to handle each request. So when the --connection-pool option is not given,
the daemon ends up configured to use a just a single worker thread that
can only respond to one request at a time.

There are a few ways we can address this.  My preferred approach is to use
MHD_USE_THREAD_PER_CONNECTION instead of MHD_USE_EPOLL when
--connection-pool is not given.  This preserves the behaviour stated in
the man page and if users want the performance benefits of epoll they can
always use --connection-pool to enable it.

If we insist on always using epoll when it's available then we might want
to change the default number of worker threads to something other than
1, just like when --connection-pool is given with no argument.

We could simply modify the man page to state that if --connection-pool isn't
given then only 1 worker thread will be used. However I don't like this
approach because it unnecessarily constrains the server's default behavior
and ideally we should try to preserve the behavior that we advertise in
the man page. WDYT?

Aaron

Reply via email to