Skip to content

Commit

Permalink
pd: set madvdontneed=1 to shrink RSS after GC (#2019)
Browse files Browse the repository at this point in the history
  • Loading branch information
lhy1024 authored and kaaaaaaang committed Nov 22, 2022
1 parent a6ebf00 commit d89a525
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions embed/templates/scripts/run_pd.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ cd "${DEPLOY_DIR}" || exit 1
{{- end}}

{{- if .NumaNode}}
exec numactl --cpunodebind={{.NumaNode}} --membind={{.NumaNode}} bin/pd-server \
exec numactl --cpunodebind={{.NumaNode}} --membind={{.NumaNode}} env GODEBUG=madvdontneed=1 bin/pd-server \
{{- else}}
exec bin/pd-server \
exec env GODEBUG=madvdontneed=1 bin/pd-server \
{{- end}}
--name="{{.Name}}" \
--client-urls="{{.Scheme}}://{{.ListenHost}}:{{.ClientPort}}" \
Expand Down
4 changes: 2 additions & 2 deletions embed/templates/scripts/run_pd_scale.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ cd "${DEPLOY_DIR}" || exit 1
{{- end}}

{{- if .NumaNode}}
exec numactl --cpunodebind={{.NumaNode}} --membind={{.NumaNode}} bin/pd-server \
exec numactl --cpunodebind={{.NumaNode}} --membind={{.NumaNode}} env GODEBUG=madvdontneed=1 bin/pd-server \
{{- else}}
exec bin/pd-server \
exec env GODEBUG=madvdontneed=1 bin/pd-server \
{{- end}}
--name="{{.Name}}" \
--client-urls="{{.Scheme}}://{{.ListenHost}}:{{.ClientPort}}" \
Expand Down

0 comments on commit d89a525

Please sign in to comment.