Re: Stats Collector Error 7.4beta1 and 7.4beta2

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Kurt Roeckx <Q(at)ping(dot)be>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>, akavan(at)cox(dot)net, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Stats Collector Error 7.4beta1 and 7.4beta2
Date: 2003-09-04 20:04:38
Message-ID: 3F579AD6.8060208@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Kurt Roeckx wrote:

> On Thu, Sep 04, 2003 at 01:39:04AM -0400, Tom Lane wrote:
>> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>> > Doesn't the stats collector use unix domain sockets, not IP?
>>
>> No. IIRC, we deliberately chose IP/UDP because it had buffering
>> behavior we liked.
>
> Once you said it was because not all platforms have unix domain
> sockets. I asked why we weren't using something like
> socketpair().
>

The reason to use INET UDP is that this is the only connection type that
simply drops packets if the stupid collector daemon isn't able to keep
up with the traffic. Think of a 64 processor SMP machine where 60
backends utilize their own CPU and the poor little collector get's
burried in packets, you don't want it to slow down the whole system, do you?

And I agree with Tom that it is very likely that the IPV4/IPV6 stuff is
the reason. IIRC the postmaster creates the socket and noone ever does
bind(2) on it - so it uses it's dynamically assigned port number. Both,
the collector and the backends inherit that socket via fork(2). The
backends use this socket with it's own sockname to send the stats out,
and the collector reads it with recvfrom(2) and verifies that the from
address is identical to it's sockname ... that way noone can inject
faked stat packets. Now this is a lot of sockname usage that could lead
to either the packets not arriving in the collector, or being thrown
away by the collector because of failing to see them coming from itself.

Jan

>
> Kurt
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Manfred Spraul 2003-09-04 20:13:18 Re: Prelimiary DBT-2 Test results
Previous Message Andrew Dunstan 2003-09-04 19:28:43 Re: TCP/IP with 7.4 beta2 broken?