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

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Luki Rustianto <lukirus(at)gmail(dot)com>, pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is there a way to limit CPU usage per user
Date: 2006-02-09 16:43:06
Message-ID: 1139503386.22740.110.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2006-02-08 at 15:42, Merlin Moncure wrote:
> > 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 ...
> >
> Yes, the answer is not to write the query in the first place :-). you
> can implement cursors, do client side browsing, or other techiniques
> to handle this problem more elegantly.
>
> try to follow rule of thumb to return minimal amount of data necessary
> to the client.

Note that another useful tip here is to use slony to produce as many
replicants as needed to handle that kind of thing.

We have our production pgsql machines in a slony setup, with pg01 being
accessible by the application that inserts and updates the data, and all
reporting apps hit pg02 and up to do selects and such.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-02-09 17:09:43 Re: PQputline error with pg_restore
Previous Message Shelby Cain 2006-02-09 15:53:03 Re: [ODBC] Problem using ODBC from .NET framework