On Tue, 2004-04-06 at 10:02, Henri Asseily wrote:

> The obvious solution is that before every SQL call you call "SET 
> ROWCOUNT $MAXROWCOUNT" (under Sybase) where I suggest $MAXROWCOUNT < 
> 20000.

On Sybase I would use server side resource limits (see sp_configure
'allow resource limits', and associated system stored procs). 

This allows you to limit the number of IOs, the amount of CPU, the
number of rows, etc. that a particular login is allowed to consume per
query/session/etc.

Michael


> On Apr 5, 2004, at 11:11 AM, Chris Mungall wrote:
> 
> >
> > I would like to provide power-users with a CGI interface to a database;
> > this interface would allow arbitrary SQL. I would also like to be able 
> > to
> > throttle queries that take too long to stop the db server getting 
> > backed
> > up with killer queries.
> >
> > Right now I am doing this:
> >
> >                 my $tag = "kill$$"."TAG";
> >                 my $tagf = "/tmp/$tag";
> >                 system("touch $tagf && chmod 777 $tagf && sleep 15 &&
> >                         test -f $tagf && kill -9 $$ && rm $tagf &");
> >
> >                 # execute query
> >                 $results = $dbh->do(...)
> >
> >                 # inactivate killer
> >                 system("rm $tagf &");
> >
> >                 # print results....
> >
> > However, this isn't much good as it just kills the CGI process, the 
> > killer
> > query carries on running on the db server.
> >
> > I have thought about extending my hacky shell kill pipe to also run
> > mysqladmin -kill and whatever the postgresql equivalent is, but then
> > thought:
> >
> >   - way too messy and hacky
> >   - someone must have solved this one already
> >
> > However, I couldn't find any module for dealing with this. Any
> > suggestions?
> >
> > Cheers
> > Chris
-- 
Michael Peppler                              Data Migrations, Inc.
[EMAIL PROTECTED]                       http://www.peppler.org/
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or 
long term contract positions - http://www.peppler.org/resume.html

Reply via email to