Re: Using Threads?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Guenter <bruceg(at)em(dot)ca>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Using Threads?
Date: 2000-12-09 05:26:15
Message-ID: 200012090526.AAA14827@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Bruce Guenter <bruceg(at)em(dot)ca> writes:
> > [ some very interesting datapoints ]
> >
> > So, forking a process with lots of data is expensive. However, most of
> > the PostgreSQL data is in a SysV IPC shared memory segment, which
> > shouldn't affect the fork numbers.
>
> I believe (but don't have numbers to prove it) that most of the present
> backend startup time has *nothing* to do with thread vs process
> overhead. Rather, the primary startup cost has to do with initializing
> datastructures, particularly the system-catalog caches. A backend isn't
> going to get much real work done until it's slurped in a useful amount
> of catalog cache --- for example, until it's got the cache entries for
> pg_class and the indexes thereon, it's not going to accomplish anything
> at all.
>
> Switching to a thread model wouldn't help this cost a bit, unless
> we also switch to a shared cache model. That's not necessarily a win
> when you consider the increased costs associated with cross-backend
> or cross-thread synchronization needed to access or update the cache.
> And if it *is* a win, we could get most of the same benefit in the
> multiple-process model by keeping the cache in shared memory.

Of course, we would also have to know which database was being used
next. Each database's system catalog can be different.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Guenter 2000-12-09 05:46:26 Re: Re: CRC
Previous Message Bruce Momjian 2000-12-09 05:25:16 Re: Using Threads?