Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

we have dedicated PostgreSQL(9.0.4) sever (ubuntu 10.04.2LTS) with 2CPUs (8 cores total). On some queries postgres processes eat up all CPU's and we are unable to ssh to our server. I wonder if is where any possibility to dedicate one core for OS/system use?

share|improve this question
Are you sure? A single database connection (a.k.a. single database proces), can only use a single core. That means that no query will ever be able to eat up all CPU's/cores. – Frank Heikens Feb 16 '12 at 6:48
up vote 4 down vote accepted

You'll need to change the Postgres' process affinity.

First you'll need schedutils:

apt-get install schedutils

Then you can use taskset to change the affinity for a certain PID. Here's the man page:

So you would ideally only dedicate 7 cores to Postgres, leaving 1 core for your system.

share|improve this answer
Taskset changes can also be added to the service startup script. I did the same for a MySQL instance. – Tim Brigham Feb 15 '12 at 12:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.