Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

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


  • From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
  • To: "Tony Wasson" <ajwasson(at)gmail(dot)com>, "Michael Fuhr" <mike(at)fuhr(dot)org>
  • Cc: "Luki Rustianto" <lukirus(at)gmail(dot)com>, "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: Fri, 10 Feb 2006 15:38:47 -0000
  • Message-id: <E7F85A1B5FF8D44C8A1AF6885BC9A0E40103E049@ratbert.vale-housing.co.uk> <text/plain>

 

> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org 
> [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Tony Wasson
> Sent: 10 February 2006 15:31
> To: Michael Fuhr
> Cc: Luki Rustianto; Merlin Moncure; pgsql-general(at)postgresql(dot)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.



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group