Обсуждение: How to run multi-processor question

Поиск
Список
Период
Сортировка

How to run multi-processor question

От
"Johnson, Shaunn"
Дата:

Howdy:

Running Postgres 7.1.3 on RedHat Linux 7.2 kernel 2.4.7
on an Intel box.

We are thinking about upgrading the box and adding a
second processor.  Provided that I can physically put
a second CPU in, how can I configure Postgres to
work with more than one proc, or better yet, submit jobs
to the least busiest proc.  What other things should I
be aware of?

Thanks!

-X

Re: How to run multi-processor question

От
Bill Moran
Дата:
Johnson, Shaunn wrote:
> Howdy:
>
> Running Postgres 7.1.3 on RedHat Linux 7.2 kernel 2.4.7
> on an Intel box.
>
> We are thinking about upgrading the box and adding a
> second processor.  Provided that I can physically put
> a second CPU in, how can I configure Postgres to
> work with more than one proc, or better yet, submit jobs
> to the least busiest proc.  What other things should I
> be aware of?

If your Linux is properly configured to use multiple
processors, PostgreSQL will work with no further tweaking.
Since PostgreSQL starts a new process for each connection,
it's up to the kernel to schedule execution properly, so
that both processors get used.

--
Bill Moran
Potential Technologies
http://www.potentialtech.com




Re: How to run multi-processor question

От
Ryan Mahoney
Дата:
Because of the multi-process design of postgresql it will automatically
take advantage of two (or more) processors if your kernel supports it.
As far as submitting to a specific process, the postmaster forks a
process for each connection, so each connection is getting a "fresh"
process and again it is up to your kernel to handle scheduling and
coordination.

-r

On Wed, 2002-06-26 at 10:01, Johnson, Shaunn wrote:
> Howdy:
>
> Running Postgres 7.1.3 on RedHat Linux 7.2 kernel 2.4.7
> on an Intel box.
>
> We are thinking about upgrading the box and adding a
> second processor.  Provided that I can physically put
> a second CPU in, how can I configure Postgres to
> work with more than one proc, or better yet, submit jobs
> to the least busiest proc.  What other things should I
> be aware of?
>
> Thanks!
>
> -X




Re: How to run multi-processor question

От
nconway@klamath.dyndns.org (Neil Conway)
Дата:
On Wed, Jun 26, 2002 at 10:01:12AM -0400, Johnson, Shaunn wrote:
> Running Postgres 7.1.3 on RedHat Linux 7.2 kernel 2.4.7
> on an Intel box.
>
> We are thinking about upgrading the box and adding a
> second processor.  Provided that I can physically put
> a second CPU in, how can I configure Postgres to
> work with more than one proc, or better yet, submit jobs
> to the least busiest proc.  What other things should I
> be aware of?

Assuming your OS is SMP-capable, Postgres will automatically
take advantage of any additional CPUs you add (assuming
you're running multiple queries concurrently -- a single
query will run on a single CPU). Which CPU a particular
Postgres backend runs on is left up to the scheduler.

FYI, PostgreSQL 7.2 has significantly improved performance
when running on an SMP machine.

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC



Re: How to run multi-processor question

От
"Steve Wolfe"
Дата:
> Running Postgres 7.1.3 on RedHat Linux 7.2 kernel 2.4.7
> on an Intel box.
>
> We are thinking about upgrading the box and adding a
> second processor.  Provided that I can physically put
> a second CPU in, how can I configure Postgres to
> work with more than one proc, or better yet, submit jobs
> to the least busiest proc.  What other things should I
> be aware of?

   Make sure that you have an SMP-aware kernel, and you're set.

steve




Re: How to run multi-processor question

От
Andrew Sullivan
Дата:
On Wed, Jun 26, 2002 at 10:01:12AM -0400, Johnson, Shaunn wrote:

> second processor.  Provided that I can physically put
> a second CPU in, how can I configure Postgres to
> work with more than one proc, or better yet,

Just run it.  The second process will go to the second processor.  So
if you run two queries, you'll get both processors used.  (Or you
might get something else, like the OS, running in one CPU while the
other handles queries, but you get the picture).  If you're asking
how to get the same process to run across two processors, you can't.

> submit jobs
> to the least busiest proc.  What other things should I

That happens automatically.  The kernel handles it.

A

--
----
Andrew Sullivan                               87 Mowat Avenue
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M6K 3E3
                                         +1 416 646 3304 x110




Re: How to run multi-processor question

От
Alvaro Herrera
Дата:
Johnson, Shaunn dijo:

> Running Postgres 7.1.3 on RedHat Linux 7.2 kernel 2.4.7
> on an Intel box.
>
> We are thinking about upgrading the box and adding a
> second processor.  Provided that I can physically put
> a second CPU in, how can I configure Postgres to
> work with more than one proc, or better yet, submit jobs
> to the least busiest proc.  What other things should I
> be aware of?

You do nothing.  The kernel will take care of giving each backend
process the idlest processor.  PostgreSQL is multiprocess, as opposed to
the multithreaded model of MySQL and others, so PostgreSQL itself cannot
do anything about the scheduling; it is left to the operating system.

Just be sure to use an SMP kernel.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"El número de instalaciones de UNIX se ha elevado a 10,
y se espera que este número aumente" (UPM, 1972)