Re: Controlling CPU Usage in PostgreSQL

Поиск
Список
Период
Сортировка
От Aaron Bono
Тема Re: Controlling CPU Usage in PostgreSQL
Дата
Msg-id bf05e51c0608011159h74ac3a44wdb98b8ab32803275@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Controlling CPU Usage in PostgreSQL  (Thomas Pundt <mlists@rp-online.de>)
Ответы Re: Controlling CPU Usage in PostgreSQL  (Scott Marlowe <smarlowe@g2switchworks.com>)
Re: Controlling CPU Usage in PostgreSQL  ("Joshua D. Drake" <jd@commandprompt.com>)
Список pgsql-admin
On 7/31/06, Thomas Pundt <mlists@rp-online.de> wrote:
On Monday 31 July 2006 10:06, Aaron Bono wrote:
| Is there a way I can tell PostgreSQL to give session a low priority so even
| if it does take the full CPU, it only does so if it would otherwise be
| idle?

the "nice" command might do what you want...

 
OK, so I tried:

su - postgres -c "nice -n 19 psql my_db"

The problem is, the psql command has a nice value of 19 but the PostgreSQL server process that psql has connected to is running with a nice value of 0.  My assumption is that, if I then run my functions, psql will get low priority but it is the server process that is running with normal priority that will still use up all the CPU.

Bottom line, I am skeptical if this will really achieve my goal - to have the functions run with low priority.

Is there a way to tell PostgreSQL to change the nice value of a particular connection?  I guess I could use renice but that means a lot of shell scripting to determine what PID to change - I am not a shell script expert and would rather not pursue that option.

==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
==================================================================

В списке pgsql-admin по дате отправления:

Предыдущее
От: Andy Shellam
Дата:
Сообщение: Re: online backup - v810 vs. v814
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Controlling CPU Usage in PostgreSQL