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

From Richard Huxton
Subject Re: Is there a way to limit CPU usage per user
Date
Msg-id 43E9B93F.7080502@archonet.com
Whole thread Raw
In response to Is there a way to limit CPU usage per user  (Luki Rustianto <lukirus@gmail.com>)
List pgsql-general
Luki Rustianto wrote:
> Hi All,
>
> Is there a way to limit user's CPU resource specially on "SELECT" query ?
>
> I hava a table with a lot of rows inside, if one sloopy DB users do a
> "SELECT * FROM bigtable"
> then CPU resource will go near 99% and this action will surely affect
> the other database performance ...

Not really - this is something for the operating-system, but most don't
provide sophisticated ways of managing processes running under one user
(postgres in this case).

If there are 5 queries going on, each should end up getting about 20% of
the resources anyway, if your OS is balancing things properly.

If a query needs a lot of CPU and you restrict it, then that query will
presumably run for longer and so affect more queries from other users.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Joachim Wieland
Date:
Subject: Re: Sequences/defaults and pg_dump
Next
From: Martijn van Oosterhout
Date:
Subject: Re: futex lockup?