Skip to content

Commit 3f81400

Browse files
committed
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 4698168 commit 3f81400

File tree

3 files changed

+44
-43
lines changed

3 files changed

+44
-43
lines changed

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

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
= Manage and Monitor Queries
22
:example-caption!:
33
: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.
55

66
ifdef::basebackend-html[]
77
++++
@@ -55,22 +55,22 @@ endif::[]
5555

5656
[abstract]
5757
{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.
5959

6060
include::ROOT:partial$component-signpost.adoc[]
6161

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.
6363
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.
6464

6565
For example, this can help identify:
6666

6767
* 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.
6969
* Details about the active, completed, and prepared queries.
7070
* Find long running queries that are running for more than 2 minutes.
7171
7272
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.
7474

7575
You can access the Query management and monitoring system keyspaces using any of the following:
7676

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

8787
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[].
8989

9090
ifdef::flag-devex-rest-api[]
9191
== Examples on this Page
@@ -101,7 +101,7 @@ endif::flag-devex-rest-api[]
101101
== Monitor System Vitals
102102

103103
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.
105105

106106
[#sys-vitals-get]
107107
=== Get System Vitals
@@ -569,7 +569,7 @@ Getting prepared statements, as described in <<sys-prepared-get>>, returns resul
569569
}
570570
----
571571
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.
573573
574574
<.> The name of the prepared statement for the default query context
575575
<.> The name of the prepared statement showing the associated query context
@@ -626,7 +626,7 @@ SELECT * FROM system:completed_requests;
626626
--
627627
====
628628

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.
630630
The request could have been successful, or completed with errors.
631631

632632
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%";
718718
[[sys-completed-examples]]
719719
=== Completed Request Details
720720

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.
722722

723723
.Run a long query
724724
====
@@ -829,7 +829,7 @@ curl $BASE_URL/admin/settings -u $USER:$PASSWORD \
829829
=== Logging Qualifiers
830830

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

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

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

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

850-
To add a new instance of an existing qualifier, use a plus sign (`+`) before the qualifier name, e.g. `+user`.
851-
To remove a qualifier, use a minus sign (`-`) before the qualifier name, e.g. `-user`.
851+
To add a new instance of an existing qualifier, use a plus sign (`+`) before the qualifier name, such as `+user`.
852+
To remove a qualifier, use a minus sign (`-`) before the qualifier name, such as `-user`.
852853

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

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

902-
You can remove a qualifier from a tagged set using a minus sign (`-`) before the qualifier name, e.g. `-user`.
903+
You can remove a qualifier from a tagged set using a minus sign (`-`) before the qualifier name, such as `-user`.
903904
When you remove the last qualifier from a tagged set, the tagged set is removed.
904905

905906
[NOTE]
@@ -916,7 +917,7 @@ In this case, completed requests are logged if they match any of the individual
916917
The [.param]`completed-threshold` field provides another way of specifying the `threshold` qualifier within the `completed` field.
917918

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

922923
To specify a different value, use:
@@ -948,13 +949,11 @@ curl $BASE_URL/admin/settings -u $USER:$PASSWORD \
948949

949950
In clusters running Couchbase Server 7.6.4 and later, you can stream completed requests to disk.
950951

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.
952-
953952
[source,sh]
954953
----
955954
curl $BASE_URL/admin/settings -u $USER:$PASSWORD \
956955
-H 'Content-Type: application/json' \
957-
-d '{"completed_stream_size":500}'
956+
-d '{"completed-stream-size": 500}'
958957
----
959958

960959
This property is a file size in MiB.
@@ -964,25 +963,25 @@ When set to any size greater than `0`, completed requests are streamed to archiv
964963
The value of this property determines the size of the data to retain, per node.
965964
The configuration for completed requests determines which requests are saved.
966965

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.
969968

970969
[#sys-history-files]
971970
=== Archived Request Files
972971

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

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.
977976

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.
979978
This is not a hard limit -- entries are not truncated to adhere to it.
980979
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.
982981

983982
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.
984983
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.
986985

987986
[#sys-history-view]
988987
=== View Archived Requests
@@ -1014,7 +1013,7 @@ SELECT * FROM system:completed_requests_history;
10141013
--
10151014
====
10161015

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.
10181017
Directly reading the files may be more useful in some cases.
10191018
endif::flag-devex-rest-api[]
10201019

@@ -1031,7 +1030,7 @@ You can set query profiling to the following levels:
10311030
You can set query profiling:
10321031

10331032
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.
10351034
endif::flag-devex-rest-api[]
10361035
* At the <<enable-settings-per-session-or-per-query,request level>>, for individual queries.
10371036

@@ -1196,16 +1195,16 @@ When a query executes a user-defined function, profiling information is availabl
11961195

11971196
When profiling is enabled:
11981197

1199-
* If you are using
1198+
* If you're using
12001199
ifdef::flag-devex-rest-api[]
12011200
the Query REST API or
12021201
endif::flag-devex-rest-api[]
12031202
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.
12051204

12061205
.Phases Profile
12071206
====
1208-
If you are using
1207+
If you're using
12091208
ifdef::flag-devex-rest-api[]
12101209
the Query REST API or
12111210
endif::flag-devex-rest-api[]
@@ -1267,7 +1266,7 @@ the cbq shell, the following statistics are returned when `profile` is set to `p
12671266

12681267
.Timings Profile
12691268
====
1270-
If you are using
1269+
If you're using
12711270
ifdef::flag-devex-rest-api[]
12721271
the Query REST API or
12731272
endif::flag-devex-rest-api[]
@@ -1448,7 +1447,7 @@ include::n1ql-rest-query:partial$definitions/Statistics/definition-end.adoc[opts
14481447
[[plan]]
14491448
=== Profiling Details in System Catalogs
14501449

1451-
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.
14521451

14531452
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.
14541453
This captures the whole query plan, and includes profiling information regarding execution timings.
@@ -1657,4 +1656,4 @@ a| icon:check[fw] timings
16571656

16581657
== Related Links
16591658

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

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= Configure Queries
2-
:description: You can configure the Query service using request-level query parameters.
2+
:description: You can configure the Query Service using request-level query parameters.
33
:page-partial:
44
:alt-markdown-links:
55

@@ -172,7 +172,7 @@ include::n1ql-rest-query:index.adoc[tag=Credentials]
172172
[discrete#transactional-scan-consistency]
173173
===== Transactional Scan Consistency
174174

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 [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.
176176
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.
177177

178178
.Transactional scan consistency
@@ -199,7 +199,7 @@ If you specify a scan consistency of `not_bounded` for a statement within the tr
199199
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`.
200200

201201
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.
203203

204204
.Overriding the transactional scan consistency
205205
[%header, cols="2"]
@@ -209,7 +209,7 @@ If any statement within the transaction uses a full-text index, by means of the
209209

210210
| Not set
211211
| Transactional scan consistency +
212-
(`not_bounded` for full-text search)
212+
(`not_bounded` for Full-Text Search)
213213

214214
| `not_bounded`
215215
| `not_bounded`
@@ -218,7 +218,7 @@ If any statement within the transaction uses a full-text index, by means of the
218218
`statement_plus` +
219219
`at_plus`
220220
| `request_plus` +
221-
(`not_bounded` for full-text search)
221+
(`not_bounded` for Full-Text Search)
222222
|===
223223

224224
[#section_srh_tlm_n1b]
@@ -402,13 +402,13 @@ include::query-settings.adoc[tag=note-positions]
402402
--
403403
====
404404

405-
For more details and examples, including examples using SDKs, see the xref:guides:prep-statements.adoc[] guide.
405+
For more information and examples, including examples using SDKs, see the xref:guides:prep-statements.adoc[] guide.
406406

407407
ifdef::flag-devex-rest-api[]
408408
== Related Links
409409

410-
* For more details about the {sqlpp} REST API, refer to {n1ql-rest-api-index}[].
411-
* For more details about the Admin REST API, refer to {n1ql-rest-api-admin}[].
412-
* For more details about the Query Settings API, refer to {rest-cluster-query-settings}[].
413-
* For more details about API content and settings, refer to {rest-intro}[].
410+
* For more information about the {sqlpp} REST API, see {n1ql-rest-api-index}[].
411+
* For more information about the Admin REST API, see {n1ql-rest-api-admin}[].
412+
* For more information about the Query Settings API, see {rest-cluster-query-settings}[].
413+
* For more information about API content and settings, see {rest-intro}[].
414414
endif::flag-devex-rest-api[]

preview/HEAD.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
sources:
22
docs-capella:
33
branches: [8-0-docs-uptake]
4+
cb-swagger:
5+
branches: [capella]
46
override:
57
site:
68
startPage: cloud:get-started:intro.adoc

0 commit comments

Comments
 (0)