Re: PostgreSQL process architecture question. - Mailing list pgsql-general

From Chris Browne
Subject Re: PostgreSQL process architecture question.
Date
Msg-id 878wtz275f.fsf@dba2.int.libertyrms.com
Whole thread Raw
In response to PostgreSQL process architecture question.  ("Amber" <guxiaobo1982@hotmail.com>)
List pgsql-general
guxiaobo1982@hotmail.com ("Amber") writes:
>    We know PostgreSQL uses one dedicated server process to serve one
>  client connection, what we want to know is whether PostgreSQL use
>  multiple threads inside agents processes to take advantage of
>  multiple CPUs. In our site we have only a few concurrent
>  connections, so what occurs inside > agent process is very
>  important to us.

No, PostgreSQL does not attempt to make any use of threading at this
time.  The FAQ describes this quite nicely:


http://wiki.postgresql.org/wiki/Developer_FAQ#Why_don.27t_you_use_threads.2C_raw_devices.2C_async-I.2FO.2C_.3Cinsert_your_favorite_wizz-bang_feature_here.3E.3F

"Why don't you use threads, raw devices, async-I/O, <insert your favorite wizz-bang feature here>?

There is always a temptation to use the newest operating system features as soon as they arrive. We resist that
temptation.

First, we support 15+ operating systems, so any new feature has to be
well established before we will consider it. Second, most new
wizz-bang features don't provide dramatic improvements. Third, they
usually have some downside, such as decreased reliability or
additional code required. Therefore, we don't rush to use new features
but rather wait for the feature to be established, then ask for
testing to show that a measurable improvement is possible.

As an example, threads are not currently used in the backend code because:

    * Historically, threads were unsupported and buggy.
    * An error in one backend can corrupt other backends.
    * Speed improvements using threads are small compared to the remaining backend startup time.
    * The backend code would be more complex.

So, we are not ignorant of new features. It is just that we are
cautious about their adoption. The TODO list often contains links to
discussions showing our reasoning in these areas."
--
select 'cbbrowne' || '@' || 'cbbrowne.com';
http://cbbrowne.com/info/oses.html
Given  recent  events in  Florida,  the  tourism  board in  Texas  has
developed a new  advertising campaign based on the  slogan "Ya'll come
to Texas, where we ain't shot a tourist in a car since November 1963."

pgsql-general by date:

Previous
From: Ben Kim
Date:
Subject: Re: [ADMIN] FW: How to upload data to postgres
Next
From: "Bayless Kirtley"
Date:
Subject: pgdump problem or question?