Skip site navigation (1) Skip section navigation (2)

Re: Stats collector performance improvement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, Merlin Moncure <merlin(dot)moncure(at)rcsonline(dot)com>, Carlos Benkendorf <carlosbenkendorf(at)yahoo(dot)com(dot)br>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Stats collector performance improvement
Date: 2006-01-02 18:45:21
Message-ID: 7838.1136227521@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patchespgsql-performance
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> I found if I put a pg_usleep(100) in the buffer process the backend
> speed was good, but packets were lost.  What I found worked well was to
> do multiple recv() calls in a loop.  The previous code did a select(),
> then perhaps a recv() and pipe write() based on the results of the
> select().  This caused many small packets to be written to the pipe and
> the pipe write overhead seems fairly large.  The best fix I found was to
> loop over the recv() call at most 25 times, collecting a group of
> packets that can then be sent to the collector in one pipe write.  The
> recv() socket is non-blocking, so a zero return indicates there are no
> more packets available.  Patch attached.

This seems incredibly OS-specific.  How many platforms did you test it
on?

A more serious objection is that it will cause the stats machinery to
work very poorly if there isn't a steady stream of incoming messages.
You can't just sit on 24 messages until the 25th one arrives next week.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Bruce MomjianDate: 2006-01-02 19:13:47
Subject: Re: Stats collector performance improvement
Previous:From: Bruce MomjianDate: 2006-01-02 18:40:40
Subject: Stats collector performance improvement

pgsql-hackers by date

Next:From: Tom LaneDate: 2006-01-02 18:46:30
Subject: Re: What bison versions are installed on buildfarm machines?
Previous:From: Bruce MomjianDate: 2006-01-02 18:40:40
Subject: Stats collector performance improvement

pgsql-patches by date

Next:From: Bruce MomjianDate: 2006-01-02 19:13:47
Subject: Re: Stats collector performance improvement
Previous:From: Bruce MomjianDate: 2006-01-02 18:40:40
Subject: Stats collector performance improvement

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group