Re: [HACKERS] Re: [PATCHES] Try again: S_LOCK reduced contentionh]

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Re: [PATCHES] Try again: S_LOCK reduced contentionh]
Дата
Msg-id 24913.894899683@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Re: [PATCHES] Try again: S_LOCK reduced contentionh]  (Brett McCormick <brett@work.chicken.org>)
Ответы Re: [HACKERS] Re: [PATCHES] Try again: S_LOCK reduced contentionh]  (Brett McCormick <brett@work.chicken.org>)
Список pgsql-hackers
Brett McCormick <brett@work.chicken.org> writes:
> same way that the current network socket is passed -- through an execv
> argument.  hopefully, however, the non-execv()ing fork will be in 6.4.

Um, you missed the point, Brett.  David was hoping to transfer a client
connection from the postmaster to an *already existing* backend process.
Fork, with or without exec, solves the problem for a backend that's
started after the postmaster has accepted the client socket.

This does lead to a different line of thought, however.  Pre-started
backends would have access to the "master" connection socket on which
the postmaster listens for client connections, right?  Suppose that we
fire the postmaster as postmaster, and demote it to being simply a
manufacturer of new backend processes as old ones get used up.  Have
one of the idle backend processes be the one doing the accept() on the
master socket.  Once it has a client connection, it performs the
authentication handshake and then starts serving the client (or just
quits if authentication fails).  Meanwhile the next idle backend process
has executed accept() on the master socket and is waiting for the next
client; and shortly the postmaster/factory/whateverwecallitnow notices
that it needs to start another backend to add to the idle-backend pool.

This'd probably need some interlocking among the backends.  I have no
idea whether it'd be safe to have all the idle backends trying to
do accept() on the master socket simultaneously, but it sounds risky.
Better to use a mutex so that only one gets to do it while the others
sleep.

            regards, tom lane

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Brett McCormick
Дата:
Сообщение: Re: [HACKERS] Re: [PATCHES] Try again: S_LOCK reduced contentionh]
Следующее
От: "Jose' Soares Da Silva"
Дата:
Сообщение: Re: [HACKERS] money or dollar type