Re: Change query priority
| От | Dawid Kuroczko |
|---|---|
| Тема | Re: Change query priority |
| Дата | |
| Msg-id | 758d5e7f0410100852168820aa@mail.gmail.com обсуждение исходный текст |
| Ответ на | Change query priority ("Eugeny Balakhonov" <c0ff75@mail.ru>) |
| Список | pgsql-general |
On Sun, 10 Oct 2004 19:12:51 +0400, Eugeny Balakhonov <c0ff75@mail.ru> wrote:
> I have a web site which uses PostgreSQL as a host database and a background
> program which uses this database too.
>
> I want to change priority for database queries of this background program to
> "low" and change priority for web site database queries to "high".
>
> It is possible?
I think you could create a daemon/cron job which would get process ids of
servers and renice them, like for instance (assuming perl script):
while (1) {
my @pids = map { $_->[0] } @{$dbh->selectall_arrayref("select
procpid from pg_stat_activity where usename = 'apache'")};
system("renice -10 @pids");
sleep 300;
}
Or something like this. SIlly idea but might do the trick.
В списке pgsql-general по дате отправления: