Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7f46e3b

Browse files
authored
test(Makefile): fix postgresql memory usage (#16170)
1 parenteda8190 commit7f46e3b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎Makefile‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,17 @@ test-migrations: test-postgres-docker
864864
# NOTE: we set --memory to the same size as a GitHub runner.
865865
test-postgres-docker:
866866
docker rm -f test-postgres-docker-${POSTGRES_VERSION}||true
867+
# Make sure to not overallocate work_mem and max_connections as each
868+
# connection will be allowed to use this much memory. Try adjusting
869+
# shared_buffers instead, if needed.
870+
#
871+
# - work_mem=8MB * max_connections=1000 = 8GB
872+
# - shared_buffers=2GB + effective_cache_size=1GB = 3GB
873+
#
874+
# This leaves 5GB for the rest of the system _and_ storing the
875+
# database in memory (--tmpfs).
876+
#
877+
# https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-WORK-MEM
867878
docker run\
868879
--env POSTGRES_PASSWORD=postgres\
869880
--env POSTGRES_USER=postgres\
@@ -876,9 +887,9 @@ test-postgres-docker:
876887
--detach\
877888
--memory 16GB\
878889
gcr.io/coder-dev-1/postgres:${POSTGRES_VERSION}\
879-
-c shared_buffers=1GB\
880-
-c work_mem=1GB\
890+
-c shared_buffers=2GB\
881891
-c effective_cache_size=1GB\
892+
-c work_mem=8MB\
882893
-c max_connections=1000\
883894
-c fsync=off\
884895
-c synchronous_commit=off\

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp