Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
1  
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

1 Answer 1

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: http://linuxcommand.org/man_pages/taskset1.html

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

 
discard

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.