File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,12 @@ func (archiver *BarmanArchiver) CheckWalArchiveDestination(ctx context.Context,
193193 return nil
194194}
195195
196- // fadviseNotUsed issues an fadvise to the OS to inform that the file is not needed anymore
196+ // fadviseNotUsed issues an fadvise to the OS to inform that the file is not needed anymore.
197+ // This is necessary because we run in a separate container from PostgreSQL in Kubernetes.
198+ // Without this hint, archived WALs accumulate in page cache since memory pressure on large
199+ // machines is typically insufficient to evict them, wasting memory that could be used for
200+ // active workloads. PostgreSQL handles its own cache management, but our archiver sidecar
201+ // needs to do the same for the files it processes.
197202func (archiver * BarmanArchiver ) fadviseNotUsed (fileName string ) (err error ) {
198203 file , err := os .Open (filepath .Clean (fileName ))
199204 if err != nil {
You can’t perform that action at this time.
0 commit comments