Re: Is there a way to limit CPU usage per user - Mailing list pgsql-general

From Dave Page
Subject Re: Is there a way to limit CPU usage per user
Date
Msg-id E7F85A1B5FF8D44C8A1AF6885BC9A0E40103E049@ratbert.vale-housing.co.uk
Whole thread Raw
In response to Is there a way to limit CPU usage per user  (Luki Rustianto <lukirus@gmail.com>)
List pgsql-general

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Tony Wasson
> Sent: 10 February 2006 15:31
> To: Michael Fuhr
> Cc: Luki Rustianto; Merlin Moncure; pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Is there a way to limit CPU usage per user
>
> I may get flamed for this, but this is how I have killed errant
> processes.   I suspect you should pause for a long time before try to
> install plperlu.
>
> CREATE FUNCTION kill_pid(INTEGER) RETURNS TEXT AS
> $BODY$
>   my ($pid) = @_;
>   my $out=system("kill -TERM $pid");
>   return $out;
> $BODY$ language plperlu;
>
> REVOKE ALL ON FUNCTION kill_pid(INTEGER) FROM public;

Why not use pg_cancel_backend(pid) - (aside from it sending a SIGINT
rather than TERM)?

Regards, Dave.

pgsql-general by date:

Previous
From: Tony Wasson
Date:
Subject: Re: Is there a way to limit CPU usage per user
Next
From: Scott Marlowe
Date:
Subject: Re: Is there a way to limit CPU usage per user