-
Notifications
You must be signed in to change notification settings - Fork 183
DOC-12044 set cbbackupmgr threads #3606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,183 @@ | ||
| = Manage Backup Service Threads | ||
| :description: You can change the number of threads a Backup Service node uses when backing up data. | ||
| :stem: latexmath | ||
|
|
||
| [abstract] | ||
| {description} | ||
|
|
||
| == HTTP Methods and URIs | ||
|
|
||
| .Get all overrides to the thread Backup Service settings | ||
| [source, uri] | ||
| ---- | ||
| GET /api/v1/nodesThreadsMap | ||
| ---- | ||
|
|
||
| .Overwrite all thread settings with new values | ||
| [source, uri] | ||
| ---- | ||
| POST /api/v1/nodesThreadsMap | ||
| ---- | ||
|
|
||
| .Update some thread settings | ||
| [source, uri] | ||
| ---- | ||
| PATCH /api/v1/nodesThreadsMap | ||
| ---- | ||
|
|
||
| == Description | ||
|
|
||
| The `nodesThreadMap` endpoint lets you change the number of threads the Backup Service uses on a node. | ||
| The default number of threads the Backup Service uses is based on the number of CPU cores in the node: stem:[\max(1, cpu\_cores \times 0.75)]. | ||
| The number of threads also sets the number of concurrent client connections the service uses to retrieve data from nodes in the cluster. | ||
| Each thread creates one connection. | ||
| See xref:learn:services-and-indexes/services/backup-service.adoc#threads[Thread Usage] for more information about how the number of threads affects the Backup Service. | ||
|
|
||
| == Curl Syntax | ||
|
|
||
| .Get the current thread overrides | ||
| [source, console] | ||
| ---- | ||
| curl -u $USER:$PASSWORD -X GET \ | ||
| http://$BACKUP_SERVICE_NODE:$BACKUP_SERVICE_PORT/api/v1/nodesThreads | ||
| ---- | ||
|
|
||
| .Overwrite all thread settings | ||
| [source, console] | ||
| ---- | ||
| curl -u Administrator:password -X POST \ | ||
| http://$BACKUP_SERVICE_NODE:$BACKUP_SERVICE_PORT/api/v1/nodesThreadsMap \ | ||
| -d <nodes_thread_map> | ||
| ---- | ||
|
|
||
| .Update/set some thread settings | ||
| [source, console] | ||
| ---- | ||
| curl -u Administrator:password -X PATCH \ | ||
| http://$BACKUP_SERVICE_NODE:$BACKUP_SERVICE_PORT/api/v1/nodesThreadsMap \ | ||
| -d <nodes_thread_map> | ||
| ---- | ||
|
|
||
| .POST Parameters | ||
| [cols="2,3,2"] | ||
| |=== | ||
| |Name | Description | Schema | ||
|
|
||
| | `nodes_thread_map` | ||
| | An object that sets the number of threads for Backup Service nodes. | ||
| When you use the `PATCH` method, the changes only apply to the nodes in the map. | ||
| Any existing settings that are not in the map remain in effect. | ||
| Calling `POST`, removes any existing overrides. | ||
| After the call, only the overrides you supply in the map are in effect. | ||
| | <<nodes_thread_map_schema,Node Threads Map>> | ||
|
|
||
| |=== | ||
|
|
||
| [#nodes_thread_map_schema] | ||
| .Node Thread Map Schema | ||
| [source, json] | ||
| ---- | ||
| {"nodes_threads_map": { | ||
| <backup_node_uuid>:<threads>, . . . | ||
| } | ||
| } | ||
| ---- | ||
|
|
||
| [cols="2,3,2"] | ||
| |=== | ||
| |Name | Description | Schema | ||
|
|
||
| | `backup_node_uuid` | ||
| | The unique identifier for a node running the Backup Service. | ||
| You can get this value from the `/pools/nodes` REST API. | ||
| See xref:rest-api:rest-node-get-info.adoc[]. | ||
| | string | ||
|
|
||
| | `threads` | ||
| a| The number of threads for the Backup Service to use. | ||
|
|
||
| When set to `0`, the Backup Service uses the default number of threads based on the number of CPU cores in the node: stem:[\max(1, cpu\_cores \times 0.75)]. | ||
| | integer | ||
|
|
||
| |=== | ||
|
|
||
|
|
||
| == Responses | ||
| [cols="1,3"] | ||
| |=== | ||
| | Value | Description | ||
|
|
||
| | `200 OK` | ||
| a| Successful calls to `POST` and `PATCH` just return the response code. | ||
|
|
||
| When calling the `GET` method, you receive a JSON object mapping the node UUIDs to thread values. | ||
| See <<examples,Examples>> for details. | ||
|
|
||
| |`403 Forbidden` | ||
| a| User does not have the proper permission to call the API endpoint. | ||
|
|
||
| In addition, the call returns a JSON object similar to the following: | ||
|
|
||
| [source,json] | ||
| ---- | ||
| { | ||
| "message": "Forbidden. User needs one of the following permissions", | ||
| "permissions": [ | ||
| "ro_admin" | ||
| ] | ||
| } | ||
| ---- | ||
|
|
||
| | `404 Not Found` | ||
| a| The resource was not found. | ||
|
|
||
| If you call the `GET` method before you have created a nodes threads map by calling `POST` or `PATCH`, you also receive the following JSON message: | ||
|
|
||
| [source, json] | ||
| ---- | ||
| { | ||
| "status":404, | ||
| "msg":"Could not find the Nodes Threads Map", | ||
| "extras":"element not found" | ||
| } | ||
| ---- | ||
|
|
||
| |=== | ||
|
|
||
| == Required Permissions | ||
|
|
||
| * `GET`: Full Admin, Backup Full Admin, Read-Only Admin | ||
| * `POST` and `PATCH`: Full Admin, Backup Full Admin | ||
|
|
||
| [#examples] | ||
| == Examples | ||
|
|
||
| .Set a backup service node to use a single thread, overwriting any existing overrides | ||
| [source, console] | ||
| ---- | ||
| curl -s -u Administrator:password -X \ | ||
| POST http://localhost:8097/api/v1/nodesThreadsMap \ | ||
| -d '{"nodes_threads_map":{"cb5c77719df4f33131251afdca00531a":1}}' | ||
| ---- | ||
|
|
||
| .Get the thread settings | ||
| [source, console] | ||
| ---- | ||
| curl -s -u Administrator:password -X \ | ||
| GET http://node3:8097/api/v1/nodesThreadsMap | jq | ||
| ---- | ||
|
|
||
| The previous example returns output similar to the following: | ||
|
|
||
| [source,json] | ||
| ---- | ||
| { | ||
| "cb5c77719df4f33131251afdca00531a": 1 | ||
| } | ||
| ---- | ||
|
|
||
| == See Also | ||
|
|
||
| * For a an overview of the Backup Service, see xref:learn:services-and-indexes/services/backup-service.adoc[Backup Service]. | ||
| * For a step-by-step guide to configure and use the Backup Service using the Couchbase Server Web Console, see xref:manage:manage-backup-and-restore/manage-backup-and-restore.adoc[Manage Backup and Restore]. | ||
| * See xref:learn:services-and-indexes/services/backup-service.adoc#threads[Thread Usage] for more information about how the number of threads affects the Backup Service. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're mentioning the advantage of reducing the threads on the resources, i think it could be beneficial in mentioning that this will increase the time taken by the backup. The tradeoff is resources or time, and this threads setting gives the customer the choice to fine tune it based on their system and constraints.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. However, I think it would be better to add that to the Thread Usage section in the Backup Service instead of the What's New section. I've made that update and will rebuild the preview site.