Great tip Jaime! 

(This page needs some massaging and improving but...) I put this tip here

Cheers.  Hope your weekend goes well.

On Fri, Oct 6, 2017 at 9:35 AM, Jaime Crespo <> wrote:

Sometimes I get questions on how to control queries running for longer
than intended on the wikireplicas. Since MariaDB 10.1 (the version
used on tools and the new wikireplicas), one can run:

SET max_statement_time = 300; [0]

And all subsequent queries on the same connection will be killed if
the run longer than 5 minutes. For example:

mariadb[(none)]> SET max_statement_time = 10;
Query OK, 0 rows affected (0.00 sec)

mariadb[(none)]> SELECT sleep(20);
| sleep(20) |
|         1 |
1 row in set (10.00 sec)

It works on quarry, too! [1] But not on the old wikireplicas.

This is of course not required, but 1) it will win you karma, by
making your requests not run longer you intended (making resources
available for others), and 2) it can limit the execution on web-based
tools, as it is unlikely that a user will wait for longer than 1-5
minutes on a browser- an error will be a better feedback and a freezed
loading page.


[0] <url:>
[1] <url:>

Jaime Crespo

Cloud mailing list

Chase Pettet
chasemp on phabricator and IRC