Re: [HACKERS] fork/exec for backend

Поиск
Список
Период
Сортировка
От Goran Thyni
Тема Re: [HACKERS] fork/exec for backend
Дата
Msg-id 19980124221653.8668.qmail@guevara.bildbasen.se
обсуждение исходный текст
Ответ на Re: [HACKERS] fork/exec for backend  (Tom <tom@sdf.com>)
Ответы Re: [HACKERS] fork/exec for backend  (Tom <tom@sdf.com>)
Re: [HACKERS] fork/exec for backend  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-hackers
   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.

1. Code is probably not shared between postmaster and postgres
   processes.

2. Some inits may be done once (by postmaster) and not repeated
   by every child.

3. (and most important)
   With no exec COW is in action, meaning:
   data pages in shared until changed.

COW is the key to how Linux can fork faster than most unices
starts a new thread. :-)

     Again, this only applies to "modern" systems, but FreeBSD definitely has
   this behaviour.

I don't know if *BSD has COW, but if should think so.

  best regards,
--
---------------------------------------------
G�ran Thyni, sysadm, JMS Bildbasen, Kiruna


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

Предыдущее
От: Tom
Дата:
Сообщение: Re: [HACKERS] fork/exec for backend
Следующее
От: Brett McCormick
Дата:
Сообщение: Re: [QUESTIONS] Re: [HACKERS] Show stopper ? (was: Re: "cruising" or "browsing" through tables using an index / ordering)