Query Monitoring and Termination

Query monitoring and termination can be done manually from the Workbench or by running a JMX operation, and automatically by configuring GraphDB to abort queries after a certain query timeout is reached.

Query monitoring and termination using the Workbench

When there are running queries, their number is shown up next to the Repositories dropdown menu.

To track and interrupt long running queries:

  1. Go to Monitoring ‣ Queries or click the Running queries status next to the Repositories dropdown menu.

  2. Press the Abort query button to stop a query.

To pause the current state of the running queries, use the Pause button. Note that this will not stop their execution on the server.

_images/query-monitoring.png

To interrupt long running queries, click the Abort query button.

Attribute

Description

id

the ID of the query

node

local or remote worker node repository ID

type

the operation type QUERY or UPDATE

query

the first 500 characters of the query string

lifetime

the time in seconds since the iterator was created

state

the low level details for the current query collected over the JMX interface

You can also interrupt a query directly from the SPARQL Editor:

_images/editorWithAbort.png

Terminating a transaction

It is also possible to terminate a long committing update transaction. For example, when committing a ‘chain’ of many thousands of statements using some transitive property, the inferencer will attempt to materialize all possible combinations leading to hundreds of millions of inferred statements. In such a situation, you can abort the commit operation and roll back to the state the database had before the commit was attempted.

The following MBean is used:

Package

com.ontotext

MBean name

OwlimRepositoryManager

This MBean has no attributes:

Operation

Description

abortTransactionCommit

Requests that the currently executing (lengthy) commit operation be terminated and rolled back.

Automatically prevent long running queries

You can set a global query timeout period by adding a query-timeout configuration parameter. All queries will stop after the number of seconds you have set in it, where a default value of 0 indicates no limit.