public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Aaron Merey <amerey@redhat.com>
To: elfutils-devel@sourceware.org
Subject: Worker threads and MHD_USE_EPOLL
Date: Mon, 29 Aug 2022 19:54:38 -0400	[thread overview]
Message-ID: <CAJDtP-Q7TOw-mRq7D4qV_UxuNnsF4kAGPz1t+b2=f99_3d5vzg@mail.gmail.com> (raw)

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	other threads:[~2022-08-29 23:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAJDtP-Q7TOw-mRq7D4qV_UxuNnsF4kAGPz1t+b2=f99_3d5vzg@mail.gmail.com' \
    --to=amerey@redhat.com \
    --cc=elfutils-devel@sourceware.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).