Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
Set GOGC=50 on Zoekt (#5199)
Browse files Browse the repository at this point in the history
* cmd/server/shared: set GOGC=50 on Zoekt (see sourcegraph/sourcegraph#3792)

* dev: set GOGC=50 on Zoekt (see sourcegraph/sourcegraph#3792)

* CHANGELOG: mention Zoekt GOGC=50 memory consumption change

* fixup
  • Loading branch information
emidoots authored Aug 14, 2019
1 parent 50e541a commit 7991a47
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ All notable changes to Sourcegraph are documented in this file.
- In the [GitHub external service config](https://docs.sourcegraph.com/admin/external_service/github#configuration) it's now possible to specify `orgs` without specifying `repositoryQuery` or `repos` too.
- Out-of-the-box TypeScript code intelligence is much better with an updated ctags version with a built-in TypeScript parser.
- Sourcegraph uses Git protocol version 2 for increased efficiency and performance when fetching data from compatible code hosts.
- Zoekt now runs with GOGC=50 by default, helping to reduce the memory consumption of Sourcegraph. [#3792](https://github.com/sourcegraph/sourcegraph/issues/3792)

### Fixed

Expand Down
4 changes: 2 additions & 2 deletions cmd/server/shared/zoekt.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func maybeZoektProcFile() []string {
}

return []string{
fmt.Sprintf("zoekt-indexserver: zoekt-sourcegraph-indexserver -sourcegraph_url http://%s -index %s -interval 1m -listen 127.0.0.1:6072 %s", frontendInternalHost, indexDir, debugFlag),
fmt.Sprintf("zoekt-webserver: zoekt-webserver -rpc -pprof -listen %s -index %s", defaultHost, indexDir),
fmt.Sprintf("zoekt-indexserver: env GOGC=50 zoekt-sourcegraph-indexserver -sourcegraph_url http://%s -index %s -interval 1m -listen 127.0.0.1:6072 %s", frontendInternalHost, indexDir, debugFlag),
fmt.Sprintf("zoekt-webserver: env GOGC=50 zoekt-webserver -rpc -pprof -listen %s -index %s", defaultHost, indexDir),
}
}
5 changes: 5 additions & 0 deletions dev/zoekt-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ if [[ "$1" == "zoekt-sourcegraph-indexserver" ]]; then
sleep 5
fi

# Mirroring:
# - https://github.com/sourcegraph/infrastructure/blob/d67cfdaf7760b926df165745e40f7bd9507d1c20/docker-images/zoekt-indexserver/Dockerfile#L28-L35
# - https://github.com/sourcegraph/infrastructure/blob/d67cfdaf7760b926df165745e40f7bd9507d1c20/docker-images/zoekt-webserver/Dockerfile#L27-L34
export GOGC=50

exec $@

0 comments on commit 7991a47

Please sign in to comment.