Skip to content

Commit 994cd6b

Browse files
authored
DOC-13588: Issues with streaming completed requests (#434)
* Fix property name * Add completed-stream-size to Configure Queries ToC * Vale updates * Update preview config
1 parent 64418c3 commit 994cd6b

File tree

3 files changed

+57
-53
lines changed

3 files changed

+57
-53
lines changed

modules/n1ql/pages/n1ql-manage/monitoring-n1ql-query.adoc

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
= Manage and Monitor Queries
22
: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.
44
:page-aliases: monitoring:monitoring-n1ql-query, manage:monitor/monitoring-n1ql-query
55

66
[abstract]
77
{description}
8-
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.
99

1010
include::ROOT:partial$component-signpost.adoc[]
1111

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.
1313
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.
1414

1515
For example, this can help identify:
1616

1717
* 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.
1919
* Details about the active, completed, and prepared queries.
2020
* Find long running queries that are running for more than 2 minutes.
2121
2222
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.
2424

2525
You can access the Query management and monitoring system keyspaces using any of the following:
2626

@@ -33,7 +33,7 @@ Using {sqlpp} enables you to obtain further insights from the keyspaces.
3333
== Authentication and Client Privileges
3434

3535
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].
3737

3838
== Examples on this Page
3939

@@ -47,7 +47,7 @@ In the REST API examples:
4747
== Monitor System Vitals
4848

4949
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.
5151

5252
[#sys-vitals-get]
5353
=== Get System Vitals
@@ -470,7 +470,7 @@ Getting prepared statements, as described in <<sys-prepared-get>>, returns resul
470470
}
471471
----
472472
473-
In this example, the names of the prepared statements are identical, but they are associated with different query contexts.
473+
In this example, the names of the prepared statements are identical, but they're associated with different query contexts.
474474
475475
<.> The name of the prepared statement for the default query context
476476
<.> The name of the prepared statement showing the associated query context
@@ -519,7 +519,7 @@ SELECT * FROM system:completed_requests;
519519
--
520520
====
521521

522-
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.
522+
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.
523523
The request could have been successful, or completed with errors.
524524

525525
To find requests that completed successfully, search for completed requests whose `state` is `completed` and whose `errorCount` field has the value `0`.
@@ -605,7 +605,7 @@ DELETE FROM system:completed_requests WHERE requestTime LIKE "2015-09-09%";
605605
[[sys-completed-examples]]
606606
=== Completed Request Details
607607

608-
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.
608+
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.
609609

610610
.Run a long query
611611
====
@@ -708,7 +708,7 @@ curl $BASE_URL/admin/settings -u $USER:$PASSWORD \
708708
=== Logging Qualifiers
709709

710710
You can specify the following logging qualifiers.
711-
A completed request is logged if _any_ of the qualifiers are met (logical OR).
711+
A completed request is logged if any of the qualifiers are met (logical OR).
712712

713713
[horizontal]
714714
`threshold`:: The execution time threshold in milliseconds.
@@ -722,11 +722,12 @@ A completed request is logged if _any_ of the qualifiers are met (logical OR).
722722

723723
For full details, see xref:n1ql-rest-admin:index.adoc#Logging_Parameters[Logging Parameters].
724724

725-
The basic syntax adds a qualifier to the logging parameters, i.e. any existing qualifiers are not removed.
725+
The basic syntax adds a qualifier to the logging parameters.
726+
Any existing qualifiers are not removed.
726727
You can change the value of a logging qualifier by specifying the same qualifier again with a new value.
727728

728-
To add a new instance of an existing qualifier, use a plus sign (`+`) before the qualifier name, e.g. `+user`.
729-
To remove a qualifier, use a minus sign (`-`) before the qualifier name, e.g. `-user`.
729+
To add a new instance of an existing qualifier, use a plus sign (`+`) before the qualifier name, such as `+user`.
730+
To remove a qualifier, use a minus sign (`-`) before the qualifier name, such as `-user`.
730731

731732
For example, the following request will add user `simon` to those tracked, and remove error `12003`.
732733

@@ -777,7 +778,7 @@ You cannot add a new instance of an existing qualifier to a tagged set using a p
777778
For example, you cannot add a `user` qualifier to a tagged set that already contains a `user` qualifier.
778779
If you need to track two users with the same error, create two tagged sets, one per user.
779780

780-
You can remove a qualifier from a tagged set using a minus sign (`-`) before the qualifier name, e.g. `-user`.
781+
You can remove a qualifier from a tagged set using a minus sign (`-`) before the qualifier name, such as `-user`.
781782
When you remove the last qualifier from a tagged set, the tagged set is removed.
782783

783784
[NOTE]
@@ -794,7 +795,7 @@ In this case, completed requests are logged if they match any of the individual
794795
The [.param]`completed-threshold` field provides another way of specifying the `threshold` qualifier within the `completed` field.
795796

