You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/n1ql/pages/n1ql-manage/monitoring-n1ql-query.adoc
+32-33Lines changed: 32 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
= Manage and Monitor Queries
2
2
:example-caption!:
3
3
:alt-markdown-links:
4
-
:description: Monitoring and profiling {sqlpp} queries, query service nodes, and corresponding system resources is very important for smoother operational performance and efficiency of the system.
4
+
:description: Monitoring and profiling {sqlpp} queries, Query Service nodes, and corresponding system resources is important for smoother operational performance and efficiency of the system.
5
5
6
6
ifdef::basebackend-html[]
7
7
++++
@@ -55,22 +55,22 @@ endif::[]
55
55
56
56
[abstract]
57
57
{description}
58
-
In fact, often it is vital for diagnosing and troubleshooting issues such as query performance, resource bottlenecks, and overloading of various services.
58
+
In fact, often it's vital for diagnosing and troubleshooting issues such as query performance, resource bottlenecks, and overloading of various services.
59
59
60
60
include::ROOT:partial$component-signpost.adoc[]
61
61
62
-
System keyspaces provide various monitoring details and statistics about individual queries and the Query service.
62
+
System keyspaces provide various monitoring details and statistics about individual queries and the Query Service.
63
63
When running on a cluster with multiple query nodes, stats about all queries on all query nodes are collected in the Query management and monitoring system keyspaces.
64
64
65
65
For example, this can help identify:
66
66
67
67
* The top 10 slow or fast queries running on a particular query node or the cluster.
68
-
* Resource usage statistics of the query service, or resources used for a particular query.
68
+
* Resource usage statistics of the Query Service, or resources used for a particular query.
69
69
* Details about the active, completed, and prepared queries.
70
70
* Find long running queries that are running for more than 2 minutes.
71
71
72
72
These system keyspaces are transient in nature, and are not persisted to disk or permanent storage.
73
-
Hence, the information in the keyspaces pertains to the current instantiation of the Query service.
73
+
Hence, the information in the keyspaces pertains to the current instantiation of the Query Service.
74
74
75
75
You can access the Query management and monitoring system keyspaces using any of the following:
76
76
@@ -85,7 +85,7 @@ Using {sqlpp} enables you to obtain further insights from the keyspaces.
85
85
== Authentication and Client Privileges
86
86
87
87
Users must have permission to access restricted system keyspaces.
88
-
For more details about cluster credentials, see xref:clusters:manage-database-users.adoc[].
88
+
For information about cluster credentials, see xref:clusters:manage-database-users.adoc[].
89
89
90
90
ifdef::flag-devex-rest-api[]
91
91
== Examples on this Page
@@ -101,7 +101,7 @@ endif::flag-devex-rest-api[]
101
101
== Monitor System Vitals
102
102
103
103
The `system:vitals` catalog provides data about the running state and health of the query nodes, such as number of logical cores, active threads, queued threads, CPU utilization, memory usage, network utilization, garbage collection percentage, and so on.
104
-
This information can be very useful to assess the current workload and performance characteristics of a query node.
104
+
This information can be useful to assess the current workload and performance characteristics of a query node.
105
105
106
106
[#sys-vitals-get]
107
107
=== Get System Vitals
@@ -569,7 +569,7 @@ Getting prepared statements, as described in <<sys-prepared-get>>, returns resul
569
569
}
570
570
----
571
571
572
-
In this example, the names of the prepared statements are identical, but they are associated with different query contexts.
572
+
In this example, the names of the prepared statements are identical, but they're associated with different query contexts.
573
573
574
574
<.> The name of the prepared statement for the default query context
575
575
<.> The name of the prepared statement showing the associated query context
@@ -626,7 +626,7 @@ SELECT * FROM system:completed_requests;
626
626
--
627
627
====
628
628
629
-
Note that the `completed` state means that the request was started and completed by the Query service, but it does not mean that it was necessarily successful.
629
+
The `completed` state means that the request was started and completed by the Query Service, but it does not mean that it was necessarily successful.
630
630
The request could have been successful, or completed with errors.
631
631
632
632
To find requests that completed successfully, search for completed requests whose `state` is `completed` and whose `errorCount` field has the value `0`.
@@ -718,7 +718,7 @@ DELETE FROM system:completed_requests WHERE requestTime LIKE "2015-09-09%";
718
718
[[sys-completed-examples]]
719
719
=== Completed Request Details
720
720
721
-
To try the examples in this section, first run a query which takes at least 1000ms (the default value of the `completed-threshold` query setting) to get registered in the `system:completed_requests` keyspace.
721
+
To try the examples in this section, first run a query which takes at least 1000{nbsp}ms (the default value of the `completed-threshold` query setting) to get registered in the `system:completed_requests` keyspace.
In clusters running Couchbase Server 7.6.4 and later, you can stream completed requests to disk.
950
951
951
-
To enable completed request streaming, use the xref:n1ql:n1ql-rest-api/admin.adoc[Admin REST API] `/admin/settings` endpoint to specify the `completed_stream_size` property.
@@ -964,25 +963,25 @@ When set to any size greater than `0`, completed requests are streamed to archiv
964
963
The value of this property determines the size of the data to retain, per node.
965
964
The configuration for completed requests determines which requests are saved.
966
965
967
-
NOTE: The additional processing required to save completed requests to disk may limit overall request throughput on a Query node, but typically only when every completed request is being recorded, and requests are very small or short-lived.
968
-
The speed of the file system on which the server logs directory resides naturally affects the potential impact too.
966
+
NOTE: The additional processing required to save completed requests to disk may limit overall request throughput on a Query node, but typically only when every completed request is being recorded, and requests are small or short-lived.
967
+
The speed of the file system on which the server logs directory resides may affect the request throughput also.
969
968
970
969
[#sys-history-files]
971
970
=== Archived Request Files
972
971
973
972
When streaming is enabled, completed requests are saved to GZIP archives with the prefix `local_request_log` in the Couchbase Server `logs` directory.
974
973
Each saved GZIP archive file contains multiple JSON entries, one for each for each recorded completed request.
975
974
976
-
Couchbase Server writes multiple archive files in parallel, so whilst the order of requests in a file is sequential, a single given file may not contain a contiguous sequence of requests.
975
+
Couchbase Server writes multiple archive files in parallel, so while the order of requests in a file is sequential, a single given file may not contain a contiguous sequence of requests.
977
976
978
-
When an archive file reaches or exceeds 100 MiB, it is finalized and saved to disk.
977
+
When an archive file reaches or exceeds 100 MiB, it's finalized and saved to disk.
979
978
This is not a hard limit -- entries are not truncated to adhere to it.
980
979
Files may also be finalized with less content, if nothing has been written to them for an extended period.
981
-
Files that are actively being written are not available for reading, and they don't count towards the configured size limit until they're finalized.
980
+
Files that are actively being written are not available for reading, and they do not count towards the configured size limit until they're finalized.
982
981
983
982
Couchbase Server tries to manage and retain archive files such that the total disk space used by the files is within the specified limit for the node.
984
983
When the specified limit is reached, older files are removed as necessary to make space for newly finalized files.
985
-
When a file is removed, it isn't guaranteed that only the oldest requests are evicted, given that Couchbase Server writes to multiple archive files in parallel.
984
+
When a file is removed, it's not guaranteed that only the oldest requests are evicted, given that Couchbase Server writes to multiple archive files in parallel.
986
985
987
986
[#sys-history-view]
988
987
=== View Archived Requests
@@ -1014,7 +1013,7 @@ SELECT * FROM system:completed_requests_history;
1014
1013
--
1015
1014
====
1016
1015
1017
-
The `system:completed_requests_history` keyspace is provided for {sqlpp} access to the archived files, but as they are external GZIP archives performance is restricted, particularly with large histories on clusters with multiple Query service nodes.
1016
+
The `system:completed_requests_history` keyspace is provided for {sqlpp} access to the archived files, but as they're external GZIP archives performance is restricted, particularly with large histories on clusters with multiple Query Service nodes.
1018
1017
Directly reading the files may be more useful in some cases.
1019
1018
endif::flag-devex-rest-api[]
1020
1019
@@ -1031,7 +1030,7 @@ You can set query profiling to the following levels:
1031
1030
You can set query profiling:
1032
1031
1033
1032
ifdef::flag-devex-rest-api[]
1034
-
* At the <<enable-settings-for-a-query-engine,node level>>, so that it is enabled for all queries on that node.
1033
+
* At the <<enable-settings-for-a-query-engine,node level>>, so that it's enabled for all queries on that node.
1035
1034
endif::flag-devex-rest-api[]
1036
1035
* At the <<enable-settings-per-session-or-per-query,request level>>, for individual queries.
1037
1036
@@ -1196,16 +1195,16 @@ When a query executes a user-defined function, profiling information is availabl
1196
1195
1197
1196
When profiling is enabled:
1198
1197
1199
-
* If you are using
1198
+
* If you're using
1200
1199
ifdef::flag-devex-rest-api[]
1201
1200
the Query REST API or
1202
1201
endif::flag-devex-rest-api[]
1203
1202
the cbq shell, query profiling information is returned with the query results.
1204
-
* If you are using the Query tab, query profiling information is not returned with the query results.
1203
+
* If you're using the Query tab, query profiling information is not returned with the query results.
1205
1204
1206
1205
.Phases Profile
1207
1206
====
1208
-
If you are using
1207
+
If you're using
1209
1208
ifdef::flag-devex-rest-api[]
1210
1209
the Query REST API or
1211
1210
endif::flag-devex-rest-api[]
@@ -1267,7 +1266,7 @@ the cbq shell, the following statistics are returned when `profile` is set to `p
The <<sys-active-req,system:active_requests>> and <<sys-completed-req,system:completed_requests>> system catalogs always return profiling information regarding query phases: that is, phase times, phase counts, and phase operators.
1450
+
The <<sys-active-req,system:active_requests>> and <<sys-completed-req,system:completed_requests>> system catalogs always return profiling information regarding query phases: namely, phase times, phase counts, and phase operators.
1452
1451
1453
1452
The <<sys-active-req,system:active_requests>>, <<sys-completed-req,system:completed_requests>>, and <<sys-prepared,system:prepareds>> system catalogs also support the `meta().plan` virtual attribute.
1454
1453
This captures the whole query plan, and includes profiling information regarding execution timings.
@@ -1657,4 +1656,4 @@ a| icon:check[fw] timings
1657
1656
1658
1657
== Related Links
1659
1658
1660
-
* Refer to xref:n1ql:n1ql-intro/sysinfo.adoc[Getting System Information] for more information on the system namespace.
1659
+
* For more information on the system namespace, see xref:n1ql:n1ql-intro/sysinfo.adoc[Getting System Information].
If the request contains a `BEGIN TRANSACTION` statement, or a DML statement with the <<tximplicit,tximplicit>> parameter set to `true`, then the <<scan_consistency,scan_consistency>> parameter sets the [def]__transactional scan consistency__.
175
+
If the request contains a `BEGIN TRANSACTION` statement, or a DML statement with the <<tximplicit,tximplicit>> parameter set to `true`, then the <<scan_consistency,scan_consistency>> parameter sets the transactional scan consistency.
176
176
If you specify a transactional scan consistency of `request_plus`, `statement_plus`, or `at_plus`, or if you specify no transactional scan consistency, the transactional scan consistency is set to `request_plus`; otherwise, the transactional scan consistency is set as specified.
177
177
178
178
.Transactional scan consistency
@@ -199,7 +199,7 @@ If you specify a scan consistency of `not_bounded` for a statement within the tr
199
199
When you specify a scan consistency of `request_plus`, `statement_plus`, or `at_plus` for a statement within the transaction, the scan consistency for the statement is set to `request_plus`.
200
200
201
201
However, `request_plus` consistency is not supported for statements using a full-text index.
202
-
If any statement within the transaction uses a full-text index, by means of the SEARCH function or the Flex Index feature, the scan consistency is set to `not_bounded` for the duration of the full-text search.
202
+
If any statement within the transaction uses a full-text index, by means of the SEARCH function or the Flex Index feature, the scan consistency is set to `not_bounded` for the duration of the Full-Text Search.
203
203
204
204
.Overriding the transactional scan consistency
205
205
[%header, cols="2"]
@@ -209,7 +209,7 @@ If any statement within the transaction uses a full-text index, by means of the
209
209
210
210
| Not set
211
211
| Transactional scan consistency +
212
-
(`not_bounded` for full-text search)
212
+
(`not_bounded` for Full-Text Search)
213
213
214
214
| `not_bounded`
215
215
| `not_bounded`
@@ -218,7 +218,7 @@ If any statement within the transaction uses a full-text index, by means of the
0 commit comments