Re: [HACKERS] fork/exec for backend

From: Tom <tom(at)sdf(dot)com>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: goran(at)bildbasen(dot)se, hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] fork/exec for backend
Date: 1998-01-25 00:51:11
Message-ID: Pine.BSF.3.95q.980124164748.20454A-100000@misery.sdf.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Sat, 24 Jan 1998, Bruce Momjian wrote:

> > On 24 Jan 1998, Goran Thyni wrote:
> >
> > > Fork on modern unices (linux and (a think) *BSD) cost
> > > almost nothing (in time and memory) thanks to COW (copy-on-write).
> > > Exec in expensive as it breaks COW.
> >
> > Not so. Modern Unixs will share executable address space between
> > processes. So if you fork and exec 10 identical programs, they will share
> > most address space.
> >
> > If you want to speed this up, link postgresql static. This makes exec()
> > cost almost nothing too. postgresql becomes its own best shared library.
> >
> > Again, this only applies to "modern" systems, but FreeBSD definitely has
> > this behaviour.
>
> This is very OS-specific. SunOS-style shared libraries do have a
> noticable overhead for each function call. In fact, even though these
> are part of BSD44 source, BSDI does not use them, and uses a more crude
> shared library jump table, similar to SVr3 shared libraries because of
> the SunOS shared library overhead.

Regardless on the method used, the dynamic executables need to undergo a
link step during exec(). Linking static reduces that.

> I think FreeBSD and Lunix use SunOS style shared libraries, often called
> dynamic shared libraries because you can change the function while the
> binary is running if you are realy careful.

Linux uses ELF shared libraries. I don't know how those work.

I don't FreeBSD to have a high call overhead for dynamic libs at all.
Static executables just start faster thats all.

> --
> Bruce Momjian
> maillist(at)candle(dot)pha(dot)pa(dot)us
>
>

Tom

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Vicherek 1998-01-25 01:11:10 Re: Browsing the tables / why pgsql does not perform well (with temp fix)
Previous Message Bruce Momjian 1998-01-25 00:27:26 Re: [HACKERS] Revoke update on Column