From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: ecordonnier@snap.com, bitbake-devel@lists.openembedded.org
Cc: docs@lists.yoctoproject.org
Subject: Re: [docs] [PATCH] bitbake-worker: add header with length of message
Date: Thu, 21 Sep 2023 09:22:10 +0100 [thread overview]
Message-ID: <0d94ff1c8efe8d37471f3c0bfe09403a7d8c5af8.camel@linuxfoundation.org> (raw)
In-Reply-To: <20230921075658.509846-1-ecordonnier@snap.com>
On Thu, 2023-09-21 at 09:56 +0200, Etienne Cordonnier via
lists.yoctoproject.org wrote:
> From: Etienne Cordonnier <ecordonnier@snap.com>
>
> The IPC mechanism between runqueue.py and bitbake-worker is currently
> not scalable:
>
> The data is sent with the format <tag>pickled-data</tag>, and bitbake-worker
> has no information about the size of the message. Therefore, the bitbake-worker
> is calling select() and read() in a loop, and then calling "self.queue.find(b"</" + item + b">")"
> for each chunk received.
>
> This does not scale, because queue.find has a linear complexity relative to the size of the queue,
> and workerdata messages get very big e.g. for builds which reference a lot of files in SRC_URI.
> The number of chunks varies, but on my test system a lot of chunks of 65536 bytes are sent, and each
> iteration takes 0.1 seconds, making the transfer of the "workerdata" data very slow (on my test setup
> 35 seconds before this fix, and 1.5 seconds after this fix).
>
> This commit adds a 4 bytes header after <tag>, so that bitbake-worker knows how many bytes need to be
> received, and does not need to constantly search the whole queue for </tag>.
>
> Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
> ---
> bin/bitbake-worker | 34 +++++++++++++++++++++++-----------
> lib/bb/runqueue.py | 34 ++++++++++++++++++++++------------
> 2 files changed, 45 insertions(+), 23 deletions(-)
This does look interesting. The IPC mechanism was never intended to
carry large data and it has changed over time in ways it was never
really designed for.
I'm guessing just one of the objects is particularly large? You mention
lots of files in SRC_URI causing the issue, I'd like to better
understand that.
I'm just wondering whether instead of improving the IPC, we could avoid
some of the data in the first place?
Cheers,
Richard
next prev parent reply other threads:[~2023-09-21 8:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-21 7:56 [PATCH] bitbake-worker: add header with length of message ecordonnier
2023-09-21 8:22 ` Richard Purdie [this message]
2023-09-21 11:09 ` [docs] " Etienne Cordonnier
[not found] <1786DAEDA12E3A72.1961@lists.yoctoproject.org>
2023-09-21 7:59 ` Etienne Cordonnier
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=0d94ff1c8efe8d37471f3c0bfe09403a7d8c5af8.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=bitbake-devel@lists.openembedded.org \
--cc=docs@lists.yoctoproject.org \
--cc=ecordonnier@snap.com \
/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