public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: elfutils-devel@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: [PATCH] tests: Limit the number of concurrent requests in debuginfod-federation
Date: Fri, 14 Apr 2023 18:46:10 +0200	[thread overview]
Message-ID: <20230414164610.1092833-1-mark@klomp.org> (raw)

It seems doing 100 parallel requests can crash some versions of
libmicrohttpd so limit the number a little to the number of processors
times 4, with a max of 64.

      * tests/run-debuginfod-federation-metrics.sh: Use nproc * 4, or 64
      for seq curl requests.
      * tests/run-debuginfod-federation-sqlite.sh: Likewise.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 tests/run-debuginfod-federation-metrics.sh | 4 +++-
 tests/run-debuginfod-federation-sqlite.sh  | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/run-debuginfod-federation-metrics.sh b/tests/run-debuginfod-federation-metrics.sh
index 3d716246..0692e4fb 100755
--- a/tests/run-debuginfod-federation-metrics.sh
+++ b/tests/run-debuginfod-federation-metrics.sh
@@ -191,7 +191,9 @@ curl -s http://127.0.0.1:$PORT2/metrics | grep 'dc_pool_op.*reuse'
 # Use a file that hasn't been previously extracted in to make it
 # likely that even this test debuginfod will experience concurrency
 # and impose some "after-you" delays.
-(for i in `seq 100`; do
+maxreq=$[$(nproc) * 4]
+maxreq=$(( $maxreq > 64 ? 64 : $maxreq ))
+(for i in `seq $maxreq`; do
     curl -s http://127.0.0.1:$PORT1/buildid/87c08d12c78174f1082b7c888b3238219b0eb265/executable >/dev/null &
  done;
  wait)
diff --git a/tests/run-debuginfod-federation-sqlite.sh b/tests/run-debuginfod-federation-sqlite.sh
index d9321526..6b090074 100755
--- a/tests/run-debuginfod-federation-sqlite.sh
+++ b/tests/run-debuginfod-federation-sqlite.sh
@@ -157,7 +157,9 @@ testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $BUILDID
 # Use a file that hasn't been previously extracted in to make it
 # likely that even this test debuginfod will experience concurrency
 # and impose some "after-you" delays.
-(for i in `seq 100`; do
+maxreq=$[$(nproc) * 4]
+maxreq=$(( $maxreq > 64 ? 64 : $maxreq ))
+(for i in `seq $maxreq`; do
     curl -s http://127.0.0.1:$PORT1/buildid/87c08d12c78174f1082b7c888b3238219b0eb265/executable >/dev/null &
  done;
  wait)
-- 
2.39.2


             reply	other threads:[~2023-04-14 16:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14 16:46 Mark Wielaard [this message]
2023-04-17 12:18 ` Mark Wielaard

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=20230414164610.1092833-1-mark@klomp.org \
    --to=mark@klomp.org \
    --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).