Skip to main content

Administrating MarkLogic Server

ODBC Request Monitoring and Cancellation

Request monitoring is supported for the ODBC app server in MarkLogic 10.0-9 and later. The following ODBC meters will be recorded for ODBC Requests:

Meter

Description

odbcRowsSent

The number of rows sent from the server over the network

odbcBytesSent

The total number of bytes sent from the server over the network

Prior to this feature, the Modules database assigned to an ODBC server served no purpose. Now, a file named /default.api is looked for in the Modules root - whether that be the filesystem or a Modules database - and the configuration defined in that file is heeded to.

When a query comes in over ODBC, the odbcRowsSent and odbcBytesSent meters and their values are output in the ODBC app server request log, given that Request Monitoring is enabled in /default.api.

Request cancellation is now enabled for ODBC server as well. The /default.api will take in unsigned long values as limits for odbcRowsSent and odbcBytesSent. If the number of rows or bytes sent exceed the limits defined in /default.api, the sending of rows over the network ends prematurely and SQL-ODBCREQLIMIT is thrown. elapsedTime is also supported for cancellation, and XDMP-EXTIME is thrown if the time limit is exceeded. lockCount and readSize are not relevant for ODBC.

These values are purely e-node metrics and are not recorded on any d-nodes.

Configuration example:

With the following /default.api in the Modules root, a query will be canceled for one of these reasons:

  • Run time exceeds 3 seconds.

  • The number of bytes sent to the client exceeds 200000.

  • The number of rows sent to the client exceeds 10000.

{
  "monitoring": {
   "general": { 
    "enabled": true
  },
 "limits" : {
 "elapsedTime" : 3,
    "odbcBytesSent": 200000,
    "odbcRowsSent": 10000
   }
  }
}