Re: [ADMIN] When postgres will be faster?

From: sk(dot)list(at)comset(dot)net
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, pgsql-hackers(at)postgresql(dot)org, pgsql-admin(at)postgresql(dot)org, Marcin Mazurek - Multinet SA - Poznan <m(dot)mazurek(at)multinet(dot)pl>, sk(dot)list(at)comset(dot)net
Subject: Re: [ADMIN] When postgres will be faster?
Date: 1999-12-02 08:46:21
Message-ID: XFMail.991202114621.sk.list@comset.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

On 01-Dec-99 Bruce Momjian wrote:
>> > postmaster forks() and does not do an exec().
>>
>> >From postmaster log:
>>
>> FindExec: found "/usr/comset/dbase/bin/postgres" using argv[0]
>>
>> ps ax|grep pos
>>
>> 10665 ? R 0:01 /usr/comset/dbase/bin/postgres main.comset.com polithit
>> pol
>> 13329 ? S 0:24 /usr/comset/dbase/bin/postmaster -i
>> -D/usr/comset/dbase/dat
>>
>> These samples push me thinking it was fork/exec... :-(
>
> We re-exec the postmaster so it has an absolute path, which is sometimes
> needed for dynamic loading. We also need 5 paramaters to we can do ps
> display if forked backends.

But you know several ways to send parameters to child process...
So, You have:
1. Shared memory
2. Fifo file like /tmp/.s.PGSQL.ctl.pid-of-backend
3. Additional unnamed pipe opened for child
4. Signals like SIGUSR1 etc to force fetch parameters from somewhere.

So, in addition I found thet there is not nessesary to create a dynamic list of
child pool. You have static/dynamic linear array of backend running ;-). Waw!
Possible to add some additional info to this structure about pooled backend (I
offer before) to manage pool.

I hope I dig postgresql code this weekend to have ideas offer for developers
more constructively.

I think p.3 shown before is preferable. The main() of backend should gentle
read this pipe. Pipes in Unix have more that 1024 bytes buffer...

while (readCommand(....)) {
initBackend(...); // Same as parse args...
doQuery(..);
finishBackend(...);
}

readCommand() should use select() with timeout for check pipe. Then signal
received it set flag on and select() loop may finish on it with 0 returned.

SKiller
--------------------------
Sergei Keler
WebMaster of "ComSet"
E-Mail: skiller(at)comset(dot)net
http://www.comset.net
--------------------------

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Brenner 1999-12-02 11:41:46 Re: [HACKERS] perl-DBD-Pg (was Re: BOUNCE pgsql-ports@postgreSQL.org: Non-member submission from[Joe Brenner <doom@kzsu.stanford.edu>] (fwd))
Previous Message Hiroshi Inoue 1999-12-02 00:56:19 RE: [HACKERS] Re: [GENERAL] drop/rename table and transactions