Re: general PG network slowness (possible cure) (repost)

Поиск
Список
Период
Сортировка
От Peter T. Breuer
Тема Re: general PG network slowness (possible cure) (repost)
Дата
Msg-id 200705251506.l4PF6AW08031@inv.it.uc3m.es
обсуждение исходный текст
Ответ на Re: general PG network slowness (possible cure) (repost)  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: general PG network slowness (possible cure) (repost)
Список pgsql-performance
"Also sprach Alvaro Herrera:"
> > I really think it would be worthwhile getting some developer to tell me
> > where the network send is done in PG.
>
> See src/backend/libpq/pqcomm.c (particularly internal_flush()).

Yes. Thanks. That looks like it. It calls secure_write continually
until the buffer is empty.

Secure_write is located ibe-secure.c, but I'm not using ssl, so the
call reduces to just

    n = send(port->sock, ptr, len, 0);

And definitely all those could be grouped if there are several to do.
But under normal circumstances the send will be pushing against a
lttle resistance (the copy to the driver/protocol stack buffer is faster
than the physical network send, by a ratio of GB/s to MB/s, or 1000 to
1), and thus all these sends will probably complete as a single unit
once they have been started.

It's worth a try.  I thought first this may be too low level, but it
looks as though internal_flush is only triggered when some other buffer
is full, or deliberately, so it may be useful to block until it fires.

I'll try it.


Peter

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Big problem with sql update operation
Следующее
От: Tom Lane
Дата:
Сообщение: Re: general PG network slowness (possible cure) (repost)