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
+33-32Lines changed: 33 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,26 @@
1
1
= Manage and Monitor Queries
2
2
:example-caption!:
3
-
: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.
3
+
:description: Monitoring and profiling {sqlpp} queries, Query Service nodes, and corresponding system resources is important for smoother operational performance and efficiency of the system.
In fact, often it is vital for diagnosing and troubleshooting issues such as query performance, resource bottlenecks, and overloading of various services.
8
+
In fact, often it's vital for diagnosing and troubleshooting issues such as query performance, resource bottlenecks, and overloading of various services.
9
9
10
10
include::ROOT:partial$component-signpost.adoc[]
11
11
12
-
System keyspaces provide various monitoring details and statistics about individual queries and the Query service.
12
+
System keyspaces provide various monitoring details and statistics about individual queries and the Query Service.
13
13
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.
14
14
15
15
For example, this can help identify:
16
16
17
17
* The top 10 slow or fast queries running on a particular query node or the cluster.
18
-
* Resource usage statistics of the query service, or resources used for a particular query.
18
+
* Resource usage statistics of the Query Service, or resources used for a particular query.
19
19
* Details about the active, completed, and prepared queries.
20
20
* Find long running queries that are running for more than 2 minutes.
21
21
22
22
These system keyspaces are transient in nature, and are not persisted to disk or permanent storage.
23
-
Hence, the information in the keyspaces pertains to the current instantiation of the Query service.
23
+
Hence, the information in the keyspaces pertains to the current instantiation of the Query Service.
24
24
25
25
You can access the Query management and monitoring system keyspaces using any of the following:
26
26
@@ -33,7 +33,7 @@ Using {sqlpp} enables you to obtain further insights from the keyspaces.
33
33
== Authentication and Client Privileges
34
34
35
35
Users must have the *Query System Catalog* role to access restricted system keyspaces.
36
-
For more details about user roles, see xref:learn:security/authorization-overview.adoc[Authorization].
36
+
For more information about user roles, see xref:learn:security/authorization-overview.adoc[Authorization].
37
37
38
38
== Examples on this Page
39
39
@@ -47,7 +47,7 @@ In the REST API examples:
47
47
== Monitor System Vitals
48
48
49
49
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.
50
-
This information can be very useful to assess the current workload and performance characteristics of a query node.
50
+
This information can be useful to assess the current workload and performance characteristics of a query node.
51
51
52
52
[#sys-vitals-get]
53
53
=== Get System Vitals
@@ -475,7 +475,7 @@ Getting prepared statements, as described in <<sys-prepared-get>>, returns resul
475
475
}
476
476
----
477
477
478
-
In this example, the names of the prepared statements are identical, but they are associated with different query contexts.
478
+
In this example, the names of the prepared statements are identical, but they're associated with different query contexts.
479
479
480
480
<.> The name of the prepared statement for the default query context
481
481
<.> The name of the prepared statement showing the associated query context
@@ -524,7 +524,7 @@ SELECT * FROM system:completed_requests;
524
524
--
525
525
====
526
526
527
-
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.
527
+
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.
528
528
The request could have been successful, or completed with errors.
529
529
530
530
To find requests that completed successfully, search for completed requests whose `state` is `completed` and whose `errorCount` field has the value `0`.
@@ -610,7 +610,7 @@ DELETE FROM system:completed_requests WHERE requestTime LIKE "2015-09-09%";
610
610
[[sys-completed-examples]]
611
611
=== Completed Request Details
612
612
613
-
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.
613
+
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 Couchbase Server 7.6.4 and later, you can stream completed requests to disk.
843
844
844
-
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.
845
+
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.
@@ -857,25 +858,25 @@ When set to any size greater than `0`, completed requests are streamed to archiv
857
858
The value of this property determines the size of the data to retain, per node.
858
859
The configuration for completed requests determines which requests are saved.
859
860
860
-
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.
861
-
The speed of the file system on which the server logs directory resides naturally affects the potential impact too.
861
+
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.
862
+
The speed of the file system on which the server logs directory resides may affect the request throughput also.
862
863
863
864
[#sys-history-files]
864
865
=== Archived Request Files
865
866
866
867
When streaming is enabled, completed requests are saved to GZIP archives with the prefix `local_request_log` in the Couchbase Server `logs` directory.
867
868
Each saved GZIP archive file contains multiple JSON entries, one for each for each recorded completed request.
868
869
869
-
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.
870
+
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.
870
871
871
-
When an archive file reaches or exceeds 100 MiB, it is finalized and saved to disk.
872
+
When an archive file reaches or exceeds 100 MiB, it's finalized and saved to disk.
872
873
This is not a hard limit -- entries are not truncated to adhere to it.
873
874
Files may also be finalized with less content, if nothing has been written to them for an extended period.
874
-
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.
875
+
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.
875
876
876
877
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.
877
878
When the specified limit is reached, older files are removed as necessary to make space for newly finalized files.
878
-
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.
879
+
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.
879
880
880
881
[#sys-history-view]
881
882
=== View Archived Requests
@@ -907,7 +908,7 @@ SELECT * FROM system:completed_requests_history;
907
908
--
908
909
====
909
910
910
-
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.
911
+
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.
911
912
Directly reading the files may be more useful in some cases.
912
913
913
914
[#query-monitoring-settings]
@@ -922,7 +923,7 @@ You can set query profiling to the following levels:
922
923
923
924
You can set query profiling in the following ways:
924
925
925
-
* At the <<enable-settings-for-a-query-engine,node level>>, so that it is enabled for all queries on that node.
926
+
* At the <<enable-settings-for-a-query-engine,node level>>, so that it's enabled for all queries on that node.
926
927
* At the <<enable-settings-per-session-or-per-query,request level>>, for individual queries.
927
928
928
929
For more information about Query settings and parameters, see xref:n1ql:n1ql-manage/query-settings.adoc[].
@@ -1079,12 +1080,12 @@ When a query executes a user-defined function, profiling information is availabl
1079
1080
1080
1081
When profiling is enabled:
1081
1082
1082
-
* If you are using the cbq shell or the Query REST API, query profiling information is returned with the query results.
1083
-
* If you are using the Query workbench, query profiling information is not returned with the query results.
1083
+
* If you're using the cbq shell or the Query REST API, query profiling information is returned with the query results.
1084
+
* If you're using the Query workbench, query profiling information is not returned with the query results.
1084
1085
1085
1086
.Phases Profile
1086
1087
====
1087
-
If you are using the cbq shell or the Query REST API, the following statistics are returned when `profile` is set to `phases`:
1088
+
If you're using the cbq shell or the Query REST API, the following statistics are returned when `profile` is set to `phases`:
1088
1089
1089
1090
[source,json]
1090
1091
----
@@ -1142,7 +1143,7 @@ If you are using the cbq shell or the Query REST API, the following statistics a
1142
1143
1143
1144
.Timings Profile
1144
1145
====
1145
-
If you are using the cbq shell or the Query REST API, the following statistics are returned when `profile` is set to `timings`:
1146
+
If you're using the cbq shell or the Query REST API, the following statistics are returned when `profile` is set to `timings`:
1146
1147
1147
1148
[source,json]
1148
1149
----
@@ -1305,7 +1306,7 @@ For field names and meanings, see xref:n1ql-rest-query:index.adoc#Profile[Profil
1305
1306
[[plan]]
1306
1307
=== Profiling Details in System Catalogs
1307
1308
1308
-
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.
1309
+
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.
1309
1310
1310
1311
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.
1311
1312
This captures the whole query plan, and includes profiling information regarding execution timings.
@@ -1507,4 +1508,4 @@ a| icon:check[fw] timings
1507
1508
1508
1509
== Related Links
1509
1510
1510
-
* Refer to xref:n1ql:n1ql-intro/sysinfo.adoc[Getting System Information] for more information on the system namespace.
1511
+
* For more information on the system namespace, see xref:n1ql:n1ql-intro/sysinfo.adoc[Getting System Information].
0 commit comments