Re: Automatically sizing the IO worker pool - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Automatically sizing the IO worker pool
Date
Msg-id CA+hUKGJU55K+MA1FSKLWiHkAAKM=uj38Gxe+Fk-br9BafB6Hmw@mail.gmail.com
Whole thread
In response to Re: Automatically sizing the IO worker pool  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-hackers
I changed pgaio_worker_request_grow() not to bother the postmaster
unless nworkers < io_max_workers.

I move that code you wanted outside the loop and did:

        /* Choose one worker to wake for this batch. */
        if (nsync < num_staged_ios)
            worker = pgaio_worker_choose_idle(-1);

I took your suggestion for the names hist_wakeups and hist_ios.

For the location of the following line, I preferred not to separate
the pre-existing tests of StartWorkerNeeded and HaveCrashedWorker,
since they belong together as bgworker concerns.

    next_wakeup = maybe_start_io_workers_scheduled_at();

I think I've run out of reasons not to commit this, unless your
pondering of the grow-trigger heuristics revealed a problem?

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Automatically sizing the IO worker pool
Next
From: Andres Freund
Date:
Subject: Re: Implement waiting for wal lsn replay: reloaded