alert: mention shard merging in alert's next steps (#47895)

Shard merging reduces the number of mmapped files and is a good option
to resolve this alert.

## Test plan
- just a copy change 

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
This commit is contained in:
Stefan Hengl 2023-02-24 10:07:23 +01:00 committed by GitHub
parent d4ac80bde5
commit 6bcdf37544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 6 deletions

View File

@ -6578,12 +6578,17 @@ Generated query for warning alert: `max((sum by (code) (increase(src_zoekt_reque
- If you are running out of memory map areas, you could resolve this by:
- Enabling shard merging for Zoekt: Set SRC_ENABLE_SHARD_MERGING="1" for zoekt-indexserver. Use this option
if your corpus of repositories has a high percentage of small, rarely updated repositories. See
[documentation](https://docs.sourcegraph.com/code_search/explanations/search_details#shard-merging).
- Creating additional Zoekt replicas: This spreads all the shards out amongst more replicas, which
means that each _individual_ replica will have fewer shards. This, in turn, decreases the
amount of memory map areas that a _single_ replica can create (in order to load the shards into memory).
- Increase the virtual memory subsystem`s "max_map_count" parameter which defines the upper limit of memory areas
a process can use. The exact instructions for tuning this parameter can differ depending on your environment.
See https://kernel.org/doc/Documentation/sysctl/vm.txt for more information.
- Increasing the virtual memory subsystem`s "max_map_count" parameter which defines the upper limit of memory areas
a process can use. The default value of max_map_count is usually 65536. We recommend to set this value to 2x the number
of repos to be indexed per Zoekt instance. This means, if you want to index 240k repositories with 3 Zoekt instances,
set max_map_count to (240000 / 3) * 2 = 160000. The exact instructions for tuning this parameter can differ depending
on your environment. See https://kernel.org/doc/Documentation/sysctl/vm.txt for more information.
- More help interpreting this metric is available in the [dashboards reference](./dashboards.md#zoekt-memory-map-areas-percentage-used).
- **Silence this alert:** If you are aware of this alert and want to silence notifications for it, add the following to your site configuration and set a reminder to re-evaluate the alert:

View File

@ -830,12 +830,17 @@ func Zoekt() *monitoring.Dashboard {
NextSteps: `
If you are running out of memory map areas, you could resolve this by:
- Enabling shard merging for Zoekt: Set SRC_ENABLE_SHARD_MERGING="1" for zoekt-indexserver. Use this option
if your corpus of repositories has a high percentage of small, rarely updated repositories. See
[documentation](https://docs.sourcegraph.com/code_search/explanations/search_details#shard-merging).
- Creating additional Zoekt replicas: This spreads all the shards out amongst more replicas, which
means that each _individual_ replica will have fewer shards. This, in turn, decreases the
amount of memory map areas that a _single_ replica can create (in order to load the shards into memory).
- Increase the virtual memory subsystem's "max_map_count" parameter which defines the upper limit of memory areas
a process can use. The exact instructions for tuning this parameter can differ depending on your environment.
See https://kernel.org/doc/Documentation/sysctl/vm.txt for more information.
- Increasing the virtual memory subsystem's "max_map_count" parameter which defines the upper limit of memory areas
a process can use. The default value of max_map_count is usually 65536. We recommend to set this value to 2x the number
of repos to be indexed per Zoekt instance. This means, if you want to index 240k repositories with 3 Zoekt instances,
set max_map_count to (240000 / 3) * 2 = 160000. The exact instructions for tuning this parameter can differ depending
on your environment. See https://kernel.org/doc/Documentation/sysctl/vm.txt for more information.
`,
},
},