Re: Is there a way to limit CPU usage per user

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Luki Rustianto <lukirus(at)gmail(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Is there a way to limit CPU usage per user
Date: 2006-02-10 04:40:34
Message-ID: 20060210044034.GA64526@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Feb 10, 2006 at 11:30:04AM +0700, Luki Rustianto wrote:
> So how can we terminate such a long running query ?
>
> The idea is to make a crontab to periodicaly do a job to search a
> typical "SELECT * FROM bigtable" query who has run for some hours then
> to terminate them...

Are you familiar with the statement_timeout setting?

test=> SET statement_timeout TO 1000; -- milliseconds
SET
test=> SELECT <some long-running query>;
ERROR: canceling statement due to statement timeout

If that won't work then please explain in general terms what problem
you're trying to solve, not how you're trying to solve it.

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2006-02-10 06:28:00 Re: Sequences/defaults and pg_dump
Previous Message Michael Fuhr 2006-02-10 04:33:39 Re: Return more then one value using PL