views:

409

answers:

4

I recently upgraded my server running CentOS 5.0 to a quad-core CPU from a dual-core CPU. Do I need a recompile to make use of the added cores? PostgreSQL was installed by compiling from source.

EDIT: The upgrade was from an Intel Xeon 5130 to an Intel Xeon 5345.

+1  A: 

If it's the same architecture, I don't think a recompile should be needed.

If it's a different architecture (x86 vs x86_64 vs amd64, etc.), then you will have to recompile.

Ben Alpert
+1  A: 

No, the multiprocessing is handled dynamically.

Mark Harrison
A: 

Presumably both the old and new chips are running x86_64 architecture. No recompile is necessary, however some tuning of the database and/or application might be to fully use those extra cores.

MarkR
+1  A: 

No, you will not need to recompile for PostgreSQL to take advantage of the additional cores.

What will happen is that the Linux scheduler will now be able to select two or more (up to four) postgresql threads/processes to run all at the same time, basically they are working in parallel rather than having to wait on each other to get a slice of CPU time. This means you are able to process data faster since now four different queries can be processed at the same time rather than just the two you had previously.

PostGreSQL has no further tuning required to take advantage of multiple cores/physical CPU's and it is entirely up to the OS. You basically improved your performance for the cost of a new CPU.

If you are looking for information on tuning your PostgreSQL take a look at this post on tuning PostgreSQL on a dedicated server.

Since you now have more processes able to run at the same time, you may also want to consider upgrading the amount of RAM you have depending on what you currently have installed, the more the database is able to be stored in memory the faster all of the transactions and queries will be!

X-Istence