2 postgresql processes on the same machine ?
2 postgresql processes on the same machine ?
От:
"Jean-Guillaume LALANNE" <jeanguillaume.lalanne@capgemini.com>
Дата:
Hi, I am pretty new to the postgresql community. 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, ...)? Thanks in advance for your answers. Best Regards, Jean-Guillaume LALANNE Our name has changed. Please update your address book to the following format: "recipient@capgemini.com". This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
Re: 2 postgresql processes on the same machine ?
От:
Oliver Fromme <olli@lurza.secnetix.de>
Дата:
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 recommend it. 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 problem.) 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. Best regards Oliver -- 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