Обсуждение: Postgres and multiprocessor?

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

Postgres and multiprocessor?

От
mlists
Дата:
Can PostgreSQL use multiple processors if they are present in a
computer, and if so, how much will it speed up database server? Tnx in
advance.

Dragan



Re: Postgres and multiprocessor?

От
Grega Bremec
Дата:
...and on Mon, Mar 08, 2004 at 11:23:57AM +0100, mlists used the keyboard:
>
> Can PostgreSQL use multiple processors if they are present in a
> computer, and if so, how much will it speed up database server? Tnx in
> advance.
>
> Dragan

It can, on platforms that support SMP. The load will be balanced across the
processors on a per-backend basis, that is, an even number of concurrent
connections have a good chance of being spread across both processors evenly,
but that may vary according to the actual load on the machine.

PostgreSQL backend is, for the time being, not multithreaded, which means
that one single connection to the database backend will not experience any
benefit due to SMP architecture of the database server.

Hope this helped,
--
    Grega Bremec
    Senior Administrator
    Noviforum Ltd., Software & Media
    http://www.noviforum.si/

Вложения

Re: Postgres and multiprocessor?

От
Corey Edwards
Дата:
On Mon, 2004-03-08 at 02:23, mlists wrote:
> Can PostgreSQL use multiple processors if they are present in a
> computer, and if so, how much will it speed up database server? Tnx in
> advance.

Postgres has no special functionality regarding processors. Each
connection is handled by a separate process. A multi-CPU aware OS is
then free to run those as best it sees fit.

Given that databases are typically RAM or I/O bound as they scale,
adding more processors to a machine is not a silver bullet. Performance
is extremely dependent on the situation. If you really need a number to
satisfy a PHB, try 42.

Corey



Re: Postgres and multiprocessor?

От
"scott.marlowe"
Дата:
On Mon, 8 Mar 2004, mlists wrote:

> Can PostgreSQL use multiple processors if they are present in a
> computer, and if so, how much will it speed up database server? Tnx in
> advance.

Yes, Postgresql can use >1 CPU.  Each process can use one, and only one
CPU by itself.  however, the OS can use another CPU, and another user can
use another CPU.

The difference it makes depends greatly on your load.  If your database
application is CPU intensive, and currently CPU bound, then yes, of
course, the extra CPUS will help.  If your application is I/O / memory BW
bound, then no, extra CPUs won't help much.


Re: Postgres and multiprocessor?

От
Juan Miguel
Дата:
>>Can PostgreSQL use multiple processors if they are present in a
>>computer, and if so, how much will it speed up database server? Tnx in
>>advance.
>>
>>
Linux OS, can explode multiprocessors servers, therefore, each session
on postgres (a session = a process), can be allocated in a processor.
Multiple processors can help you, if you have a great number of sessions
(concurrently users connected to the database performing queries or
transactions). For example, if you have 2 CPUs, then the system can run
2 sessions at the same time (really this is not true, there are problems
acceding the buses, hardisk, raid, cache,...). If the operations are
heavy loaded calcs, then it helps your performance(throughput).

Even so, often, in theory, when you need a high number of concurrent
sessions, it's better to increase your RAM, speed up your busses or HDs,
change your filesystems or your RAID, ... or making a cluster with some
servers (I want to create a DB postgres cluster with two linux boxes,
for balancing the load)