Re: profiling connection overhead

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: profiling connection overhead
Дата
Msg-id 28327.1291657122@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: profiling connection overhead  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: profiling connection overhead  (Josh Berkus <josh@agliodbs.com>)
Re: profiling connection overhead  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> One possible way to do make an improvement in this area would be to
> move the responsibility for accepting connections out of the
> postmaster.  Instead, you'd have a group of children that would all
> call accept() on the socket, and the OS would arbitrarily pick one to
> receive each new incoming connection.  The postmaster would just be
> responsible for making sure that there were enough children hanging
> around.  You could in fact make this change without doing anything
> else, in which case it wouldn't save any work but would possibly
> reduce connection latency a bit since more of the work could be done
> before the connection actually arrived.

This seems like potentially a good idea independent of anything else,
just to reduce connection latency: fork() (not to mention exec() on
Windows) now happens before not after receipt of the connection request.
However, I see a couple of stumbling blocks:

1. Does accept() work that way everywhere (Windows, I'm looking at you)

2. What do you do when max_connections is exceeded, and you don't have
anybody at all listening on the socket?  Right now we are at least able
to send back an error message explaining the problem.

Another issue that would require some thought is what algorithm the
postmaster uses for deciding to spawn new children.  But that doesn't
sound like a potential showstopper.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: WIP patch for parallel pg_dump
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_execute_from_file review