#1 2021-05-01 07:32:17

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,534
Website

Limit a DB statement execution time

We already have a DB query result size limitation, but I found this is not enough for stable REST API.
There is a situations when a small amount of data returns too long (full scan on huge table because of like '%bla-bla%' etc.)

To prevent such a situations for a REST instances I limit a statement execution time on the DB level.
For Oracle I uses a resources groups, for Postgres - a 'statement_timeout' session variable.

For SQL Server the only applicable solution I found is SQL_QUERY_TIMEOUT
and implement such timeout  by PR #395

@ab, I will port it to mORMot2 when will be approved for mORMot1

Last edited by mpv (2021-05-01 10:24:04)

Offline

#2 2021-05-01 09:36:48

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Limit a DB statement execution time

I have merged your PR.

Thanks for sharing!

Offline

#3 2021-05-01 10:23:09

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,534
Website

Re: Limit a DB statement execution time

Thanks. Back-ported to mORMot2 - https://github.com/synopse/mORMot2/pull/29  (not tested since there is no tests for mORMot2 ODBC yet) but hope will work

Offline

Board footer

Powered by FluxBB