Jean-Guillaume LALANNE wrote:
> My question may seem a little bit strange but
> I'd like to know if it is possible to run 2
> postgresql processes with 2 separate databases on the
> same machine (change of the ports, different paths to
> logs, ...)?
It's possible (I've done it in the past), but I would not
If you don't need network connectivity (i.e. access the
database only locally), then there is no problem at all.
If you need network connectivity, you can run the two
(or more) instances of PostgreSQL on different ports,
or you can bind them to different IP addresses if your
host has multiple ones. (Note, PostgreSQL also uses a
UDP port on localhost to exchange statistics information,
but the port number is selected randomly, so there is no
However, in general it is not advisable to run multiple
database services (no matter if it's PostgreSQL or any
other) on the same physical machine. That's because the
processes will fight against each other for hardware
resources such as processor cache, disk cache, I/O band-
width etc. In the worst case, both processes constantly
trow each other out of the cache, effectively disabling
it (this effect is called "trashing").
If you run just one PostgreSQL master, it uses shared
memory to communicate with its child processes and use
efficient caching between them. If you run two (or more)
separate PostgreSQL masters, they cannot share any data
between each other.
In general, it is better to buy two cheaper machines than
to try to run two separate database services on one big
machine, expecially if you expect significant load on the
databases. At least that has been my experience. YMMV.
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.
cat man du : where Unix geeks go when they die
In response to
pgsql-novice by date
|Next:||From: Scott Marlowe||Date: 2004-07-29 17:45:04|
|Subject: Re: trying to run a query|
|Previous:||From: Tom Lane||Date: 2004-07-29 14:51:29|
|Subject: Re: Moving DB von Postgresql 7.3 to 7.4 |