796797
This field sets the minimum request duration after which requests are added to the `system:completed_requests` catalog.
797-
The default value is 1000ms.
798+
The default value is 1000{nbsp}ms.
798799
Specify [.in]`0` to log all requests and [.in]`-1` to not log any requests to the keyspace.
799800

800801
To specify a different value, use:
@@ -828,13 +829,13 @@ curl $BASE_URL/admin/settings -u $USER:$PASSWORD \
828829

829830
In Couchbase Server 7.6.4 and later, you can stream completed requests to disk.
830831

831-
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.
832+
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.
832833

833834
[source,sh]
834835
----
835836
curl $BASE_URL/admin/settings -u $USER:$PASSWORD \
836837
-H 'Content-Type: application/json' \
837-
-d '{"completed_stream_size":500}'
838+
-d '{"completed-stream-size": 500}'
838839
----
839840

840841
This property is a file size in MiB.
@@ -844,25 +845,25 @@ When set to any size greater than `0`, completed requests are streamed to archiv
844845
The value of this property determines the size of the data to retain, per node.
845846
The configuration for completed requests determines which requests are saved.
846847

847-
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.
848-
The speed of the file system on which the server logs directory resides naturally affects the potential impact too.
848+
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.
849+
The speed of the file system on which the server logs directory resides may affect the request throughput also.
849850

850851
[#sys-history-files]
851852
=== Archived Request Files
852853

853854
When streaming is enabled, completed requests are saved to GZIP archives with the prefix `local_request_log` in the Couchbase Server `logs` directory.
854855
Each saved GZIP archive file contains multiple JSON entries, one for each for each recorded completed request.
855856

856-
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.
857+
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.
857858

858-
When an archive file reaches or exceeds 100 MiB, it is finalized and saved to disk.
859+
When an archive file reaches or exceeds 100 MiB, it's finalized and saved to disk.
859860
This is not a hard limit -- entries are not truncated to adhere to it.
860861
Files may also be finalized with less content, if nothing has been written to them for an extended period.
861-
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.
862+
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.
862863

863864
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.
864865
When the specified limit is reached, older files are removed as necessary to make space for newly finalized files.
865-
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.
866+
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.
866867

867868
[#sys-history-view]
868869
=== View Archived Requests
@@ -894,7 +895,7 @@ SELECT * FROM system:completed_requests_history;
894895
--
895896
====
896897

897-
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.
898+
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.
898899
Directly reading the files may be more useful in some cases.
899900

900901
[#query-monitoring-settings]
@@ -909,7 +910,7 @@ You can set query profiling to the following levels:
909910

910911
You can set query profiling in the following ways:
911912

912-
* At the <<enable-settings-for-a-query-engine,node level>>, so that it is enabled for all queries on that node.
913+
* At the <<enable-settings-for-a-query-engine,node level>>, so that it's enabled for all queries on that node.
913914
* At the <<enable-settings-per-session-or-per-query,request level>>, for individual queries.
914915

915916
For more information about Query settings and parameters, see xref:n1ql:n1ql-manage/query-settings.adoc[].
@@ -1066,12 +1067,12 @@ When a query executes a user-defined function, profiling information is availabl
10661067

10671068
When profiling is enabled:
10681069

1069-
* If you are using the cbq shell or the Query REST API, query profiling information is returned with the query results.
1070-
* If you are using the Query workbench, query profiling information is not returned with the query results.
1070+
* If you're using the cbq shell or the Query REST API, query profiling information is returned with the query results.
1071+
* If you're using the Query workbench, query profiling information is not returned with the query results.
10711072

10721073
.Phases Profile
10731074
====
1074-
If you are using the cbq shell or the Query REST API, the following statistics are returned when `profile` is set to `phases`:
1075+
If you're using the cbq shell or the Query REST API, the following statistics are returned when `profile` is set to `phases`:
10751076
10761077
[source,json]
10771078
----
@@ -1129,7 +1130,7 @@ If you are using the cbq shell or the Query REST API, the following statistics a
11291130

11301131
.Timings Profile
11311132
====
1132-
If you are using the cbq shell or the Query REST API, the following statistics are returned when `profile` is set to `timings`:
1133+
If you're using the cbq shell or the Query REST API, the following statistics are returned when `profile` is set to `timings`:
11331134
11341135
[source,json]
11351136
----
@@ -1292,7 +1293,7 @@ For field names and meanings, see xref:n1ql-rest-query:index.adoc#Profile[Profil
12921293
[[plan]]
12931294
=== Profiling Details in System Catalogs
12941295

1295-
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.
1296+
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.
12961297

12971298
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.
12981299
This captures the whole query plan, and includes profiling information regarding execution timings.
@@ -1494,4 +1495,4 @@ a| icon:check[fw] timings
14941495

14951496
== Related Links
14961497

1497-
* Refer to xref:n1ql:n1ql-intro/sysinfo.adoc[Getting System Information] for more information on the system namespace.
1498+
* For more information on the system namespace, see xref:n1ql:n1ql-intro/sysinfo.adoc[Getting System Information].

0 commit comments

Comments
 (0)