Re: how to speed up 002_pg_upgrade.pl and 025_stream_regress.pl under valgrind

From: Tomas Vondra <tomas(at)vondra(dot)me>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: how to speed up 002_pg_upgrade.pl and 025_stream_regress.pl under valgrind
Date: 2024-09-15 19:47:28
Message-ID: 1e30a84e-00ad-4591-aeca-df2d0e309a87@vondra.me
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9/15/24 20:31, Tom Lane wrote:
> Tomas Vondra <tomas(at)vondra(dot)me> writes:
>> [ 002_pg_upgrade and 027_stream_regress are slow ]
>
>> I don't have a great idea how to speed up these tests, unfortunately.
>> But one of the problems is that all the TAP tests run serially - one
>> after each other. Could we instead run them in parallel? The tests setup
>> their "private" clusters anyway, right?
>
> But there's parallelism within those two tests already, or I would
> hope so at least. If you run them in parallel then you are probably
> causing 40 backends instead of 20 to be running at once (plus 40
> valgrind instances). Maybe you have a machine beefy enough to make
> that useful, but I don't.
>

I did look into that for both tests, albeit not very thoroughly, and
most of the time there were only 1-2 valgrind processes using CPU. The
stream_regress seems more aggressive, but even for that the CPU spikes
are short, and the machine could easily do something else in parallel.

I'll try to do better analysis and some charts to visualize this ...

> Really the way to fix those two tests would be to rewrite them to not
> depend on the core regression tests. The core tests do a lot of work
> that's not especially useful for the purposes of those tests, and it's
> not even clear that they are exercising all that we'd like to have
> exercised for those purposes. In the case of 002_pg_upgrade, all
> we really need to do is create objects that will stress all of
> pg_dump. It's a little harder to scope out what we want to test for
> 027_stream_regress, but it's still clear that the core tests do a lot
> of work that's not helpful.
>

Perhaps, but that's a lot of work and time, and tricky - it seems we
might easily remove some useful test, even if it's not the original
purpose of that particular script.

regards

--
Tomas Vondra

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2024-09-15 20:00:23 Re: A starter task
Previous Message sia kc 2024-09-15 19:42:54 Re: A starter task