본문으로 건너뛰기

wal_sync_method

버전기본값context타입
14the first method in the above list that is supported by the platformsighupenum
15the first method in the above list that is supported by the platformsighupenum
16the first method in the above list that is supported by the platformsighupenum
17the first method in the above list that is supported by the platformsighupenum
18the first method in the above list that is supported by the platformsighupenum
19the first method in the above list that is supported by the platformsighupenum

WAL 갱신 내용을 디스크로 강제로 내려쓰는 방법을 지정한다. fsync가 꺼져 있으면 WAL 파일 갱신을 강제로 내려쓰지 않으므로 이 설정은 의미가 없다.

가능한 값은 open_datasync(O_DSYNC 옵션으로 WAL 파일 open), fdatasync(commit마다 fdatasync() 호출), fsync(commit마다 fsync() 호출), fsync_writethrough(commit마다 fsync() 호출 + 디스크 write cache의 write-through 강제), open_sync(O_SYNC 옵션으로 WAL 파일 open)다. 모든 플랫폼에서 모든 값을 쓸 수 있는 것은 아니다. 기본값은 플랫폼이 지원하는 위 목록의 첫 번째 방법이지만, Linux와 FreeBSD에서는 fdatasync가 기본이다. postgresql.conf나 서버 커맨드라인에서만 설정할 수 있다.

기본값이 반드시 최적이라는 보장은 없다. crash-safe 구성을 만들거나 최적 성능을 내려면 이 설정이나 시스템 구성의 다른 측면을 조정해야 할 수도 있다.

운영 노트: pg_test_fsync 도구로 해당 플랫폼에서 각 방법의 성능을 측정해 볼 수 있다. 다만 빠르다고 좋은 것이 아니다 — 그 방법이 휘발성 디스크 캐시를 통과해 실제로 안정적인 저장소까지 내려쓰는지를 먼저 확인해야 한다.

출처: PostgreSQL 18 문서